<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Thanks Tarun for the response.<br>
<br>
I get the idea of linking using g_signal_connect. But I am still wondering<br>
how shall I use name element with the same. The following code follows:<br>
*Here I create rtspsrc element:*<br>
source = gst_element_factory_make ("rtspsrc", "rtsp-source");<br>
g_object_set(source, "location", "rtsp://<a href="http://192.168.3.30:8554/rajvi" rel="noreferrer" target="_blank">192.168.3.30:8554/rajv<wbr>i</a>",<br>
NULL);<br>
g_object_set(source, "latency", 0, NULL); <br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="gmail-m_-4223925289740096651gmail-im"> g_object_set(source, "name", "demux", NULL)</span></blockquote><div> </div><div><span style="color:rgb(0,0,255)"><span style="background-color:rgb(255,255,255)">I don't think there is the property "name" for the rtspsrc element.</span></span><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,255)"><span style="background-color:rgb(255,255,255)"></span></span></blockquote><div><span style="color:rgb(0,0,255)"><span style="background-color:rgb(255,255,255)">Moreover we don't have to use "demux ." while building a gstreamer pipeline through the program. I believe we need it only when pass pipeline to gst-launch command.<br></span></span></div><div><span style="color:rgb(0,0,255)"><span style="background-color:rgb(255,255,255)"><br></span></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br><span class="gmail-m_-4223925289740096651gmail-im">
</span>*Here I link the call the demux0 the element to link it to the audio queue:<br>
*<br>
audio = gst_bin_get_by_name(GST_BIN(pi<wbr>peline), "demux0");<span style="background-color:rgb(255,255,255)"><span></span></span><br>
<br>
*Here I link all the elements with audio bin*:<br>
gst_bin_add_many(GST_BIN(audio<wbr>), audioDepay, audioParse,<br>
audioDecode,audioConvert, audioResample, audioSink, NULL);<br>
<span class="gmail-m_-4223925289740096651gmail-im"> if (!gst_element_link_many(audioQ<wbr>ueue, audioDepay, audioParse,</span><br><span class="gmail-m_-4223925289740096651gmail-im">
audioDecode, audioConvert, audioResample, audioSink, NULL))</span><br><span class="gmail-m_-4223925289740096651gmail-im">
{</span><br><span class="gmail-m_-4223925289740096651gmail-im">
g_printerr("Cannot link audioDepay and audioParse \n");</span><br><span class="gmail-m_-4223925289740096651gmail-im">
return 0;</span><br><span class="gmail-m_-4223925289740096651gmail-im">
}</span><br><span class="gmail-m_-4223925289740096651gmail-im">
</span>Same is applicable to video queue as well.<br>
<br>
Question is how shall I use signal connect? </blockquote><div><br><font color="#0000ff"><font color="#0000ff">typical usage is:</font><br>g_signal_connect(source, "pad-added", G_CALLBACK(</font><font color="#0000ff"><font color="#0000ff">user_function</font>), data_ptr);<br><br></font><font color="#0000ff">usage of pad-added call back function is:<br>void user_function (GstElement* object, GstPad* pad, gpointer user_data);<br></font> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">And with which element shall I<br>
use signal connect with audioQueue or any other element?<br></blockquote><div><font color="#0000ff"></font></div><div><font color="#0000ff"><font color="#0000ff">'user_function</font>' is the name of the callback function you define for linking the pads with the "source". source is the variable for rtpssrc you have defined above </font></div><div><font color="#0000ff">'data_ptr' can be NULL or you can send the audioQueue and videoQueue as pointer, up to you how you want to use it.<br><br></font></div><div><font color="#0000ff">void user_function(</font><font color="#0000ff"><font color="#0000ff">GstElement* object, GstPad* pad, gpointer user_data</font>)<br>{<br> <br></font></div><div><font color="#0000ff">//read the 'pad' and convert it to string<br>//gst_pad_get_current_caps(pad)<br>//gst_caps_get_structure()<br>//gst_structure_get_name()<br></font></div><div><font color="#0000ff">//gst_caps_to_string()<br></font></div><div><font color="#0000ff">//if the above string contain "audio"<br>// dynamic_pad = gst_element_get_static_pad(audioQueue, "sink");<br>// gst_pad_link (pad, dynamic_pad);<br></font></div><div><font color="#0000ff"><br></font><br><div><font color="#0000ff">//if the above string contain "video"<br>// dynamic_pad = gst_element_get_static_pad(videoQueue, "sink");<br>// gst_pad_link (pad, dynamic_pad);<br><br></font></div><div><font color="#0000ff">//note: </font><font color="#0000ff">audioQueue and </font><font color="#0000ff">videoQueue are same pointers as you have defined in your program. It is good to have these as global pointers<br></font></div><font color="#0000ff"><br></font><font color="#0000ff">}<br></font></div><div><font color="#0000ff"><br><br><br><br></font></div><div><font color="#0000ff"><br><br></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 24, 2017 at 11:37 AM, rajvik <span dir="ltr"><<a href="mailto:kamdar.rajvi@gmail.com" target="_blank">kamdar.rajvi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks Tarun for the response.<br>
<br>
I get the idea of linking using g_signal_connect. But I am still wondering<br>
how shall I use name element with the same. The following code follows:<br>
*Here I create rtspsrc element:*<br>
source = gst_element_factory_make ("rtspsrc", "rtsp-source");<br>
g_object_set(source, "location", "rtsp://<a href="http://192.168.3.30:8554/rajvi" rel="noreferrer" target="_blank">192.168.3.30:8554/<wbr>rajvi</a>",<br>
NULL);<br>
g_object_set(source, "latency", 0, NULL);<br>
<span class=""> g_object_set(source, "name", "demux", NULL)<br>
</span>*Here I link the call the demux0 the element to link it to the audio queue:<br>
*<br>
audio = gst_bin_get_by_name(GST_BIN(<wbr>pipeline), "demux0");<br>
<br>
*Here I link all the elements with audio bin*:<br>
gst_bin_add_many(GST_BIN(<wbr>audio), audioDepay, audioParse,<br>
audioDecode,audioConvert, audioResample, audioSink, NULL);<br>
<span class=""> if (!gst_element_link_many(<wbr>audioQueue, audioDepay, audioParse,<br>
audioDecode, audioConvert, audioResample, audioSink, NULL))<br>
{<br>
g_printerr("Cannot link audioDepay and audioParse \n");<br>
return 0;<br>
}<br>
</span>Same is applicable to video queue as well.<br>
<br>
Question is how shall I use signal connect? And with which element shall I<br>
use signal connect with audioQueue or any other element?<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595p4681606.html" rel="noreferrer" target="_blank">http://gstreamer-devel.966125.<wbr>n4.nabble.com/Gstreamer-RTSP-<wbr>src-element-name-<wbr>tp4681595p4681606.html</a><br>
<div class="HOEnZb"><div class="h5">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">gstreamer-devel@lists.<wbr>freedesktop.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-<wbr>devel</a><br>
</div></div></blockquote></div><br></div>