Python3 fetch element-error before adding it to pipeline

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

Python3 fetch element-error before adding it to pipeline

Ole
Hello, I am writing an application in python3x where I use gdkpixbufoverlay.
It is possible that I get non-valid filenames or corrupt png's.

I need a hint how or where to fetch an element-error when the element is not currently added to the pipe. I can fetch errors from the pipeline via .get_bus(). But what I want is only to add the element when I did not got an error trying to load the image.





Reply | Threaded
Open this post in threaded view
|

Re: Python3 fetch element-error before adding it to pipeline

Tim Müller
On Tue, 2016-07-12 at 09:17 -0700, Ole wrote:

Hi,

> I am writing an application in python3x where I use gdkpixbufoverlay.
>  It is possible that I get non-valid filenames or corrupt png's.
>
> I need a hint how or where to fetch an element-error when the element
> is not currently added to the pipe. I can fetch errors from the
> pipeline via .get_bus(). But what I want is only to add the element
> when I did not got an error trying to load the image.

Have you tried just setting the state of the gdkpixbufoverlay element
to GST_STATE_PLAYING and checking the return value? Since it tries to
load the image from the state change function you should get a
GST_STATE_CHANGE_FAILURE if there's a problem loading the image. This
doesn't give you the error message of course, but it might be enough
for you to just know it failed.

Cheers
-Tim
--

Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel