Python3 fetch element-error before adding it to pipeline

Tim Müller tim at centricular.com
Wed Jul 13 06:40:30 UTC 2016


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


More information about the gstreamer-devel mailing list