Shared gstreamer pipeline's element (for example appsink) with multiple threads

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

Shared gstreamer pipeline's element (for example appsink) with multiple threads

Nostalgia
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Safely access a gstreamer element ( appsink) from an external thread

Sebastian Dröge-3
On Fri, 2018-06-08 at 07:03 -0700, Nostalgia wrote:

> Hi,
>
> I have this pipeline : appsrc -> omxh264enc -> capsfilter -> appsink
>
> I want to run this pipeline without using g_main_loop, I will send frames
> one by one to the pipeline (from external application and continuously) so I
> want to create a thread that pull buffers received by appsink. This thread
> runs indefinitely until it is signaled to stop . It keeps on trying to pull
> a buffer from the sink.
>
> Is it possible to do that. I am worried about trying to pull buffers from
> sink in a new thread and how I can safe access the sink (using mutex ...)
> when it is used by the gstreamer thread.
That's fine, you can push buffers into appsrc and pop buffers from
appsink from any thread you want. Generally all GStreamer element API
is thread-safe, otherwise nothing would work as GStreamer itself is
already heavily multithreaded.

--
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Safely access a gstreamer element ( appsink) from an external thread

Nostalgia
CONTENTS DELETED
The author has deleted this message.