[gst-devel] plugin cannot be encapsulated in a bin
Benoit Fouet
benoit.fouet at purplelabs.com
Thu Feb 8 10:19:58 CET 2007
Hi,
(please keep list in copy... the more, the merrier ;) )
Diqing Zhong wrote:
> Hi,
>
> Here's the code, thanks so much for the help.
>
> - Max
>
> -------------------------------------------------------------------------------------------
> static GstElement *decbin = NULL;
> static GstElement *video_decode = NULL;
>
> video_decode=gst_element_factory_make("mpeg2_video_dec", NULL);
> decbin = gst_bin_new("decbin");
> if ( gst_bin_add(GST_BIN(decbin), video_decode) == FALSE) {
> g_print("Error add video decode to bin");
> }
>
> GstPad *video_decode_sinkpad;
> video_decode_sinkpad = gst_element_get_pad(video_decode, "sink");
> if (gst_element_add_pad (decbin, gst_ghost_pad_new ("sink",
> video_decode_sinkpad)) == FALSE) {
> g_print("Error gst element add sink pad");
> }
>
do you link your sink pad with anything ?
> GstPad *video_decode_srcpad;
> video_decode_srcpad = gst_element_get_pad(video_decode, "src");
> if (gst_element_add_pad (decbin, gst_ghost_pad_new ("src",
> video_decode_srcpad))== FALSE) {
> g_print("Error gst element add source pad");
> }
>
> gst_object_unref (GST_OBJECT (video_decode_sinkpad));
> gst_object_unref (GST_OBJECT (video_decode_srcpad));
>
> gst_bin_add_many(GST_BIN(bin), decbin, video_sink, NULL);
>
> if(gst_element_link(decbin, video_sink) == FALSE) {
> g_print("Error linking decbin->video_sink\n");
> g_assert(0);
> }
>
Ben
More information about the gstreamer-devel
mailing list