Trying to monitoring the pad-added signals from demux but failed

michaelok.ja at gmail.com michaelok.ja at gmail.com
Thu Apr 28 01:13:13 UTC 2016


Update: previous post code was wrong.

Hi,
I'm trying to monitoring the pad-added signal from demux, but the callback
function was not been triggered.
Here's part of my source code:

> _pipeline = gst_pipeline_new("receiver");
> dataSource = gst_element_factory_make("rtspsrc", "rtsp-source");
> g_object_set(G_OBJECT(dataSource), "location", "rtsp://
184.72.239.149/vod/mp4:BigBuckBunny_115k.mov", NULL);

> demux = gst_element_factory_make("rtph264depay", "rtp-h264-depacketizer");
> parser = gst_element_factory_make("h264parse", "h264-parser");
> decoder = gst_element_factory_make("avdec_h264", "h264-decoder");
> videosink = gst_element_factory_make("autovideosink",
"default-videosink");
> gst_bin_add_many(GST_BIN(_pipeline), dataSource, demux, NULL);
> gst_bin_add_many(GST_BIN(_pipeline), parser, NULL);
> g_signal_connect(dataSource, "pad-added", G_CALLBACK(cb_new_rtspsrc_pad),
demux);
> g_signal_connect(demux, "pad-added", G_CALLBACK(cb_new_demux_pad), NULL);
> gst_element_link_pads (demux, "src", parser, "sink");
> gst_bin_add_many(GST_BIN(_pipeline), decoder, videosink, NULL);
> gst_element_link_many(parser, decoder, videosink, NULL);
> gst_element_set_state(_pipeline, GST_STATE_PLAYING);


CALLBACK:
> static void cb_new_rtspsrc_pad(GstElement *element, GstPad *pad, gpointer
 data) {
> gchar *name;
> GstCaps * p_caps;
> gchar * description;
> GstElement *p_rtph264depay;
>
> name = gst_pad_get_name(pad);
> p_caps = gst_pad_get_pad_template_caps (pad);
> description = gst_caps_to_string(p_caps);
> g_free(description);
> p_rtph264depay = GST_ELEMENT(data);
>
> gst_element_link_pads(element, name, p_rtph264depay, "sink”);
> g_free(name);
> }

I'd like to know if there is any setting should be setup for monitoring the
signal through the specific element.

Thanks for your prompt reply.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160428/c0feb57b/attachment-0001.html>


More information about the gstreamer-devel mailing list