<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><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><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 class="gmail_signature" data-smartmail="gmail_signature">Thank you!</div><div class="gmail_signature" data-smartmail="gmail_signature"><br></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">- Bill</div></div></div></div>