<div dir="auto">Hi,<div dir="auto"><br></div><div dir="auto">rtspsrc emits the signal "pad-added" twice. Once for audio and once for video.</div><div dir="auto"><br></div><div dir="auto">We can use a g_signal_connect() to catch the pad and link it to our video and audio queues seperately in a callback function.</div><div dir="auto"><br></div><div dir="auto">E.g.:</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">//Call back function to link the pads from rtspsrc</div><div dir="auto">Void *<span style="font-family:sans-serif">sig_call_back(GstElement * element, GstPad *pad, char *data)</span></div><div dir="auto"><span style="font-family:sans-serif">{</span></div><div dir="auto"><font face="sans-serif">//Check for type of pad using pad</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">//If audio type pad, link with </font><span style="font-family:sans-serif">audioQueue</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">//If video type pad, link with </span><span style="font-family:sans-serif">videoQueue</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">//Declaring the </span><span style="font-family:sans-serif">audioQueue and videoQueue as global would be easier way or use 'data' variable as pointer sent by g_singal_connect  </span></div><div dir="auto"><span style="font-family:sans-serif">}</span></div><div dir="auto"><br></div><div dir="auto">main(){</div><div dir="auto">...</div><div dir="auto">...</div><div dir="auto"><span style="font-family:sans-serif">rtsp_source</span>= <span style="font-family:sans-serif">gst_element_<wbr>factory_make ("rtspsrc", "rtsp-source");</span></div><div dir="auto"><span style="font-family:sans-serif">....</span></div><div dir="auto"><span style="font-family:sans-serif">....</span></div><div dir="auto"><span style="font-family:sans-serif">*Linking procedure*</span><br></div><div dir="auto">  g_signal_connect(<span style="font-family:sans-serif">rtsp_source,"<wbr>pad-added", sig_call_back, some_ptr);</span></div><div dir="auto"><span style="font-family:sans-serif">.....</span></div><div dir="auto"><span style="font-family:sans-serif">...</span></div><div dir="auto"><span style="font-family:sans-serif">}</span></div><br><div class="gmail_extra" dir="auto"><br><div class="gmail_quote">On 23-Jan-2017 5:35 PM, "rajvik" <<a href="mailto:kamdar.rajvi@gmail.com" target="_blank">kamdar.rajvi@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am trying to link audio and video queue's using rtspsrc element property<br>
name. The pipeline is:<br>
*gst-launch-1.0 rtspsrc location="rtsp://<file path>"  latency=0 name=demux<br>
demux. ! queue !  rtpmp4gdepay ! aacparse ! avdec_aac !  audioconvert !<br>
audioresample ! autoaudiosink demux. ! queue ! rtph264depay ! h264parse !<br>
omxh264dec ! videoconvert ! videoscale ! video/x-raw,width=176, height=144 !<br>
ximagesink*<br>
<br>
I could create the value of name element using<br>
*g_object_set(source, "name", "demux", NULL);*<br>
But I am not able to link audio and video queues hence create. Following is<br>
the part of code:<br>
<br>
*audio bin*<br>
       audio = gst_bin_new ("audiobin");<br>
        audioQueue = gst_element_factory_make ("queue", "audio-queue");<br>
        audioDepay = gst_element_factory_make ("rtpmp4gdepay",<br>
"audio-depayer");<br>
        audioParse = gst_element_factory_make ("aacparse", "audio-parser");<br>
        audioDecode = gst_element_factory_make ("avdec_aac",<br>
"audio-decoder");<br>
        audioConvert = gst_element_factory_make ("audioconvert", "aconv");<br>
        audioResample = gst_element_factory_make ("audioresample",<br>
"audio-resample");<br>
        audioSink = gst_element_factory_make ("autoaudiosink", "audiosink");<br>
<br>
*video bin*<br>
        video  = gst_bin_new ("videobin");<br>
        videoQueue = gst_element_factory_make ("queue", "video-queue");<br>
        videoDepay= gst_element_factory_make ("rtph264depay",<br>
"video-depayer");<br>
        videoParser = gst_element_factory_make ("h264parse",<br>
"video-parser");<br>
        videoDecode = gst_element_factory_make ("omxh264dec",<br>
"video-decoder");<br>
        videoConvert = gst_element_factory_make("vide<wbr>oconvert", "convert");<br>
        videoScale = gst_element_factory_make("vide<wbr>oscale", "video-scale");<br>
        videoSink = gst_element_factory_make("xima<wbr>gesink", "video-sink");<br>
        capsFilter = gst_caps_new_simple("video/x-r<wbr>aw",<br>
                        "width", G_TYPE_INT, 176,<br>
                        "height", G_TYPE_INT, 144,<br>
                        NULL);<br>
<br>
*Linking procedure*<br>
<br>
     /*Linking filter element to videoScale and videoSink */<br>
        link_ok = gst_element_link_filtered(vide<wbr>oScale,videoSink,<br>
capsFilter);<br>
        gst_caps_unref (capsFilter);<br>
        if (!link_ok) {<br>
                g_warning ("Failed to link element1 and element2!");<br>
        }<br>
        /* Linking video elements internally */<br>
        if (!gst_element_link_many(videoQ<wbr>ueue, videoDepay, videoParser,<br>
videoDecode, videoConvert, NULL))<br>
        {<br>
                g_printerr("Cannot link videoDepay and videoParser \n");<br>
                return 0;<br>
        }<br>
        if (!gst_element_link_many(audioQ<wbr>ueue, audioDepay, audioParse,<br>
audioDecode, audioConvert, audioResample, audioSink, NULL))<br>
        {<br>
                g_printerr("Cannot link audioDepay and audioParse \n");<br>
                return 0;<br>
        }<br>
<br>
*Help is highly appreciated*<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.<wbr>n4.nabble.com/Gstreamer-RTSP-s<wbr>rc-element-name-tp4681595.html</a><br>
Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesk<wbr>top.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-dev<wbr>el</a> <br>
</blockquote></div></div>
</div>