Removing a bus watch when tearing down a pipeline

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Fri Aug 14 01:42:07 PDT 2015


Hi Sebastian,

2015-08-14 8:51 GMT+02:00 Sebastian Dröge <sebastian at centricular.com>:
> On Do, 2015-08-13 at 17:43 +0200, Guillermo Rodriguez Garcia wrote:
>> Hello all,
>>
>> I am attaching a bus watch to a pipeline using gst_bus_add_watch. I
>> have some questions:
>>
>> 1. When I tear down the pipeline (by setting its state to NULL, and
>> then calling gst_object_unref(pipeline), do I still need to remove
>> the bus watch to prevent resource leaks? Or isn't this necessary?
>
> It should be destroyed together with the bus, so not necessary.
>
>> 2. Is it possible to remove a watch by calling g_source_remove or
>> gst_remove_watch from the bus watch callback function itself? (I know
>> that this can also be done by returning FALSE from the callback)
>
> Yes, those can be called at any time from any thread.

Very helpful, thank you!

Guillermo


More information about the gstreamer-devel mailing list