<div dir="ltr"><div>The secret is to not add any elements to a pipeline that aren't going to be used by the pipeline. I have a very similar setup in my application and I ended up creating output bins for the audio and video outputs. Then on a pad-added signal I insert the needed bin and connect it to the pad.<br>
<br></div>On EOS, after the pipeline is put into the ready state I pull the two bins back out of the pipeline in anticipation of the next file to play.<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, May 13, 2013 at 5:05 PM, Jorge Fernandez Monteagudo <span dir="ltr"><<a href="mailto:jorgefm@cirsa.com" target="_blank">jorgefm@cirsa.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all!<br>
<br>
I have implemented this pipeline by code:<br>
<br>
gst-launch-0.10 filesrc location=test.mp4 ! qtdemux name=demux \<br>
   demux.video_00 ! queue max-size-buffers=2 max-size-time=0 max-size-bytes=0 ! ffdec_h264 ! xvimagesink \<br>
   demux.audio_00 ! queue max-size-buffers=8000 max-size-time=0 max-size-bytes=0 ! faad ! alsasink<br>
<br>
When I try to play a 'test.mp4' without audio channel the pipeline is frozen. I use the qtdemux callback<br>
"pad-added" to link the demux with the queues. When no audio channel is present no link is made from<br>
demux and audio queue. The problem is that the elements has been added initially to the pipeline but<br>
they never has data, then they can change to ready or playing state<br>
<br>
  // Compose the pipeline.<br>
  gst_bin_add_many( GST_BIN( pipeline ), filesrc, demux,<br>
                    video_queue, video_decode, video_sink,<br>
                    audio_queue, audio_decode, audio_sink, NULL );<br>
<br>
  // Link all elements that can be automatically linked because they have "Always" pads.<br>
  if( gst_element_link_many( filesrc, demux, NULL ) != TRUE ||<br>
      gst_element_link_many( video_queue, video_decode, NULL ) != TRUE ||<br>
      gst_element_link_many( video_decode, video_sink, NULL ) != TRUE ||<br>
      gst_element_link_many( audio_queue, audio_decode, NULL ) != TRUE ||<br>
      gst_element_link_many( audio_decode, audio_sink, NULL ) != TRUE ) {<br>
    TRACEMSG( "%s - One element could not be linked.\n", __FUNCTION__ );<br>
    gst_object_unref( pipeline );<br>
    return NULL;<br>
  }<br>
<br>
I think its a begginer question but how can I solve this? Ideally I would like to know if it's<br>
possible to generate the correct pipeline at runtime? What's the correct way to implement this?<br>
<br>
Thanks!!<br>
Jorge<br>
<br>
Este mensaje se dirige exclusivamente a su destinatario y puede contener información privilegiada o CONFIDENCIAL. Si no es vd. el destinatario indicado, queda notificado de que la utilización, divulgación y/o copia sin autorización está prohibida en virtud de la legislación vigente. Si ha recibido este mensaje por error, le rogamos que nos lo comunique inmediatamente por esta misma vía y proceda a su destrucción.<br>

<br>
This message is intended exclusively for its addressee and may contain information that is CONFIDENTIAL and protected by professional privilege.<br>
If you are not the intended recipient you are hereby notified that any dissemination, copy or disclosure of this communication is strictly prohibited by law. If this message has been received in error, please immediately notify us via e-mail and delete it.<br>

_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Stirling Westrup<br>Programmer, Entrepreneur.<br><a href="https://www.linkedin.com/e/fpf/77228" target="_blank">https://www.linkedin.com/e/fpf/77228</a><br><a href="http://www.linkedin.com/in/swestrup" target="_blank">http://www.linkedin.com/in/swestrup</a><br>
<a href="http://technaut.livejournal.com" target="_blank">http://technaut.livejournal.com</a><br><a href="http://sourceforge.net/users/stirlingwestrup" target="_blank">http://sourceforge.net/users/stirlingwestrup</a>
</div>