Gstreamer RTSP src element name
Ian Davidson
id012c3076 at blueyonder.co.uk
Tue Jan 24 17:04:59 UTC 2017
I may be way off course here - but when you are notified that a pad has
been added, don't you want to find the name of the PAD, not the name of
the CAPS?
(See
https://gstreamer.freedesktop.org/documentation/application-development/basics/pads.html)
Ian
On 24/01/2017 14:45, rajvik wrote:
> SNIP SNIP
> Any idea as to how to move forward with this?
> Code snippet:
>
> GstElement *audioQueue, *videoQueue;
> GstElement *source, *audio, *video, *convert, *pipeline, *audioDepay,
> *audioParse, *audioDecode, *audioConvert, *audioResample,
> *audioSink, *videoDepay, *videoParser, *videoDecode, *videoConvert,
> *videoScale, *videoSink;
>
> static void onPadAdded(GstElement *element, GstPad *pad, gpointer data)
> {
> GstCaps *caps;
> const char *name;
> char *capsName;
> caps = gst_pad_get_current_caps(pad);
> GstStructure *str = gst_caps_get_structure(caps, 0);
> name = gst_structure_get_name(str);
> g_print("name of caps struct string: %s \n", name);
> capsName = gst_caps_to_string(caps);
> g_print("name of caps string: %s \n", capsName);
> if (g_strrstr(capsName,"audio"))
> {
> GstPad *dynamic_pad =
> gst_element_get_static_pad(audioQueue, "sink");
> gst_pad_link(pad, dynamic_pad);
> }
>
> else if (g_strrstr(capsName, "video"))
> {
> GstPad *video_dynamic_pad =
> gst_element_get_static_pad(videoQueue, "sink");
> gst_pad_link(pad, video_dynamic_pad);
> }
> g_free(capsName);
>
>
More information about the gstreamer-devel
mailing list