# HG changeset patch # User renatofilho # Date 1178055958 -3600 # Node ID 176270f861b4370c8c13a58be97cba2cfdd7be9d # Parent 4fda44a1192994342262f2a2dcce099ea355958b [svn r622] fixed bug on setup function assignature diff -r 4fda44a11929 -r 176270f861b4 gmyth-stream/gmemcoder/src/gmencoder.c --- a/gmyth-stream/gmemcoder/src/gmencoder.c Tue May 01 22:19:50 2007 +0100 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c Tue May 01 22:45:58 2007 +0100 @@ -233,6 +233,8 @@ GstElement *ret; int i; + g_debug ("Creating element: %s", factory_name); + ret = gst_element_factory_make (factory_name, element_name); if (ret == NULL) return NULL; @@ -345,8 +347,10 @@ vbin = gst_bin_new ("vbin"); vqueue = gst_element_factory_make ("queue", "vqueue"); vcolorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace"); - vencode = _create_element_with_prop ((encode ? encode : "ffenc_mpeg1video"), "vencode", encode_prop); - vrate = gst_element_factory_make ("videorate", "vrate"); + + vencode = _create_element_with_prop ( + (encode != NULL ? encode : "ffenc_mpeg1video"), + "vencode", encode_prop); vqueue_src = gst_element_factory_make ("queue", "queue_src"); if ((vbin == NULL) || (vqueue == NULL) || (vcolorspace == NULL) @@ -357,7 +361,6 @@ gst_bin_add_many (GST_BIN (vbin), vqueue, vcolorspace, vencode, vqueue_src, NULL); - if ((width > 0) && (height > 0)) { //Scalling video @@ -388,7 +391,9 @@ if (fps > 0) { //Changing the video fps GstCaps *vcaps; + vrate = gst_element_factory_make ("videorate", "vrate"); + g_debug ("Setting FPS: %.2f", fps); gst_bin_add (GST_BIN (vbin), vrate); if (gst_element_link (vcolorspace, vrate) == FALSE) { @@ -397,7 +402,7 @@ } vcaps = gst_caps_new_simple ("video/x-raw-yuv", - "framerate", GST_TYPE_FRACTION, (int) (fps * 1000), 1000, NULL); + "framerate", GST_TYPE_FRACTION, (int) (fps * 1000), 1000, NULL); if (gst_element_link_filtered (vrate, vencode, vcaps) == FALSE) { g_warning ("Fail to link vrate with vencode."); @@ -450,8 +455,8 @@ void g_mencoder_setup_stream (GMencoder *self, + const gchar* mux_name, const gchar* video_encode, - const gchar* mux_name, gchar** video_encode_prop, gdouble video_fps, gdouble video_rate, diff -r 4fda44a11929 -r 176270f861b4 gmyth-stream/gmemcoder/src/gmencoder.h --- a/gmyth-stream/gmemcoder/src/gmencoder.h Tue May 01 22:19:50 2007 +0100 +++ b/gmyth-stream/gmemcoder/src/gmencoder.h Tue May 01 22:45:58 2007 +0100 @@ -34,8 +34,8 @@ GType g_mencoder_get_type (void); GMencoder* g_mencoder_new (void); void g_mencoder_setup_stream (GMencoder *self, + const gchar* mux_name, const gchar* video_encode, - const gchar* mux_name, gchar** video_encode_prop, gdouble video_fps, gdouble video_rate,