[svn r130] -replaced g_print to g_debug trunk
authorrenatofilho
Tue Nov 28 14:33:59 2006 +0000 (2006-11-28)
branchtrunk
changeset 129acb4ff7d7d0c
parent 128 d183df7d8459
child 130 c7d451814edf
[svn r130] -replaced g_print to g_debug
gmyth/src/Makefile.am
gmyth/src/gmyth_file_transfer.c
gmyth/src/gmyth_scheduler.c
gmyth/src/gmyth_socket.c
     1.1 --- a/gmyth/src/Makefile.am	Tue Nov 28 14:01:20 2006 +0000
     1.2 +++ b/gmyth/src/Makefile.am	Tue Nov 28 14:33:59 2006 +0000
     1.3 @@ -5,7 +5,7 @@
     1.4  libgmyth_la_SOURCES = 			\
     1.5  	gmyth_common.c				\
     1.6  	gmyth_epg.c 				\
     1.7 -	gmyth_recorder.c		\
     1.8 +	gmyth_recorder.c			\
     1.9  	gmyth_remote_util.c			\
    1.10  	gmyth_tvchain.c				\
    1.11  	gmyth_scheduler.c 			\
    1.12 @@ -13,7 +13,7 @@
    1.13  	gmyth_query.c				\
    1.14  	gmyth_socket.c				\
    1.15  	gmyth_stringlist.c			\
    1.16 -	gmyth_file_transfer.c			\
    1.17 +	gmyth_file_transfer.c		\
    1.18  	gmyth_livetv.c				\
    1.19  	gmyth_backendinfo.c			\
    1.20  	gmyth_programinfo.c			\
    1.21 @@ -25,7 +25,7 @@
    1.22  	$(GOBJECT_CFLAGS)			\
    1.23  	$(GST_CFLAGS) 				\
    1.24  	$(GSTBASE_CFLAGS)			\
    1.25 -	$(GSTPLUGINSBASE_CFLAGS)			\
    1.26 +	$(GSTPLUGINSBASE_CFLAGS)	\
    1.27  	$(MYSQL_CFLAGS)				\
    1.28  	-g3 -O0
    1.29  
    1.30 @@ -36,7 +36,7 @@
    1.31  	-export-dynamic 			\
    1.32  	$(MYSQL_LIBS) 				\
    1.33  	$(GST_LIBS) 				\
    1.34 -	$(GSTBASE_LIBS)			\
    1.35 +	$(GSTBASE_LIBS)				\
    1.36  	$(GSTPLUGINS_LIBS)
    1.37  
    1.38  libgmyth_includedir = 			\
     2.1 --- a/gmyth/src/gmyth_file_transfer.c	Tue Nov 28 14:01:20 2006 +0000
     2.2 +++ b/gmyth/src/gmyth_file_transfer.c	Tue Nov 28 14:33:59 2006 +0000
     2.3 @@ -215,7 +215,7 @@
     2.4    	ret = FALSE;
     2.5    	goto clean_up;
     2.6    }
     2.7 -  g_print ("Listening on Monitor socket...!\n");
     2.8 +  g_debug ("Listening on Monitor socket...!\n");
     2.9    	
    2.10    //condition = g_io_channel_get_buffer_condition( io_channel );
    2.11    
    2.12 @@ -228,7 +228,7 @@
    2.13    
    2.14    gsize len = 0;
    2.15    if (condition & G_IO_HUP) {
    2.16 -    g_print ("Read end of pipe died!\n");
    2.17 +    g_debug ("Read end of pipe died!\n");
    2.18      ret = FALSE;
    2.19      goto clean_up;
    2.20    }
    2.21 @@ -242,7 +242,7 @@
    2.22        io_status = g_io_channel_read_chars( io_channel, trash + recv, 
    2.23        		GMYTHTV_BUFFER_SIZE, &len, &error);
    2.24  
    2.25 -      g_print( "[%s] Received data buffer from IO binary channel... %d bytes gone!\n", 
    2.26 +      g_debug ( "[%s] Received data buffer from IO binary channel... %d bytes gone!\n", 
    2.27        		__FUNCTION__, len );
    2.28        		
    2.29        recv += len;
    2.30 @@ -258,10 +258,10 @@
    2.31    }
    2.32    //ret = g_io_channel_read_chars ( source, &msg, &len, NULL, &err);
    2.33    if ( io_status == G_IO_STATUS_ERROR ) {
    2.34 -    g_print ("[%s] Error reading: %s\n", __FUNCTION__, error != NULL ? error->message : "" );
    2.35 +    g_debug ("[%s] Error reading: %s\n", __FUNCTION__, error != NULL ? error->message : "" );
    2.36      ret = FALSE;
    2.37    }
    2.38 -  g_print ("\n[%s]\tEVENT: Read %d bytes: %s\n\n", __FUNCTION__, len, trash != NULL ? trash : "[no event data]" );
    2.39 +  g_debug ("\n[%s]\tEVENT: Read %d bytes: %s\n\n", __FUNCTION__, len, trash != NULL ? trash : "[no event data]" );
    2.40  
    2.41    //g_cond_signal( io_watcher_cond );
    2.42    
    2.43 @@ -285,7 +285,7 @@
    2.44  
    2.45    gmyth_socket_send_command( transfer->event_sock, base_str );
    2.46    GString *resp = gmyth_socket_receive_response( transfer->event_sock );
    2.47 -  g_print( "[%s] Got Monitor response from %s: %s\n", __FUNCTION__, base_str->str, resp->str );
    2.48 +  g_debug ( "[%s] Got Monitor response from %s: %s\n", __FUNCTION__, base_str->str, resp->str );
    2.49    //g_thread_create( (GThreadFunc)myth_control_sock_listener, transfer->event_sock->sd_io_ch, TRUE, NULL );
    2.50    io_watcher_context = g_main_context_default();
    2.51    //GMainLoop *loop = g_main_loop_new( NULL, TRUE );
    2.52 @@ -310,7 +310,7 @@
    2.53      goto cleanup;
    2.54    }
    2.55  */
    2.56 -  g_print( "[%s]\tOK! Starting listener on the MONITOR event socket...\n", __FUNCTION__ );
    2.57 +  g_debug ( "[%s]\tOK! Starting listener on the MONITOR event socket...\n", __FUNCTION__ );
    2.58    
    2.59    //g_main_loop_run( loop );
    2.60  
    2.61 @@ -379,7 +379,7 @@
    2.62            transfer->file_id, transfer->filesize );
    2.63  
    2.64    if (transfer->filesize < 0 ) {
    2.65 -      g_print( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, transfer->filesize );
    2.66 +      g_debug ( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, transfer->filesize );
    2.67        g_object_unref(transfer->sock);
    2.68        transfer->sock = NULL;
    2.69        return FALSE;
    2.70 @@ -486,7 +486,7 @@
    2.71  
    2.72    gint64 retval = gmyth_string_list_get_int64(strlist, 0);
    2.73    transfer->readposition = retval;
    2.74 -  g_print( "[%s] got reading position pointer from the streaming = %lld\n", 
    2.75 +  g_debug ( "[%s] got reading position pointer from the streaming = %lld\n", 
    2.76        __FUNCTION__, retval );
    2.77  
    2.78    myth_control_release_context( );
    2.79 @@ -571,7 +571,7 @@
    2.80  
    2.81    io_status = g_io_channel_set_encoding( io_channel, NULL, &error );
    2.82    if ( io_status == G_IO_STATUS_NORMAL )
    2.83 -    g_print( "[%s] Setting encoding to binary data socket).\n", __FUNCTION__ );
    2.84 +    g_debug ( "[%s] Setting encoding to binary data socket).\n", __FUNCTION__ );
    2.85  
    2.86    io_cond = g_io_channel_get_buffer_condition( io_channel );  
    2.87  
    2.88 @@ -609,7 +609,7 @@
    2.89      if ( strlist != NULL && gmyth_string_list_length( strlist ) > 0 ) { 
    2.90  	bytes_sent = gmyth_string_list_get_int( strlist,  0 ); // -1 on backend error
    2.91  
    2.92 -	g_print( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
    2.93 +	g_debug ( "[%s] got SENT buffer message = %d\n", __FUNCTION__, bytes_sent );
    2.94        	if ( bytes_sent != 0 ) {
    2.95        		
    2.96        		data_buffer = g_new0( gchar, bytes_sent );    
     3.1 --- a/gmyth/src/gmyth_scheduler.c	Tue Nov 28 14:01:20 2006 +0000
     3.2 +++ b/gmyth/src/gmyth_scheduler.c	Tue Nov 28 14:33:59 2006 +0000
     3.3 @@ -258,7 +258,7 @@
     3.4      
     3.5      g_string_printf (query_str, 
     3.6      	"SELECT recordid,programid,chanid,starttime,progstart,"
     3.7 -    	"endtime,progend,title,subtitle,description,category,basename FROM recorded;");
     3.8 +    	"endtime,progend,title,subtitle,description,category,basename FROM recorded WHERE recgroup != 'LiveTV'");
     3.9  
    3.10  	if (scheduler->msqlquery == NULL) {
    3.11  		g_warning ("[%s] Scheduler db connection not initialized", __FUNCTION__);
    3.12 @@ -628,3 +628,48 @@
    3.13      g_string_free(datastr, TRUE);
    3.14      g_object_unref(strlist);
    3.15  }
    3.16 +
    3.17 +void
    3.18 +gmyth_scheduler_record_info_get_preview (RecordedInfo *info, GByteArray* data)
    3.19 +{
    3.20 +}
    3.21 +
    3.22 +void
    3.23 +gmyth_scheduler_record_info_free (RecordedInfo *info)
    3.24 +{
    3.25 +    if (info->title != NULL)
    3.26 +        g_string_free (info->title, TRUE);
    3.27 +
    3.28 +    if (info->subtitle != NULL)
    3.29 +        g_string_free (info->subtitle, TRUE);
    3.30 +
    3.31 +    if (info->description != NULL)
    3.32 +        g_string_free (info->description, TRUE);
    3.33 +
    3.34 +    if (info->category != NULL)
    3.35 +        g_string_free (info->category, TRUE);
    3.36 +
    3.37 +    if (info->basename != NULL)
    3.38 +        g_string_free (info->basename, TRUE);
    3.39 +
    3.40 +    g_free (info);
    3.41 +}
    3.42 +
    3.43 +void
    3.44 +gmyth_scheduler_schedule_info_free (ScheduleInfo *info)
    3.45 +{
    3.46 +    if (info->title != NULL)
    3.47 +        g_string_free (info->title, TRUE);
    3.48 +
    3.49 +    if (info->subtitle != NULL)
    3.50 +        g_string_free (info->subtitle, TRUE);
    3.51 +
    3.52 +    if (info->description != NULL)
    3.53 +        g_string_free (info->description, TRUE);
    3.54 +
    3.55 +    if (info->category != NULL)
    3.56 +        g_string_free (info->category, TRUE);
    3.57 +
    3.58 +    g_free (info);
    3.59 +}
    3.60 +
     4.1 --- a/gmyth/src/gmyth_socket.c	Tue Nov 28 14:01:20 2006 +0000
     4.2 +++ b/gmyth/src/gmyth_socket.c	Tue Nov 28 14:33:59 2006 +0000
     4.3 @@ -627,7 +627,7 @@
     4.4      }
     4.5  
     4.6      g_static_mutex_lock( &mutex );
     4.7 -    g_print ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str);
     4.8 +    g_debug ("[%s] Sending command to backend: %s\n", __FUNCTION__, command->str);
     4.9  
    4.10      /*
    4.11         io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
    4.12 @@ -641,11 +641,11 @@
    4.13  
    4.14      buffer = g_strnfill( BUFLEN, ' ' );
    4.15      snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8d", command->len);
    4.16 -    g_print( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
    4.17 +    g_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
    4.18  
    4.19      command = g_string_prepend(command, buffer);
    4.20  
    4.21 -    g_print( "[%s] command = [%s]\n", __FUNCTION__, command->str  );
    4.22 +    g_debug ( "[%s] command = [%s]\n", __FUNCTION__, command->str  );
    4.23  
    4.24      /* write bytes to socket */    
    4.25      io_status = g_io_channel_write_chars( gmyth_socket->sd_io_ch, command->str, 
    4.26 @@ -786,7 +786,7 @@
    4.27  	    if (new_version!=NULL) {
    4.28  		++new_version; /* skip ']' character */
    4.29  		if ( new_version != NULL ) {
    4.30 -		    g_print( "[%s] got MythTV version = %s.\n", __FUNCTION__, new_version );
    4.31 +		    g_debug ( "[%s] got MythTV version = %s.\n", __FUNCTION__, new_version );
    4.32  		    mythtv_version = (gint)g_ascii_strtoull( g_strdup( new_version ), NULL, 10 );
    4.33  		    /* do reconnection to the socket (socket is closed if the MythTV version was wrong) */
    4.34  		    gmyth_socket_connect( gmyth_socket, gmyth_socket->hostname, gmyth_socket->port );
    4.35 @@ -870,7 +870,7 @@
    4.36      /* verify if the input (read) buffer is ready to receive data */
    4.37      io_cond = g_io_channel_get_buffer_condition( gmyth_socket->sd_io_ch );
    4.38  
    4.39 -    g_print ( "[%s] Bytes read = %d\n", __FUNCTION__, bytes_read );
    4.40 +    g_debug ( "[%s] Bytes read = %d\n", __FUNCTION__, bytes_read );
    4.41  
    4.42      if( (io_status == G_IO_STATUS_ERROR) || (bytes_read <= 0) ) {
    4.43  		g_warning ("[%s] Error in mythprotocol response from backend\n", __FUNCTION__);
    4.44 @@ -885,7 +885,7 @@
    4.45  		if ( ( io_cond & G_IO_IN ) != 0 ) {
    4.46  	
    4.47  		    snprintf( buffer, MYTH_PROTOCOL_FIELD_SIZE+1, "%-8s", g_strdup(buffer));
    4.48 -		    g_print( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
    4.49 +		    g_debug ( "[%s] buffer = [%s]\n", __FUNCTION__, buffer  );
    4.50  	
    4.51  		    /* removes trailing whitespace */
    4.52  		    buffer = g_strstrip( buffer );
    4.53 @@ -937,7 +937,7 @@
    4.54  
    4.55      ptr_array = g_ptr_array_sized_new(g_list_length(str_list->glist));
    4.56  
    4.57 -    g_print( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) );    
    4.58 +    g_debug ( "[%s] Number of parameters = %d\n", __FUNCTION__, g_list_length(str_list->glist) );    
    4.59  
    4.60      // FIXME: change this implementation!
    4.61      tmp_list = str_list->glist;
    4.62 @@ -954,7 +954,7 @@
    4.63  
    4.64      g_static_mutex_unlock( &mutex );
    4.65  
    4.66 -    g_print( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array );
    4.67 +    g_debug ( "[%s]\t\tSending the String list = %s\n", __FUNCTION__, str_array );
    4.68  
    4.69      // Sends message to backend	
    4.70      // TODO: implement looping to send remaining data, and add timeout testing!