# HG changeset patch # User morphbr # Date 1172991230 0 # Node ID ab93678082df1ef0198d2e69c66fda5b5b696683 # Parent 060c3ceb43a0c5c3f51f6dde5538847640c1d021 [svn r390] - Changed all GString* members to gchar* members diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_http.c --- a/gmyth/src/gmyth_http.c Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_http.c Sun Mar 04 06:53:50 2007 +0000 @@ -41,30 +41,30 @@ xmlXPathObjectPtr getnodeset(xmlDocPtr doc, xmlChar *xpath) { - - xmlXPathContextPtr context; - xmlXPathObjectPtr result; - - context = xmlXPathNewContext(doc); - result = xmlXPathEvalExpression(xpath, context); - - if(xmlXPathNodeSetIsEmpty(result->nodesetval)) + + xmlXPathContextPtr context; + xmlXPathObjectPtr result; + + context = xmlXPathNewContext(doc); + result = xmlXPathEvalExpression(xpath, context); + + if(xmlXPathNodeSetIsEmpty(result->nodesetval)) { - g_fprintf(stderr, "Error: No result at XPath\n"); - return NULL; + g_fprintf(stderr, "Error: No result at XPath\n"); + return NULL; } - - xmlXPathFreeContext(context); - return result; + + xmlXPathFreeContext(context); + return result; } -xmlDocPtr XMLParse (const char *content, int length) +xmlDocPtr XMLParse (const char *content, int length) { xmlDocPtr doc; /* the resulting document tree */ doc = xmlReadMemory(content, length, NULL, NULL, 0); - if (doc == NULL) + if (doc == NULL) { g_fprintf(stderr, "Error: Failed to parse XML document\n"); return NULL; @@ -96,34 +96,34 @@ { GMythProgram* program = (GMythProgram*)\ g_malloc(sizeof(struct _GMythProgram)); - - program->title = g_string_new((char *)\ + + program->title = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"title")); - - program->subtitle = g_string_new((char *)\ + + program->subtitle = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"subtitle")); - - program->catType = g_string_new((char *)\ + + program->catType = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"catType")); - - program->category = g_string_new((char *)\ + + program->category = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"category")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"repeat"),\ "%d", &(program->repeat)); - + program->startTime = gmyth_util_string_to_time_val \ ((char *)xmlGetProp(node,(xmlChar *)"startTime")); - + program->endTime = gmyth_util_string_to_time_val \ ((char *)xmlGetProp(node,(xmlChar *)"endTime")); - + program_list = g_slist_append(program_list, program); } node = node->next; } - + return program_list; } @@ -144,11 +144,11 @@ GMythChannel* channel = (GMythChannel*)g_malloc\ (sizeof(struct _GMythChannel)); - channel->channelName = g_string_new((char *)\ + channel->channelName = g_strdup((char *)\ xmlGetProp(node,\ (xmlChar *)"channelName")); - channel->chanNum = g_string_new((char *)\ + channel->chanNum = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"chanNum")); sscanf ((char *)xmlGetProp(node, (xmlChar *)"chanId"),\ @@ -177,19 +177,19 @@ { sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"startChanId"), "%d", &(epg->startChanId)); sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"endChanId"), "%d", &(epg->endChanId)); - - epg->version = g_string_new((char *)xmlGetProp(nodeTab, (xmlChar *)"version")); - + + epg->version = g_strdup((char *)xmlGetProp(nodeTab, (xmlChar *)"version")); + sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"protoVer"), "%d", &(epg->protoVer)); sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"totalCount"), "%d", &(epg->totalCount)); sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"numOfChannels"), "%d", &(epg->numOfChannels)); - + epg->asOf = gmyth_util_string_to_time_val ((char *)xmlGetProp(nodeTab, (xmlChar *)"asOf")); epg->startTime = gmyth_util_string_to_time_val ((char *)xmlGetProp(nodeTab, (xmlChar *)"startTime")); epg->endTime = gmyth_util_string_to_time_val ((char *)xmlGetProp(nodeTab, (xmlChar *)"endTime")); - + sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)"details"), "%d", &(epg->details)); - + // go to Channel section and retrieve Channels and Programs if ( epg->numOfChannels > 0 ) get_Channel_List(nodeTab->children->next->children->next, epg); @@ -242,21 +242,21 @@ { GMythEpg epg; MemoryStruct chunk; - + chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ chunk.size = 0; /* no data at this point */ - - gchar* starttime = (gchar*)g_malloc(sizeof(gchar)*20); + + gchar* starttime; starttime = gmyth_util_time_to_mythformat_from_time_val(StartTime); - - gchar* endtime = (gchar*)g_malloc(sizeof(gchar)*20); + + gchar* endtime; endtime = gmyth_util_time_to_mythformat_from_time_val(EndTime); - + GString* command = g_string_new(""); g_string_printf(command, "getProgramGuide?StartTime=%s&EndTime=%s&StartChanId=%d" "&NumOfChannels=%d&Details=%s", starttime, endtime, \ StartChanId, NumOfChannels, Details); - + chunk = gmyth_http_request(backend_info, command); if (chunk.memory != NULL) { @@ -264,7 +264,7 @@ getEpg(doc, &epg); free(chunk.memory); } - + return epg; } @@ -273,29 +273,29 @@ retrieve_recorded_recording (xmlNodePtr node) { GMythRecorded_Recording recording; - + if (g_ascii_strcasecmp((char *)node->name, "text") != 0) { - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"dupInType"),\ "%d", &(recording.dupInType)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"dupMethod"),\ "%d", &(recording.dupMethod)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"preRollSeconds"),\ "%d", &(recording.preRollSeconds)); - - recording.playGroup = g_string_new((char *)\ + + recording.playGroup = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"playGroup")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"recPriority"),\ "%d", &(recording.recPriority)); - + recording.recStartTs = gmyth_util_string_to_time_val\ ((char *)xmlGetProp(node, (xmlChar *)"recStartTs")); } - + return recording; } @@ -303,35 +303,35 @@ GMythRecorded_Channel retrieve_recorded_channel (xmlNodePtr node) { GMythRecorded_Channel channel; - + if (g_ascii_strcasecmp((char *)node->name, "text") != 0) { - - channel.chanFilters = g_string_new((char *)\ + + channel.chanFilters = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"chanFilters")); - - channel.channelName = g_string_new((char *)\ + + channel.channelName = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"channelName")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"chanNum"),\ "%d", &(channel.chanNum)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"sourceId"),\ "%d", &(channel.sourceId)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"commFree"),\ "%d", &(channel.commFree)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"inputId"),\ "%d", &(channel.inputId)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"chanId"),\ "%d", &(channel.chanId)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"callSign"),\ "%d", &(channel.callSign)); } - + return channel; } @@ -346,75 +346,74 @@ GSList* get_Recorded_Programs(xmlNodePtr node) { GSList* programList = NULL; - + while (node != NULL) { - + if (g_ascii_strcasecmp((char *)node->name, "text") != 0) { - + GMythRecorded_Program* program = (GMythRecorded_Program*)g_malloc\ (sizeof(struct _GMythRecorded_Program)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"programFlags"),\ "%d", &(program->programFlags)); - - program->title = g_string_new((char *)\ + + program->title = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"title")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"programId"),\ "%d", &(program->programId)); - - program->catType = g_string_new((char *)\ + + program->catType = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"catType")); - - program->category = g_string_new((char *)\ + + program->category = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"category")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"seriesId"),\ "%d", &(program->seriesId)); - - + + program->startTime = gmyth_util_string_to_time_val\ ((char *)xmlGetProp(node, (xmlChar *)"startTime")); - + program->endTime = gmyth_util_string_to_time_val\ ((char *)xmlGetProp(node, (xmlChar *)"endTime")); - + program->lastModified = gmyth_util_string_to_time_val\ ((char *)xmlGetProp(node, (xmlChar *)"lastModified")); - + /* TODO: FIX ME at gmyth_util program->asOf = gmyth_util_string_to_time_val\ ((char *)xmlGetProp(node, (xmlChar *)"airdate"));*/ - - - program->subTitle = g_string_new((char *)\ + + program->subTitle = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"subTitle")); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"stars"),\ "%d", &(program->stars)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"repeat"),\ "%d", &(program->repeat)); - + sscanf ((char *)xmlGetProp(node, (xmlChar *)"fileSize"),\ "%d", &(program->repeat)); - - program->hostname = g_string_new((char *)\ + + program->hostname = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"hostname")); - + program->channel = retrieve_recorded_channel(node->children); - + // Skip the \n program->recording = retrieve_recorded_recording(node->children->next->next); - + // add to the list programList = g_slist_append(programList, program); } - + node = node->next; } - + return programList; } @@ -426,22 +425,21 @@ */ void get_Recorded_Properties (xmlNodePtr nodeTab, GMythRecorded* recorded) { - recorded->version = g_string_new((char *)\ + recorded->version = g_strdup((char *)\ xmlGetProp(nodeTab, (xmlChar *)"version")); - + sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)\ "protoVer"), "%d", &(recorded->protoVer)); - + sscanf ((char *)xmlGetProp(nodeTab, (xmlChar *)\ "totalCount"), "%d", &(recorded->totalCount)); - - + recorded->asOf = gmyth_util_string_to_time_val \ ((char *)xmlGetProp(nodeTab, (xmlChar *)"asOf")); - + if ( recorded->totalCount > 0) recorded->programList = get_Recorded_Programs(nodeTab->children->next); - + } @@ -605,7 +603,6 @@ gint gmyth_http_del_rec_profile (GMythBackendInfo *backend_info, gint id) { - int ret = -1; GString* command = g_string_new(""); g_string_printf(command, "delRecProfiles?id=%d", id); @@ -633,8 +630,8 @@ GString* command = g_string_new(""); g_string_printf(command, "createRecProfiles?profilename=%s&"\ "groupname=%s&vcodec=%s&acodec=%s", - profile->name->str, profile->group->str, - profile->vcodec->str, profile->acodec->str); + profile->name, profile->group, + profile->vcodec, profile->acodec); return rec_profile_common(backend_info, command); @@ -691,16 +688,16 @@ sscanf ((char *)xmlGetProp(node, (xmlChar *)\ "id"), "%d", &(profile->id)); - profile->name = g_string_new((char *)\ + profile->name = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"name")); - profile->vcodec = g_string_new((char *)\ + profile->vcodec = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"vcodec")); - profile->acodec = g_string_new((char *)\ + profile->acodec = g_strdup((char *)\ xmlGetProp(node, (xmlChar *)"acodec")); - profile->group = g_string_new(groupname); + profile->group = g_strdup(groupname); profiles = g_slist_append(profiles, profile); } @@ -747,38 +744,6 @@ return realsize; } -/** Create a String containing the URL with the command - * - * @param command A string with the command - * @param variables Vars to use with their values \ - * MUST FINISH WITH NULL!!! - * @return The response - */ -GString* gmyth_http_create_command (GString *command, ...) -{ - va_list args; - va_start(args, command); - gchar* s = NULL; - - g_string_append(command, "?"); - - /* Sintax: var, value */ - while ( (s = va_arg(args, gchar *)) != NULL ) - { - g_string_append(command, s); - g_string_append(command, "="); - s = va_arg(args, gchar *); - g_string_append(command, s); - g_string_append(command, "&"); - } - - free(s); - va_end(args); - - return command; -} - - /** Send HTTP Command and receives the result of it * @@ -786,7 +751,7 @@ * NULL if there is no response. */ MemoryStruct gmyth_http_request (GMythBackendInfo *backend_info, \ - GString *command) + GString *command) { LIBXML_TEST_VERSION @@ -800,33 +765,33 @@ command->str); CURL *curl_handle; - + MemoryStruct chunk; - + chunk.memory=NULL; /* we expect realloc(NULL, size) to work */ chunk.size = 0; /* no data at this point */ - + curl_global_init(CURL_GLOBAL_ALL); - + /* init the curl session */ curl_handle = curl_easy_init(); - + /* specify URL to get */ curl_easy_setopt(curl_handle, CURLOPT_URL, URL); - + /* send all data to this function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEFUNCTION, WriteMemoryCallback); - + /* we pass our 'chunk' struct to the callback function */ curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&chunk); - + /* some servers don't like requests that are made without a user-agent field, so we provide one */ curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0"); - + /* get it! */ curl_easy_perform(curl_handle); - + /* cleanup curl stuff */ curl_easy_cleanup(curl_handle); diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_http.h --- a/gmyth/src/gmyth_http.h Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_http.h Sun Mar 04 06:53:50 2007 +0000 @@ -66,10 +66,10 @@ struct _GMythProgram { - GString* title; - GString* subtitle; - GString* catType; - GString* category; + gchar* title; + gchar* subtitle; + gchar* catType; + gchar* category; gint repeat; GTimeVal* startTime; GTimeVal* endTime; @@ -77,8 +77,8 @@ struct _GMythChannel { - GString* channelName; - GString* chanNum; + gchar* channelName; + gchar* chanNum; gint chanId; gint callSign; GSList* programList; @@ -88,7 +88,7 @@ { gint startChanId; gint endChanId; - GString* version; + gchar* version; gint protoVer; gint totalCount; gint numOfChannels; @@ -105,7 +105,7 @@ gint dupInType; gint dupMethod; gint preRollSeconds; - GString* playGroup; + gchar* playGroup; gint recPriority; GTimeVal* recStartTs; }; @@ -113,8 +113,8 @@ struct _GMythRecorded_Channel { - GString* chanFilters; - GString* channelName; + gchar* chanFilters; + gchar* channelName; gint chanNum; gint sourceId; gint commFree; @@ -127,27 +127,27 @@ struct _GMythRecorded_Program { gint programFlags; - GString* title; + gchar* title; gint programId; - GString* catType; - GString* category; + gchar* catType; + gchar* category; gint seriesId; GTimeVal* startTime; GTimeVal* endTime; GTimeVal* airdate; //? GTimeVal* lastModified; - GString* subTitle; + gchar* subTitle; gint stars; gint repeat; gint fileSize; - GString* hostname; + gchar* hostname; GMythRecorded_Channel channel; GMythRecorded_Recording recording; }; struct _GMythRecorded { - GString* version; + gchar* version; gint protoVer; gint totalCount; GTimeVal* asOf; @@ -170,8 +170,7 @@ gint gmyth_http_create_rec_profile (GMythBackendInfo *backend_info,\ GMythRecProfile* profile); -gint gmyth_http_del_rec_profile (GMythBackendInfo *backend_info, - gint id); +gint gmyth_http_del_rec_profile (GMythBackendInfo *backend_info, gint id); MemoryStruct gmyth_http_request (GMythBackendInfo *backend_info, GString *command); diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_jobqueue.c --- a/gmyth/src/gmyth_jobqueue.c Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_jobqueue.c Sun Mar 04 06:53:50 2007 +0000 @@ -125,14 +125,14 @@ if (transcode->output) g_string_append_printf(options, " JOB_OUTPUT %s",\ - transcode->output_filename->str); + transcode->output_filename); if (transcode->profile != NULL) - g_string_append_printf(options, " %s", transcode->profile->str); + g_string_append_printf(options, " %s", transcode->profile); } GString* ret = send_command(socket, "ADD", job, transcode->chanid, - transcode->starttime->str, options->str); + transcode->starttime, options->str); return test_result(ret->str, "JOBQUEUE_OK"); } @@ -159,7 +159,7 @@ { GString* ret = send_command(socket, action, job, transcode->chanid, - transcode->starttime->str, ""); + transcode->starttime, ""); return test_result(ret->str, "JOBQUEUE_CHANGED_CMD_OK"); } diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_recprofile.c --- a/gmyth/src/gmyth_recprofile.c Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_recprofile.c Sun Mar 04 06:53:50 2007 +0000 @@ -150,4 +150,112 @@ gint id) { return gmyth_http_del_rec_profile(backend_info, id); -} \ No newline at end of file +} + +/** + * + * gmyth_recprofile_set_id + * @brief set recprofile's id + * @param rec GMythRecProfile* + * @param id profile's id + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set_id (GMythRecProfile* rec, gint id) +{ + rec->id = id; + return 0; +} + +/** + * + * gmyth_recprofile_set + * @brief set recprofile's property + * @param rec GMythRecProfile* + * @param member the member you want to modify + * @param value the value + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set (GMythRecProfile* rec, + gchar* member, gchar* value) +{ + int ret = 0; + if (value != NULL) + { + if (g_ascii_strcasecmp(member, "name") == 0) + rec->name = g_strndup(value, strlen(value)); + else + if (g_ascii_strcasecmp(member, "group") == 0) + rec->group = g_strndup(value, strlen(value)); + else + if (g_ascii_strcasecmp(member, "vcodec") == 0) + rec->vcodec = g_strndup(value, strlen(value)); + else + if (g_ascii_strcasecmp(member, "acodec") == 0) + rec->acodec = g_strndup(value, strlen(value)); + else + ret = -1; + } + else + ret = -1; + + return ret; +} + +/** + * + * gmyth_recprofile_set_name + * @brief set recprofile's name + * @param rec GMythRecProfile* + * @param name profile's name + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set_name (GMythRecProfile* rec, gchar* name) +{ + return gmyth_recprofile_set(rec, "name", name); +} + +/** + * + * gmyth_recprofile_set_group + * @brief set recprofile's group + * @param rec GMythRecProfile* + * @param group profile's group + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set_group (GMythRecProfile* rec, gchar* group) +{ + return gmyth_recprofile_set(rec, "group", group); +} + +/** + * + * gmyth_recprofile_set_vcodec + * @brief set recprofile's vcodec + * @param rec GMythRecProfile* + * @param vcodec profile's vcodec + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set_vcodec (GMythRecProfile* rec, gchar* vcodec) +{ + return gmyth_recprofile_set(rec, "vcodec", vcodec); +} + +/** + * + * gmyth_recprofile_set_acodec + * @brief set recprofile's acodec + * @param rec GMythRecProfile* + * @param acodec profile's acodec + * @return gint representing the result + * + **/ +gint gmyth_recprofile_set_acodec (GMythRecProfile* rec, gchar* acodec) +{ + return gmyth_recprofile_set(rec, "acodec", acodec); +} + diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_recprofile.h --- a/gmyth/src/gmyth_recprofile.h Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_recprofile.h Sun Mar 04 06:53:50 2007 +0000 @@ -51,17 +51,17 @@ struct _GMythRecProfileClass { GObjectClass parent_class; - + gint teste; /* callbacks */ }; struct _GMythRecProfile { gint id; - GString* name; - GString* group; - GString* vcodec; - GString* acodec; + gchar* name; + gchar* group; + gchar* vcodec; + gchar* acodec; }; @@ -78,6 +78,12 @@ gint gmyth_recprofile_del_profile_list (GMythBackendInfo *backend_info,\ gint id); +gint gmyth_recprofile_set_acodec (GMythRecProfile* rec, gchar* acodec); +gint gmyth_recprofile_set_vcodec (GMythRecProfile* rec, gchar* vcodec); +gint gmyth_recprofile_set_group (GMythRecProfile* rec, gchar* group); +gint gmyth_recprofile_set_name (GMythRecProfile* rec, gchar* name); +gint gmyth_recprofile_set_id (GMythRecProfile* rec, gint id); + G_END_DECLS #endif /*_GMYTH_RECPROFILE_H*/ diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_transcode.c --- a/gmyth/src/gmyth_transcode.c Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_transcode.c Sun Mar 04 06:53:50 2007 +0000 @@ -109,7 +109,7 @@ * @return gchar* with file or iso format * **/ -GString* gmyth_transcode_date_change_format (gchar* date_s, int format) +gchar* gmyth_transcode_date_change_format (gchar* date_s, int format) { if (date_s != NULL) { @@ -137,7 +137,7 @@ dst[19] = '\0'; } - GString* ret = g_string_new(dst); + gchar* ret = g_strdup(dst); g_free(src); g_free(dst); @@ -160,7 +160,7 @@ gboolean value, gchar* outputfile) { transcode->output = value; - transcode->output_filename = g_string_new(outputfile); + transcode->output_filename = g_strdup(outputfile); } /** @@ -184,6 +184,27 @@ gchar** date = g_strsplit(splited[1], ".", 2); transcode->starttime = gmyth_transcode_date_change_format(date[0], DATE_ISO); - transcode->filename = g_string_new(file); + transcode->filename = g_strdup(file); } } + + +/** + * + * gmyth_transcode_set_profile + * @brief set transcode's profile + * @param rec GMythTranscode* + * @param value the value + * @return gint representing the result + * + **/ +gint gmyth_transcode_set_profile (GMythTranscode* trans, + gchar* value) +{ + if (value != NULL) + trans->profile = g_strndup(value, strlen(value)); + else + return -1; + + return 0; +} diff -r 060c3ceb43a0 -r ab93678082df gmyth/src/gmyth_transcode.h --- a/gmyth/src/gmyth_transcode.h Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/src/gmyth_transcode.h Sun Mar 04 06:53:50 2007 +0000 @@ -72,12 +72,12 @@ gboolean output; /* private begin */ - GString* output_filename; - GString* filename; - GString* profile; + gchar* output_filename; + gchar* filename; + gchar* profile; /* private end */ - GString* starttime; + gchar* starttime; gint chanid; @@ -93,6 +93,8 @@ void gmyth_transcode_set_filename (GMythTranscode* transcode, gchar* file); +gint gmyth_transcode_set_profile (GMythTranscode* trans, gchar* value); + G_END_DECLS #endif /*_GMYTH_TRANSCODE_H*/ diff -r 060c3ceb43a0 -r ab93678082df gmyth/tests/gmyth_test_http.c --- a/gmyth/tests/gmyth_test_http.c Sat Mar 03 00:01:34 2007 +0000 +++ b/gmyth/tests/gmyth_test_http.c Sun Mar 04 06:53:50 2007 +0000 @@ -11,19 +11,39 @@ backend_info = gmyth_backend_info_new (); - gmyth_backend_info_set_hostname (backend_info, "127.0.0.1"); + gmyth_backend_info_set_hostname (backend_info, "192.168.3.165"); gmyth_backend_info_set_port (backend_info, 6543); gmyth_backend_info_set_status_port (backend_info, 6544); - GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00"); - GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00"); - GMythEpg epg; - epg = gmyth_http_retrieve_epg(backend_info, start, end, 0, 2, "True"); + //GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00"); + //GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00"); + //GMythEpg epg; + //epg = gmyth_http_retrieve_epg(backend_info, start, end, 0, 2, "True"); - GMythRecorded recorded; - recorded = gmyth_http_retrieve_recorded(backend_info); + //GMythRecorded recorded; + //recorded = gmyth_http_retrieve_recorded(backend_info); - GMythRecorded_Program* program = recorded.programList->data; + //GMythRecorded_Program* program = recorded.programList->data; + + //GSList* profiles = gmyth_http_retrieve_rec_profiles(backend_info, "Transcoders"); + + //GMythRecProfile* prof = profiles->data; + + + + GMythRecProfile* profile = gmyth_recprofile_new(); + + gmyth_recprofile_set_name(profile, "Teste"); + gmyth_recprofile_set_group(profile, "Transcoders"); + gmyth_recprofile_set_vcodec(profile, "MPEG-4"); + gmyth_recprofile_set_acodec(profile, "MP3"); + + + int teste = gmyth_http_create_rec_profile(backend_info, profile); + + printf("Hello: %d\n", teste); + + int teste2 = gmyth_http_del_rec_profile(backend_info, 56); return 0; }