[svn r622] fixed bug on setup function assignature trunk
authorrenatofilho
Tue May 01 22:45:58 2007 +0100 (2007-05-01)
branchtrunk
changeset 616176270f861b4
parent 615 4fda44a11929
child 617 a76074f53743
[svn r622] fixed bug on setup function assignature
gmyth-stream/gmemcoder/src/gmencoder.c
gmyth-stream/gmemcoder/src/gmencoder.h
     1.1 --- a/gmyth-stream/gmemcoder/src/gmencoder.c	Tue May 01 22:19:50 2007 +0100
     1.2 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c	Tue May 01 22:45:58 2007 +0100
     1.3 @@ -233,6 +233,8 @@
     1.4      GstElement *ret;
     1.5      int i;
     1.6  
     1.7 +    g_debug ("Creating element: %s", factory_name);
     1.8 +
     1.9      ret = gst_element_factory_make (factory_name, element_name);
    1.10      if (ret == NULL)
    1.11          return NULL;
    1.12 @@ -345,8 +347,10 @@
    1.13  	vbin    = gst_bin_new ("vbin");
    1.14  	vqueue	= gst_element_factory_make ("queue", "vqueue");
    1.15  	vcolorspace = gst_element_factory_make ("ffmpegcolorspace", "colorspace");
    1.16 -	vencode = _create_element_with_prop ((encode ? encode : "ffenc_mpeg1video"), "vencode", encode_prop);
    1.17 -    vrate   = gst_element_factory_make ("videorate", "vrate");
    1.18 +
    1.19 +	vencode = _create_element_with_prop (
    1.20 +            (encode != NULL ? encode : "ffenc_mpeg1video"), 
    1.21 +            "vencode", encode_prop);
    1.22  	vqueue_src = gst_element_factory_make ("queue", "queue_src");
    1.23  
    1.24  	if ((vbin == NULL) || (vqueue == NULL) || (vcolorspace == NULL) 
    1.25 @@ -357,7 +361,6 @@
    1.26  		
    1.27  	gst_bin_add_many (GST_BIN (vbin), vqueue, vcolorspace, vencode, vqueue_src, NULL);
    1.28  
    1.29 -
    1.30  	
    1.31      if ((width > 0) && (height > 0)) {        
    1.32          //Scalling video
    1.33 @@ -388,7 +391,9 @@
    1.34      if (fps > 0) {
    1.35          //Changing the video fps
    1.36          GstCaps *vcaps;
    1.37 +        vrate   = gst_element_factory_make ("videorate", "vrate");
    1.38  
    1.39 +        g_debug ("Setting FPS: %.2f", fps);
    1.40          gst_bin_add (GST_BIN (vbin), vrate);
    1.41  
    1.42      	if (gst_element_link (vcolorspace, vrate) == FALSE) {
    1.43 @@ -397,7 +402,7 @@
    1.44      	}
    1.45  
    1.46      	vcaps = gst_caps_new_simple ("video/x-raw-yuv",
    1.47 -					   "framerate", GST_TYPE_FRACTION, (int) (fps * 1000), 1000, NULL);
    1.48 +					   "framerate", GST_TYPE_FRACTION,  (int) (fps * 1000), 1000, NULL);
    1.49  
    1.50          if (gst_element_link_filtered (vrate, vencode, vcaps) == FALSE) { 
    1.51             g_warning ("Fail to link vrate with vencode.");
    1.52 @@ -450,8 +455,8 @@
    1.53  
    1.54  void
    1.55  g_mencoder_setup_stream (GMencoder *self, 
    1.56 +                         const gchar* mux_name,
    1.57                           const gchar* video_encode,
    1.58 -                         const gchar* mux_name,
    1.59                           gchar** video_encode_prop,
    1.60                           gdouble video_fps,
    1.61                           gdouble video_rate,
     2.1 --- a/gmyth-stream/gmemcoder/src/gmencoder.h	Tue May 01 22:19:50 2007 +0100
     2.2 +++ b/gmyth-stream/gmemcoder/src/gmencoder.h	Tue May 01 22:45:58 2007 +0100
     2.3 @@ -34,8 +34,8 @@
     2.4  GType 		g_mencoder_get_type 	 	(void);
     2.5  GMencoder*  g_mencoder_new              (void);
     2.6  void        g_mencoder_setup_stream     (GMencoder *self, 
     2.7 +                                         const gchar* mux_name,
     2.8                                           const gchar* video_encode,
     2.9 -                                         const gchar* mux_name,
    2.10                                           gchar** video_encode_prop,
    2.11                                           gdouble video_fps,
    2.12                                           gdouble video_rate,