[gst-devel] where is the error,please?

Benoit Fouet benoit.fouet at purplelabs.com
Wed Sep 12 09:59:42 CEST 2007


Hi,

(this is just my guess)

Volter Yen wrote:

[...]

> g_signal_connect (ts_demux, "pad-added", G_CALLBACK (new_pad), NULL);
>

[...]

> static void new_pad (GstElement *element, GstPad *pad, gpointer data)
> {
>     GstPad *srcpad;
>     g_print ("Dynamic pad created, linking demuxer and a_queue\n");
>   
>     srcpad = gst_element_get_pad (a_queue, "sink");
>     gst_pad_link (pad, srcpad);
>  
>     gst_object_unref (srcpad);
>  }
>  
> static void new_pad2 (GstElement *element, GstPad *pad, gpointer data)
> {
>     GstPad *srcpad;
>     g_print ("Dynamic pad created, linking demuxer and v_queue\n");
>   
>     srcpad = gst_element_get_pad (v_queue, "sink");
>     gst_pad_link (pad, srcpad);
>  
>     gst_object_unref (srcpad);
>  }

you don't know which pad the demuxer created triggered the callback.
you have to check the caps of this pad to know whether it is the audio
or the video one.

and as a general remark, check the return values from functions that
have one (such as gst_pad_link() for instance), that will help you *a
lot* to spot your problems...

-- 
Ben
Purple Labs S.A.
www.purplelabs.com




More information about the gstreamer-devel mailing list