Unable to create decodebin2 GstElement

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Mon Nov 19 22:23:36 PST 2012


Hi Kris,

> Your app is referring to GStreamer-1.0 which does not include decodebin2
> (removed and replaced with "decodebin"). Use "decodebin" in your app
> instead.

Yes, I had copied the compilation command from the docs, which I guess
are referring to the new 1.0 release.

Though I'm not sure how the 1.0 release landed on my PC. I'm using
Ubuntu 12.10 and I don't remember installing 1.0 separately (or maybe
it came in via an update, can't remember).

Compiling the example with 0.10 is working (with decodebin2).

>
> The reason it works with gst-launch is that it refers to your
> GStreamer-0.10.x installation. If you want to mimic your app behaviour
> on the command line use gst-launch-1.0 instead. You should see a similar
> error as in your app.

Thanks for the explanation.

Regards,
-mandeep


>
> HTH,
> Kris
>
> On 19/11/12 12:55, Mandeep Sandhu wrote:
>> Hi All,
>>
>> I'm stumped by a very simple issue. Somehow I'm not able to create a
>> decodebin2 element.
>>
>> This is how I create it:
>>
>> GstElement *pipeline, *source, *decoder;
>>
>> /* Initialisation */
>> gst_init (&argc, &argv);
>>
>> /* Create gstreamer elements */
>> pipeline = gst_pipeline_new ("av-player");
>> source   = gst_element_factory_make ("filesrc",     "source");
>> decoder  = gst_element_factory_make ("decodebin2",  "decodebin2");
>>
>> if (!pipeline || !source || !decoder)  {
>>     g_print("pip:%p src:%p dec:%p \n", pipeline, source, decoder);
>>     g_printerr ("One element could not be created. Exiting.\n");
>>     return -1;
>> }
>>
>> The "decoder" is always NULL!
>>
>> deocdebin2 works fine when used from gst-launch app. I'm attaching a
>> compilable sample code which illustrates this issue. I'm compiling it
>> using the following cmd:
>>
>> $ gcc -Wall basicgst.c -o basicgst $(pkg-config --cflags --libs gstreamer-1.0)
>>
>> It must be something trivial as I've not seen anyone complain about
>> not being able to instantiate the decodebin2 element. Though I can't
>> figure out what the issue might be! :/
>>
>> Any hints appreciated.
>>
>> Thanks,
>> -mandeep
>>
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list