Handling errors in callbacks at the application level

Tyler Compton xaviosx at gmail.com
Mon Apr 13 23:16:10 UTC 2020


I'm hoping to get some insight about what applications are expected to do
when they encounter an error while running within a signal callback.

For example, let's say I've created a demuxer and attached a callback to
the "pad-added" signal. Now, when that callback is run I find that the pad
is for a video format that my application doesn't support. I want the
pipeline to be brought down as a result of this. What is the best way to
signal to GStreamer my intentions?

My first guess was to send an error message on the pipeline with
"pipeline.message_full". Then I could have my watcher set the pipeline's
state to NULL when it receives an error. However, documentation about error
messages makes it sound like only elements are expected to create them,
making me wonder if that's the right choice. Another option would be to
call "pipeline.set_state(Gst.State.NULL)" directly, but my understanding is
that using set_state in callbacks can result in deadlocks if the callback
happens to be run in a streaming thread.

Thanks for the help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20200413/27bb6c59/attachment.htm>


More information about the gstreamer-devel mailing list