Gstreamer RTSP src element name

Tarun Tej K tarun4690 at gmail.com
Tue Jan 24 09:12:32 UTC 2017


>
> Thanks Tarun for the response.
>
> I get the idea of linking using g_signal_connect. But I am still wondering
> how shall I use name element with the same. The following code follows:
> *Here I create rtspsrc element:*
>      source = gst_element_factory_make ("rtspsrc", "rtsp-source");
>         g_object_set(source, "location", "rtsp://192.168.3.30:8554/rajvi",
> NULL);
>         g_object_set(source, "latency", 0, NULL);
>
        g_object_set(source, "name", "demux", NULL)


I don't think there is the property "name" for the rtspsrc element.

> 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.


> *Here I link the call the demux0 the element to link it to the audio queue:
> *
> audio = gst_bin_get_by_name(GST_BIN(pipeline), "demux0");
>
> *Here I link all the elements with audio bin*:
>     gst_bin_add_many(GST_BIN(audio), audioDepay, audioParse,
> audioDecode,audioConvert, audioResample, audioSink, NULL);
>         if (!gst_element_link_many(audioQueue, audioDepay, audioParse,
> audioDecode, audioConvert, audioResample, audioSink, NULL))
>         {
>                 g_printerr("Cannot link audioDepay and audioParse \n");
>                 return 0;
>         }
> Same is applicable to video queue as well.
>
> Question is how shall I use signal connect?


typical usage is:
g_signal_connect(source, "pad-added", G_CALLBACK(user_function), data_ptr);

usage of pad-added call back function is:
void user_function (GstElement* object, GstPad* pad, gpointer user_data);


> And with which element shall I
> use signal connect with audioQueue or any other element?
>
'user_function' 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
'data_ptr' can be NULL or you can send the audioQueue and videoQueue as
pointer, up to you how you want to use it.

void user_function(GstElement* object, GstPad* pad, gpointer user_data)
{

//read the 'pad' and convert it to string
//gst_pad_get_current_caps(pad)
//gst_caps_get_structure()
//gst_structure_get_name()
//gst_caps_to_string()
//if the above string contain "audio"
//    dynamic_pad = gst_element_get_static_pad(audioQueue, "sink");
//    gst_pad_link (pad, dynamic_pad);


//if the above string contain "video"
//    dynamic_pad = gst_element_get_static_pad(videoQueue, "sink");
//    gst_pad_link (pad, dynamic_pad);

//note: audioQueue and videoQueue are same pointers as you have defined in
your program. It is good to have these as global pointers

}







On Tue, Jan 24, 2017 at 11:37 AM, rajvik <kamdar.rajvi at gmail.com> wrote:

> Thanks Tarun for the response.
>
> I get the idea of linking using g_signal_connect. But I am still wondering
> how shall I use name element with the same. The following code follows:
> *Here I create rtspsrc element:*
>      source = gst_element_factory_make ("rtspsrc", "rtsp-source");
>         g_object_set(source, "location", "rtsp://192.168.3.30:8554/rajvi",
> NULL);
>         g_object_set(source, "latency", 0, NULL);
>         g_object_set(source, "name", "demux", NULL)
> *Here I link the call the demux0 the element to link it to the audio queue:
> *
> audio = gst_bin_get_by_name(GST_BIN(pipeline), "demux0");
>
> *Here I link all the elements with audio bin*:
>     gst_bin_add_many(GST_BIN(audio), audioDepay, audioParse,
> audioDecode,audioConvert, audioResample, audioSink, NULL);
>         if (!gst_element_link_many(audioQueue, audioDepay, audioParse,
> audioDecode, audioConvert, audioResample, audioSink, NULL))
>         {
>                 g_printerr("Cannot link audioDepay and audioParse \n");
>                 return 0;
>         }
> Same is applicable to video queue as well.
>
> Question is how shall I use signal connect? And with which element shall I
> use signal connect with audioQueue or any other element?
>
>
>
>
>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.
> n4.nabble.com/Gstreamer-RTSP-src-element-name-tp4681595p4681606.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170124/4f38bfc7/attachment.html>


More information about the gstreamer-devel mailing list