<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 4 nov. 2019 15 h 10, Bill Klein <<a href="mailto:bill@orbit.org">bill@orbit.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am using a pipeline with an rtsp src in C code. Everything has been working mostly wonderfully, but recent issues have led me to believe that I am doing something wrong in certain situations. Specifically, I am wondering if I am handling the <b>pad-added</b> signal correctly.</div><div><br></div><div>My pad-added handler is something simple like (simplified for the sake of readability):</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="monospace" size="1">void on_pad_added(GstElement* element, GstPad* pad, void *data) {</font></div><div><font face="monospace" size="1">    GstPad* sinkpad = gst_element_get_static_pad(depay_el, "sink");</font></div><div><font face="monospace" size="1">    if(!sinkpad) ... // handle error</font></div><div><font face="monospace" size="1"><br></font></div><div><font face="monospace" size="1">    auto r = gst_pad_link(pad, sinkpad);</font></div><div><span style="font-family:monospace;font-size:x-small"><br>    auto </span>padnm<span style="font-family:monospace;font-size:x-small"> = gst_pad_get_name(pad);</span><br></div><div><font face="monospace" size="1">    log("on_pad_added - "+padnm+" result:"+getPadLinkRespStr(rs));</font></div><div><font face="monospace" size="1">    // free paddnm...</font></div><div><font face="monospace" size="1"><br></font></div><div><font face="monospace" size="1">    gst_object_unref(sinkpad); </font></div><div><font face="monospace" size="1">}</font></div></blockquote><div><br></div>A few questions about this:<div><ul><li>Is the above correct/sufficient?<br><br></li><li>Sometimes <font face="monospace">gst_pad_link</font> returns <font face="monospace">GST_PAD_LINK_NOFORMAT</font>. Is that expected/normal? Do I need to perform additional handling in that case (ex unrefing the element)?<br></li></ul></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Means the link failed. There was not matching formats on these pads. You are doing something incorrect. Trace the caps on both ends to debug.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><ul><li><br></li><li>Sometimes <font face="monospace">gst_pad_link</font> returns <font face="monospace">GST_PAD_LINK_WAS_LINKED</font>. Is that expected/normal? Do I need to perform additional handling in that case (ex unrefing the element)?<br></li></ul></div></div></blockquote></div></div><div dir="auto">You are trying to link twice a pad, this is a programming error. If you need to relink, the make sure to unlink first.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><ul><li><br></li><li>For some networks/rtsp cameras, I see only a few pad-added signals called. In others, I see 100s (recv_rtp_src_***). Is that normal?</li></ul></div></div></blockquote></div></div><div dir="auto">Most cameras will expose two streams, audio and video. This seems rather strange to see so many pads, would need more data.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div data-smartmail="gmail_signature">Thank you!</div><div data-smartmail="gmail_signature"><br></div><div dir="ltr" data-smartmail="gmail_signature">- Bill</div></div></div></div>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div></div></div>