On Tue, 2016-11-29 at 10:46 +0100, Petr Kulhavy wrote:
> Hi,
>
> the GstBaseSrc class implies the use of polling the source in the create
> and fill methods. I.e. the create/fill waits for data from the source,
> reads it and returns it.
> Is there an existing mechanism for event driven sources? I.e. to
> register a callback function, which is called every time data appears.
You could use appsrc for that, or something similar like other sources
based on callbacks are doing (e.g. decklinkvideosrc). You would get
your callback and then queue the data for some other thread to put it
into the GStreamer pipeline. You probably don't want to do that
directly from the callback as that callback would then be blocked until
the data was consumed.
In some cases you probably want that, in which case you could iterate
an event loop inside the GstBaseSrc::create() function. souphttpsrc is
doing that for example.
--
Sebastian Dröge, Centricular Ltd ·
http://www.centricular.com_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel