gmyth/tests/gmyth_test_http.c
author renatofilho
Wed May 16 23:55:23 2007 +0100 (2007-05-16)
branchtrunk
changeset 681 1d488185037f
parent 594 f36075170a4e
child 750 312d6bc514f3
permissions -rw-r--r--
[svn r687] removed some debug messages
     1 #include <glib-object.h>
     2 #include <gmyth/gmyth.h>
     3 #include <glib.h>
     4 
     5 #include "common.h"
     6 
     7 int
     8 main (int args, const char **argv)
     9 {
    10     GMythBackendInfo *backend_info;
    11     g_type_init();
    12     g_thread_init(NULL);
    13 
    14     backend_info = gmyth_backend_info_new ();
    15 
    16     gmyth_backend_info_set_hostname (backend_info, "192.168.3.165");
    17     gmyth_backend_info_set_port (backend_info, 6543);
    18     gmyth_backend_info_set_status_port (backend_info, 6544);
    19     
    20     GTimeVal* start = gmyth_util_string_to_time_val("2007-03-19T17:00:00");
    21     //GTimeVal* end = gmyth_util_string_to_time_val("2007-03-10T00:00:00");
    22     fprintf(stdout, SYNC_STRING);
    23     fflush(NULL);
    24     getchar();
    25 
    26     //GMythEpg epg;
    27     /*
    28     epg  = gmyth_http_retrieve_epg(backend_info, start, end, 1000, 10000, "1");
    29 
    30     if ( NULL == epg.channelList || g_slist_length( epg.channelList ) <= 0 )
    31     	printf( "Channel list is empty!!!" );
    32  
    33     GMythRecorded recorded;
    34     recorded = gmyth_http_retrieve_recorded(backend_info);
    35 
    36     GMythRecorded_Program* program = recorded.programList->data;
    37     */
    38     GMythRecProfile* profile;
    39 
    40     GSList* profiles = gmyth_http_retrieve_rec_profiles(backend_info, "Transcoders");
    41 
    42     profile = profiles->data;
    43 
    44     gchar* sett = gmyth_http_retrieve_setting(backend_info, "JobQueueTranscodeCommand", "wakko");	
    45 
    46     profile = gmyth_recprofile_new();
    47 
    48     gmyth_recprofile_set_name(profile, "Teste");
    49     gmyth_recprofile_set_group(profile, "Transcoders");
    50     gmyth_recprofile_set_vcodec(profile, "MPEG-4");
    51     gmyth_recprofile_set_acodec(profile, "MP3"); 
    52 
    53     int teste = gmyth_http_create_rec_profile(backend_info, profile);
    54 	
    55     printf("Hello: %d\n", teste);
    56 
    57     int teste2 = gmyth_http_del_rec_profile(backend_info, 56);
    58 
    59     gint ret =  gmyth_http_retrieve_job_status(backend_info, 1000, start);
    60     printf("Status: %d\n\n", ret);
    61 
    62     //if ( profile != NULL )
    63     //	g_object_unref( profile );
    64 
    65     if ( backend_info != NULL )
    66     	g_object_unref( backend_info );
    67 
    68     return(0);
    69 }