[svn r391] - Fixed ticket 1674323; trunk
authormorphbr
Mon Mar 05 21:58:21 2007 +0000 (2007-03-05)
branchtrunk
changeset 3864184f56767b8
parent 385 ab93678082df
child 387 f8eb1446ff5a
[svn r391] - Fixed ticket 1674323;
- Fixed ticket 1674304 (pending);
gmyth/src/gmyth_http.c
gmyth/src/gmyth_jobqueue.c
gmyth/src/gmyth_recprofile.c
gmyth/src/gmyth_recprofile.h
gmyth/tests/gmyth_test_http.c
     1.1 --- a/gmyth/src/gmyth_http.c	Sun Mar 04 06:53:50 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_http.c	Mon Mar 05 21:58:21 2007 +0000
     1.3 @@ -625,17 +625,63 @@
     1.4  {
     1.5  
     1.6      if (profile->name != NULL && profile->group != NULL &&
     1.7 -        profile->vcodec && profile->acodec)
     1.8 +        profile->vcodec && profile->acodec && profile->options != NULL)
     1.9      {
    1.10          GString* command = g_string_new("");
    1.11          g_string_printf(command, "createRecProfiles?profilename=%s&"\
    1.12 -                                "groupname=%s&vcodec=%s&acodec=%s",
    1.13 -                                profile->name, profile->group,
    1.14 -                                profile->vcodec, profile->acodec);
    1.15 +                                 "groupname=%s&vcodec=%s&acodec=%s&"\
    1.16 +                                 "transcodelossless=%d&transcoderesize=%d&"\
    1.17 +                                 "width=%d&height=%d&rtjpegquality=%d&"\
    1.18 +                                 "rtjpeglumafilter=%d&rtjpegchromafilter=%d&"\
    1.19 +                                 "mpeg4bitrate=%d&mpeg4maxquality=%d&"\
    1.20 +                                 "mpeg4minquality=%d&mpeg4qualdiff=%d&"\
    1.21 +                                 "mpeg4scalebitrate=%d&mpeg4optionvhq=%d&"\
    1.22 +                                 "mpeg4option4mv=%d&mpeg4optionidct=%d&"\
    1.23 +                                 "mpeg4optionime=%d&hardwaremjpegquality=%d&"\
    1.24 +                                 "hardwaremjpeghdecimation=%d&hardwaremjpegvdecimation=%d&"\
    1.25 +                                 "mpeg2streamtype=%s&mpeg2aspectratio=%s&"\
    1.26 +                                 "mpeg2bitrate=%d&mpeg2maxbitrate=%d&"\
    1.27 +                                 "samplerate=%d&mp3quality=%d&"\
    1.28 +                                 "volume=%d&mpeg2audtype=%s&"\
    1.29 +                                 "mpeg2audbitratel1=%d&mpeg2audbitratel2=%d&"\
    1.30 +                                 "mpeg2audvolume=%d",
    1.31 +                                 profile->name, profile->group,
    1.32 +                                 profile->vcodec, profile->acodec,
    1.33 +                                 profile->options->transcodelossless,
    1.34 +                                 profile->options->transcoderesize,
    1.35 +                                 profile->options->width,
    1.36 +                                 profile->options->height,
    1.37 +                                 profile->options->rtjpegquality,
    1.38 +                                 profile->options->rtjpeglumafilter,
    1.39 +                                 profile->options->rtjpegchromafilter,
    1.40 +                                 profile->options->mpeg4bitrate,
    1.41 +                                 profile->options->mpeg4maxquality,
    1.42 +                                 profile->options->mpeg4minquality,
    1.43 +                                 profile->options->mpeg4qualdiff,
    1.44 +                                 profile->options->mpeg4scalebitrate,
    1.45 +                                 profile->options->mpeg4optionvhq,
    1.46 +                                 profile->options->mpeg4option4mv,
    1.47 +                                 profile->options->mpeg4optionidct,
    1.48 +                                 profile->options->mpeg4optionime,
    1.49 +                                 profile->options->hardwaremjpegquality,
    1.50 +                                 profile->options->hardwaremjpeghdecimation,
    1.51 +                                 profile->options->hardwaremjpegvdecimation,
    1.52 +                                 profile->options->mpeg2streamtype,
    1.53 +                                 profile->options->mpeg2aspectratio,
    1.54 +                                 profile->options->mpeg2bitrate,
    1.55 +                                 profile->options->mpeg2maxbitrate,
    1.56 +                                 profile->options->samplerate,
    1.57 +                                 profile->options->mp3quality,
    1.58 +                                 profile->options->volume,
    1.59 +                                 profile->options->mpeg2audtype,
    1.60 +                                 profile->options->mpeg2audbitratel1,
    1.61 +                                 profile->options->mpeg2audbitratel2,
    1.62 +                                 profile->options->mpeg2audvolume
    1.63 +                                );
    1.64  
    1.65  
    1.66          return rec_profile_common(backend_info, command);
    1.67 -    } 
    1.68 +    }
    1.69      else
    1.70          return -1;
    1.71  }
    1.72 @@ -789,6 +835,9 @@
    1.73          field, so we provide one */
    1.74      curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "libcurl-agent/1.0");
    1.75  
    1.76 +    /* set timeout */
    1.77 +    curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 20);
    1.78 +
    1.79      /* get it! */
    1.80      curl_easy_perform(curl_handle);
    1.81  
     2.1 --- a/gmyth/src/gmyth_jobqueue.c	Sun Mar 04 06:53:50 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_jobqueue.c	Mon Mar 05 21:58:21 2007 +0000
     2.3 @@ -79,6 +79,8 @@
     2.4      gmyth_string_list_append_string (retlist, command);
     2.5      gmyth_socket_write_stringlist (socket, retlist);
     2.6  
     2.7 +    g_free(command);
     2.8 +
     2.9      // receive answer
    2.10      gmyth_socket_read_stringlist (socket, retlist);
    2.11      return gmyth_string_list_get_string(retlist, 0);
    2.12 @@ -134,7 +136,12 @@
    2.13          GString* ret = send_command(socket, "ADD", job, transcode->chanid,
    2.14                                      transcode->starttime, options->str);
    2.15  
    2.16 -        return test_result(ret->str, "JOBQUEUE_OK");
    2.17 +        g_free(options);
    2.18 +        g_free(socket);
    2.19 +        int res = test_result(ret->str, "JOBQUEUE_OK");
    2.20 +        g_free(ret);
    2.21 +
    2.22 +        return res;
    2.23      }
    2.24      else
    2.25      {
    2.26 @@ -161,7 +168,11 @@
    2.27                                      transcode->chanid,
    2.28                                      transcode->starttime, "");
    2.29  
    2.30 -        return test_result(ret->str, "JOBQUEUE_CHANGED_CMD_OK");
    2.31 +        g_free(socket);
    2.32 +        int  res = test_result(ret->str, "JOBQUEUE_CHANGED_CMD_OK");
    2.33 +        g_free(ret);
    2.34 +
    2.35 +        return res;
    2.36      }
    2.37      else
    2.38      {
     3.1 --- a/gmyth/src/gmyth_recprofile.c	Sun Mar 04 06:53:50 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_recprofile.c	Mon Mar 05 21:58:21 2007 +0000
     3.3 @@ -78,7 +78,10 @@
     3.4      if (recprofile->acodec)
     3.5          g_free(recprofile->acodec);
     3.6  
     3.7 -	G_OBJECT_CLASS (gmyth_recprofile_parent_class)->dispose (object);
     3.8 +    if (recprofile->options)
     3.9 +        g_free(recprofile->options);
    3.10 +
    3.11 +    G_OBJECT_CLASS (gmyth_recprofile_parent_class)->dispose (object);
    3.12  }
    3.13  
    3.14  static void
    3.15 @@ -104,6 +107,7 @@
    3.16      recprofile->group = NULL;
    3.17      recprofile->vcodec = NULL;
    3.18      recprofile->acodec = NULL;
    3.19 +    recprofile->options = NULL;
    3.20  
    3.21      return recprofile;
    3.22  }
     4.1 --- a/gmyth/src/gmyth_recprofile.h	Sun Mar 04 06:53:50 2007 +0000
     4.2 +++ b/gmyth/src/gmyth_recprofile.h	Mon Mar 05 21:58:21 2007 +0000
     4.3 @@ -45,6 +45,7 @@
     4.4  #define IS_GMYTH_RECPROFILE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECPROFILE_TYPE))
     4.5  #define GMYTH_RECPROFILE_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECPROFILE_TYPE, GMythRecProfileClass))
     4.6  
     4.7 +typedef struct _Options                 Options;
     4.8  typedef struct _GMythRecProfile         GMythRecProfile;
     4.9  typedef struct _GMythRecProfileClass    GMythRecProfileClass;
    4.10  
    4.11 @@ -57,14 +58,47 @@
    4.12  
    4.13  struct _GMythRecProfile
    4.14  {
    4.15 -  gint	id;
    4.16 -  gchar* name;
    4.17 -  gchar* group;
    4.18 -  gchar* vcodec;
    4.19 -  gchar* acodec;
    4.20 +    gint	id;
    4.21 +    gchar* name;
    4.22 +    gchar* group;
    4.23 +    gchar* vcodec;
    4.24 +    gchar* acodec;
    4.25 +    Options* options;
    4.26  };
    4.27  
    4.28 -
    4.29 +struct _Options
    4.30 +{
    4.31 +    gint transcodelossless;
    4.32 +    gint transcoderesize;
    4.33 +    gint width;
    4.34 +    gint height;
    4.35 +    gint rtjpegquality;
    4.36 +    gint rtjpeglumafilter;
    4.37 +    gint rtjpegchromafilter;
    4.38 +    gint mpeg4bitrate;
    4.39 +    gint mpeg4maxquality;
    4.40 +    gint mpeg4minquality;
    4.41 +    gint mpeg4qualdiff;
    4.42 +    gint mpeg4scalebitrate;
    4.43 +    gint mpeg4optionvhq;
    4.44 +    gint mpeg4option4mv;
    4.45 +    gint mpeg4optionidct;
    4.46 +    gint mpeg4optionime;
    4.47 +    gint hardwaremjpegquality;
    4.48 +    gint hardwaremjpeghdecimation;
    4.49 +    gint hardwaremjpegvdecimation;
    4.50 +    gchar* mpeg2streamtype;
    4.51 +    gchar* mpeg2aspectratio;
    4.52 +    gint mpeg2bitrate;
    4.53 +    gint mpeg2maxbitrate;
    4.54 +    gint samplerate;
    4.55 +    gint mp3quality;
    4.56 +    gint volume;
    4.57 +    gchar* mpeg2audtype;
    4.58 +    gint mpeg2audbitratel1;
    4.59 +    gint mpeg2audbitratel2;
    4.60 +    gint mpeg2audvolume;
    4.61 +};
    4.62  
    4.63  GType gmyth_recprofile_type (void);
    4.64  
     5.1 --- a/gmyth/tests/gmyth_test_http.c	Sun Mar 04 06:53:50 2007 +0000
     5.2 +++ b/gmyth/tests/gmyth_test_http.c	Mon Mar 05 21:58:21 2007 +0000
     5.3 @@ -11,15 +11,15 @@
     5.4  
     5.5      backend_info = gmyth_backend_info_new ();
     5.6  
     5.7 -    gmyth_backend_info_set_hostname (backend_info, "192.168.3.165");
     5.8 +    gmyth_backend_info_set_hostname (backend_info, "192.168.3.166");
     5.9      gmyth_backend_info_set_port (backend_info, 6543);
    5.10      gmyth_backend_info_set_status_port (backend_info, 6544);
    5.11      
    5.12 -    //GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00");
    5.13 -    //GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00");
    5.14 -    //GMythEpg epg;
    5.15 -    //epg  = gmyth_http_retrieve_epg(backend_info, start, end, 0, 2, "True");
    5.16 -
    5.17 +    GTimeVal* start = gmyth_util_string_to_time_val("2006-01-01T00:00");
    5.18 +    GTimeVal* end = gmyth_util_string_to_time_val("2007-01-01T00:00");
    5.19 +    GMythEpg epg;
    5.20 +    epg  = gmyth_http_retrieve_epg(backend_info, start, end, 0, 2, "True");
    5.21 + 
    5.22      //GMythRecorded recorded;
    5.23      //recorded = gmyth_http_retrieve_recorded(backend_info);
    5.24