appsrc and producer thread

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

appsrc and producer thread

Albin Stigö
Hi,

Question:
Is it ok to to call gst_app_src_push_buffer from a separate producer
thread, is appsrc threadsafe in that way? I have been reading through
the documentation and examples but a lot of the sample code seem to
rely on the "need-data" signal or idle function and I would like to
avoid this.

Background:
I'm developing a Software Defined Radio (SDR) application where I
capture samples from a hardware device and perform demodulation in
software. I would like to let the capturing process block in a read
call until there's data avaiable and then call gst_app_src_push_buffer
with the demodulated audio.


--Albin
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: appsrc and producer thread

Tim Müller
On Tue, 2018-01-09 at 11:58 +0100, Albin Stigö wrote:

Hi Albin,

> Is it ok to to call gst_app_src_push_buffer from a separate producer
> thread, is appsrc threadsafe in that way? I have been reading through
> the documentation and examples but a lot of the sample code seem to
> rely on the "need-data" signal or idle function and I would like to
> avoid this.

That should be perfectly fine. appsrc can be either driven by the
"need-data" signal, or simply by some separate producer that just
pushes data into appsrc whenever it becomes available, in which case
the appsrc-internal thread will just wait for more data.

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel