Unable to create decodebin2 GstElement

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to create decodebin2 GstElement

Mandeep Sandhu
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
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

basicgst.c (988 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create decodebin2 GstElement

Wim Taymans
On 11/19/2012 01:55 PM, 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)

You are linking against GStreamer 1.0. decodebin2 was renamed to
decodebin in GStreamer 1.0.

Wim

>
> 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
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create decodebin2 GstElement

Krzysztof Konopko
In reply to this post by Mandeep Sandhu
Hi Mandeep,

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

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.

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
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create decodebin2 GstElement

Mandeep Sandhu
In reply to this post by Wim Taymans
>> $ gcc -Wall basicgst.c -o basicgst $(pkg-config --cflags --libs
>> gstreamer-1.0)
>
>
> You are linking against GStreamer 1.0. decodebin2 was renamed to decodebin
> in GStreamer 1.0.
>

Thanks Wim. That fixed it. I'm right now linking against the 0.10 release.

Regards,
-mandeep
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Unable to create decodebin2 GstElement

Mandeep Sandhu
In reply to this post by Krzysztof Konopko
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
>> [hidden email]
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel