gmyth-stream/gmemcoder/src/gmencoder.c
branchtrunk
changeset 743 f92cd43fea7d
parent 703 bfc97f675c60
child 748 bf9dac4bdc5d
     1.1 --- a/gmyth-stream/gmemcoder/src/gmencoder.c	Wed May 23 21:34:48 2007 +0100
     1.2 +++ b/gmyth-stream/gmemcoder/src/gmencoder.c	Mon Jun 04 19:05:36 2007 +0100
     1.3 @@ -662,12 +662,13 @@
     1.4                    gchar** audio_encode_prop,
     1.5                    guint audio_rate)
     1.6  {
     1.7 -	GstBus *bus = NULL;
     1.8 -	GstElement *pipe = NULL;
     1.9 -	GstElement *sink = NULL;
    1.10 +    GstBus *bus = NULL;
    1.11 +    GstElement *pipe = NULL;
    1.12 +    GstElement *sink = NULL;
    1.13      GstElement *mux = NULL;
    1.14      GstElement *abin = NULL;
    1.15      GstElement *vbin = NULL;    
    1.16 +    GstElement *queue= NULL;
    1.17      GstPad *aux_pad = NULL;
    1.18      GstPad *mux_pad = NULL;
    1.19  #ifdef SUPPORT_MULT_INPUT
    1.20 @@ -688,6 +689,8 @@
    1.21      if (mux == NULL)
    1.22          goto error;
    1.23  
    1.24 +    queue = gst_element_factory_make ("queue", "queueu_sink");
    1.25 +
    1.26  
    1.27      sink = gst_element_factory_make ("fdsink", "sink");
    1.28      if (sink == NULL)
    1.29 @@ -695,6 +698,7 @@
    1.30  
    1.31      g_object_set (G_OBJECT(sink), 
    1.32  			"fd", priv->fd,
    1.33 +			"sync", FALSE,
    1.34              NULL);
    1.35  
    1.36      abin = _create_audio_bin (audio_encode, audio_encode_prop, audio_rate);
    1.37 @@ -706,7 +710,7 @@
    1.38          goto error;
    1.39  
    1.40  	// Finish Pipe
    1.41 -    gst_bin_add_many (GST_BIN (pipe), abin, vbin, mux, sink, NULL);
    1.42 +    gst_bin_add_many (GST_BIN (pipe), abin, vbin, mux, queue, sink, NULL);
    1.43  
    1.44  
    1.45  #ifdef SUPPORT_MULT_INPUT	
    1.46 @@ -753,7 +757,7 @@
    1.47      mux_pad = NULL;
    1.48  
    1.49      //Link mux with sink
    1.50 -    gst_element_link (mux, sink);
    1.51 +    gst_element_link_many (mux, queue, sink, NULL);
    1.52  
    1.53  	bus = gst_pipeline_get_bus (GST_PIPELINE (pipe));
    1.54  	gst_bus_add_watch (bus, _pipeline_bus_cb, self);
    1.55 @@ -808,6 +812,7 @@
    1.56  
    1.57      GstElement *bsrc = NULL;
    1.58      GstElement *src = NULL;
    1.59 +    GstElement *queue = NULL;
    1.60      GstElement *aqueue = NULL;
    1.61      GstElement *vqueue = NULL;
    1.62      GstElement *decode = NULL;
    1.63 @@ -822,10 +827,11 @@
    1.64  	if (src == NULL) 
    1.65  		goto error;
    1.66  
    1.67 -	decode = gst_element_factory_make ("decodebin2", "decode");
    1.68 +	decode = gst_element_factory_make ("decodebin", "decode");
    1.69  	if (decode == NULL) 
    1.70  		goto error;
    1.71  
    1.72 +    queue = gst_element_factory_make ("queue", "queue_src");
    1.73      aqueue = gst_element_factory_make ("queue", "aqueue");
    1.74      if (aqueue == NULL)
    1.75          goto error;
    1.76 @@ -834,8 +840,8 @@
    1.77      if (vqueue == NULL)
    1.78          goto error;
    1.79  
    1.80 -    gst_bin_add_many (GST_BIN (bsrc), src, decode, aqueue, vqueue, NULL);
    1.81 -    gst_element_link (src, decode);
    1.82 +    gst_bin_add_many (GST_BIN (bsrc), src, queue, decode, aqueue, vqueue, NULL);
    1.83 +    gst_element_link_many (src, queue, decode, NULL);
    1.84  
    1.85  	g_signal_connect (G_OBJECT (decode), 
    1.86  				"new-decoded-pad",