dynamic linking
Marcin Kolny
marcin.kolny at flytronic.pl
Mon Aug 26 03:59:10 PDT 2013
On 08/26/2013 12:29 PM, jyoti kulkarni wrote:
> Hello All,
>
> Following is my pipeline :
>
> gst-launch-1.0 -v filesrc location=/home/jyoti/Videos/conf.mp4 !
> qtdemux name=dmux dmux.audio_0 ! queue ! avdec_aac ! alsasink
>
> dmux.video_00 ! queue ! avdec_h264 ! xvimagesink
>
> and it works fine..
>
> But when i try to do this in c code i am facing the issues.
>
> I do this way:
>
> After linking all the elements,
>
> g_signal_connect (data.demuxer, "pad-added", G_CALLBACK
> (on_pad_added),data.queue1);
> g_signal_connect (data.demuxer, "pad-added", G_CALLBACK (on_pad_added),
> data.queue2);
>
> and the function on_pad_added:
>
> static void on_pad_added (GstElement *element,GstPad *pad,CustomData *data)
> {
>
> gchar *name;
>
>
> name = gst_pad_get_name (pad);
> if (strcmp (name, "audio_0") == 0 &&
> !gst_element_link_pads(data->demuxer,name,data->queue1,"sink")) {
> printf("link fail\n");
> }
> if (strcmp (name, "video_0") == 0 &&
> !gst_element_link_pads(data->demuxer,name,data->queue2,"sink")) {
> printf("link fail\n");
> }
> g_free (name);
> }
>
> Here CustomData is the structure containing all the elements.
> typedef struct _CustomData {
> GstElement *pipeline, *source, *demuxer, *video_decoder, *video_sink,
> *queue2, *audio_decoder, *audio_sink, *queue1;
> }
>
>
> I get following assertions and then a general stream error.
>
> GStreamer-CRITICAL **: gst_element_link_pads_full: assertion
> `GST_IS_ELEMENT (src)' failed
> link fail
> Error: GStreamer encountered a general stream error.
>
>
>
>
> Plz help with the concern
>
> Thanks & Regards
> Jyoti
>
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
Look at your arguments on a on_pad_added function. It expects pointer to
a CustomData, and you pass a queue.
Code:
g_signal_connect (data.demuxer, "pad-added", G_CALLBACK
(on_pad_added),data);
should works
More information about the gstreamer-devel
mailing list