Hi Mike,<div><br></div><div>Thank you for your response. The diagrams were very helpful.</div><div><br></div><div>I see from the diagrams that the output media type should be video/x-raw-yuv. However, when my program receives the pad-added signal the pad still has caps of video/quicktime. Is it required/possible to force the output type of decodebin2?</div>
<div><br></div><div>I also receive an &quot;autoplug-continue&quot; signal which I currently don&#39;t do anything with. Not sure if that is important at this stage.</div><div><br></div><div>Please find attached my code should you wish to take a look.</div>
<div><br></div><div>Many thanks,<br><br></div><div><br><div class="gmail_quote">On 7 November 2011 18:13, Mike Mitchell <span dir="ltr">&lt;<a href="mailto:mike.mitchell@panometric.net">mike.mitchell@panometric.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote">Your original pipeline does not negotiate on my h264 encoded file.  It requires  ffmpegcolorspace to work.  I&#39;ve attached some before and after diagrams as well as the script I used to generate them. The diagrams provide visibility into the auto-plugging process that decodebin2 creates. <br>


<br><b>Mike Mitchell</b><div><div class="h5"><br><br><br><br>On Mon, Nov 7, 2011 at 8:27 AM, David Walker <span dir="ltr">&lt;<a href="mailto:dwalker0044@gmail.com" target="_blank">dwalker0044@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">

<font face="arial, helvetica, sans-serif">Hi,</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I&#39;m having some trouble connecting decodebin2 to autovideosink in order to play mp4 video. So far, using the command line, I have managed to play mp4 video by creating the following pipe:</font><div>



<font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">gst-launch filesrc location=&quot;file.mp4&quot; ! decodebin2 ! autovideosink</font></div>
<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"></font></div></div></blockquote><div></div></div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><div class="h5">

<div><div><font face="arial, helvetica, sans-serif">I now want to create the same pipeline but in C. Noticing that decodebin2 has a dynamic pad, I&#39;ve attached a callback to the &quot;pad-added&quot; signal in which I then try to link the pads of decodebin2 and autovideosink - however with no success. </font></div>



<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">I then investigated the caps and noticed that the caps of decodebin2 are: video/quicktime, variant=(string)iso which isn&#39;t a cap of autovideosink which would explain the GST_PAD_LINK_NOFORMAT error I am seeing. </font></div>



<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">How is it possible that the pipeline on the command line is able to play the video but my program seems to provide incompatible type? Is there something else that needs to be done?</font></div>



<div><br></div></div><div>I&#39;d really appreciate any help, been trying to get my head round this for a couple of days now!</div><div><br></div><div>Thanks.</div><div><br></div><div><br></div><div>PS my callback looks like this (I am also using Qt libraries - qDebug simply writes to terminal like printf):</div>



<div><br></div><div><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(128, 128, 0)">static</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 128, 0)">void</span><span style="color:rgb(192, 192, 192)"> </span>on_pad_added<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 125, 182)">GstElement</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">*</span><span style="color:rgb(50, 50, 50)">element</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 125, 182)">GstPad</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">*</span><span style="color:rgb(50, 50, 50)">srcpad</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 125, 182)">gpointer</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">data</span><span style="color:rgb(50, 50, 50)">)</span>
</font><pre style="margin:0px;text-indent:0px"><span style="color:rgb(50, 50, 50)"><font face="&#39;courier new&#39;, monospace">{</font></span></pre>

<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;on_pad_added&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)"><br>
</span></font></pre><pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 125, 182)">GstElement</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">*</span><span style="color:rgb(50, 50, 50)">videosink</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">=</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 125, 182)">GstElement</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">*)</span><span style="color:rgb(50, 50, 50)">data</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(0, 125, 182)">GstPad</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">*</span><span style="color:rgb(50, 50, 50)">sinkpad</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">=</span><span style="color:rgb(192, 192, 192)"> </span>gst_element_get_static_pad<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">videosink</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">&quot;sink&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)"><br>
</span></font></pre><pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;src</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">caps</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">are</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">%s&quot;</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span>gst_caps_to_string<span style="color:rgb(50, 50, 50)">(</span>gst_pad_get_caps<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">srcpad</span><span style="color:rgb(50, 50, 50)">)));</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;sink</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">caps</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">are</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">%s&quot;</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span>gst_caps_to_string<span style="color:rgb(50, 50, 50)">(</span>gst_pad_get_caps<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">sinkpad</span><span style="color:rgb(50, 50, 50)">)));</span></font></pre>



<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(50, 50, 50)"><br>
</span></font></pre>
<pre style="margin:0px;text-indent:0px"></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">if</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">(!</span>gst_pad_can_link<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">srcpad</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">sinkpad</span><span style="color:rgb(50, 50, 50)">)) // can link fails</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;Cannot</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">link</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">these</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(0, 141, 0)">pads&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>



<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(50, 50, 50)"><br>
</span></font></pre>
<pre style="margin:0px;text-indent:0px"></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">switch</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">(</span>gst_pad_link<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">srcpad</span><span style="color:rgb(50, 50, 50)">,</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">sinkpad</span><span style="color:rgb(50, 50, 50)">))</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">{</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_OK</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;1&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_WRONG_HIERARCHY</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;2&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_WAS_LINKED</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;3&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_WRONG_DIRECTION</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;4&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_NOFORMAT</span><span style="color:rgb(50, 50, 50)">: // reason for link error</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;5&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_NOSCHED</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;6&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">case</span><span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(128, 0, 128)">GST_PAD_LINK_REFUSED</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;7&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(128, 128, 0)">default</span><span style="color:rgb(50, 50, 50)">:</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span>qDebug<span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(0, 141, 0)">&quot;8&quot;</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">        </span><span style="color:rgb(128, 128, 0)">break</span><span style="color:rgb(50, 50, 50)">;</span></font></pre>




<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span><span style="color:rgb(50, 50, 50)">}</span></font></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(50, 50, 50)"><br>
</span></font></pre>
<pre style="margin:0px;text-indent:0px"></pre>
<pre style="margin:0px;text-indent:0px"><font face="&#39;courier new&#39;, monospace"><span style="color:rgb(192, 192, 192)">    </span>gst_object_unref<span style="color:rgb(192, 192, 192)"> </span><span style="color:rgb(50, 50, 50)">(</span><span style="color:rgb(50, 50, 50)">sinkpad</span><span style="color:rgb(50, 50, 50)">);</span></font></pre>




<pre style="margin:0px;text-indent:0px"><span style="color:rgb(50, 50, 50)"><font face="&#39;courier new&#39;, monospace">}</font></span></pre>
</div><div><br></div><div><br></div>
<br></div></div>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">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>
<br></blockquote></div><br>
<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>
<br></blockquote></div><br></div>