is there a way to serialize the "sync-message::stream-status" GstBus callback?

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

is there a way to serialize the "sync-message::stream-status" GstBus callback?

Andres Gonzalez
Hi,

I am using the "sync-message::stream-status" signal callback for the GstBus of a pipeline to get access to the pthread stuff. I have noticed that with a pipeline with several elements that create threads, this callback can be called several times. I have also noticed that these calls, which are coming from different element threads, is not serialized.

Question: is there a way to serialize this callback to ensure that a given invocation will complete before another element thread is allowed to call it?

Thanks,

-Andres
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to serialize the "sync-message::stream-status" GstBus callback?

Tim Müller
On Fri, 2016-09-02 at 12:02 -0700, Andres Gonzalez wrote:

Hi Andres,

> I am using the "sync-message::stream-status" signal callback for the
> GstBus of a pipeline to get access to the pthread stuff. I have
> noticed that with a pipeline with several elements that create
> threads, this callback can be called several times. I have also
> noticed that these calls, which are coming from different element
> threads, is not serialized.
>
> Question: is there a way to serialize this callback to ensure that a
> given invocation will complete before another element thread is
> allowed to call it?

Maybe just use a lock inside your callback function, so that things get
serialized there? (e.g. with G_LOCK_DEFINE_STATIC + G_LOCK)

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference: 10-11 October 2016 in Berlin,
Germany
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: is there a way to serialize the "sync-message::stream-status" GstBus callback?

Andres Gonzalez
Hi Tim,

Ah, of course, that is the simplest way. I should have thought of that. Thanks for your reply.

-Andres