<div dir="ltr"><div><div><div>I think that (usually) demuxers and depayloaders have dynamic pads, so the caps aren't known until after a buffer has been parsed and identified. You need to register for the 'pad-added' signal. At that time the caps are known/available and you can do whatever you need to do.<br>
<br></div>register:<br> // Connect the callback function to the demuxer to listen for the pad creation.<br> g_signal_connect(demuxer_, "pad-added", G_CALLBACK(newpad_Callback), (gpointer)this);<br><br>
<br></div>callback:<br>void Pipeline::newpad_Callback(GstElement *pElement, GstPad *pPad, gpointer data)<br>{<br> gchar *PadName = gst_pad_get_name(pPad);<br> gchar *ElementName = gst_element_get_name(pElement);<br>
GST_DEBUG("Element %s created pad: %s", ElementName, PadName);<br> g_free(ElementName);<br> g_free(PadName);<br><br></div><div>You can query the pad for caps and then react accordingly.This is documented in several places. Use google.<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 22, 2013 at 10:23 AM, johnwesting <span dir="ltr"><<a href="mailto:john.blank.westing@gmail.com" target="_blank">john.blank.westing@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I have an MPEG4-LATM RTP Depayload Element and don't understand how to set<br>
the output caps for the element. The problem is that the source pad's<br>
capabilities are not known until after I parse and decode a buffer, but the<br>
element is not given a buffer until the after caps negotiation has<br>
completed. If my explanation isn't clear, the following example pipelines<br>
might help:<br>
<br>
Broken Pipeline:<br>
<br>
gst-launch filesrc location=./example.wav ! wavparse ! faac ! ss1rtplatmpay<br>
! ss1rtplatmdepay ! faad ! alsasink<br>
<br>
Working Pipeline:<br>
<br>
gst-launch filesrc location=./example.wav ! wavparse ! faac ! ss1rtplatmpay<br>
! ss1rtplatmdepay ! "audio/mpeg, mpegversion=4, rate=44100, channels=2" !<br>
faad ! alsasink<br>
<br>
Is there any way I can peek at the sink pad's buffer before caps negotiation<br>
completes so that I can set the source caps of my element?<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/RTP-Depay-Element-Caps-Negotation-tp4659591.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/RTP-Depay-Element-Caps-Negotation-tp4659591.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<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></div>