gstreamer threading internal

Tim-Philipp Müller t.i.m at zen.co.uk
Wed Feb 29 03:28:45 PST 2012


On Wed, 2012-02-29 at 02:22 -0800, mirtexxan wrote:

> When I launch
> a simple gst-launch-0.10 audiotestsrc ! identity ! alsasink, I see 4 threads
> when using "top". One of course is the gst-launch application thread.
> Another (called threaded-ml) I guess is the scheduling thread and the other
> 2 (called audiotesrc0:s) I guess are the source element internal threads. Am
> I correct?

There is

 - the main application thread

 - an audiotestsrc thread generating
   data and pushing it downstream

 - an audio ring buffer thread inside
   the alsasink element

 - threaded-ml, which belongs to pulseaudio
   (which is where your alsa output goes I guess)

 - (no system clock thread in this case)


> And finally a more advanced question: what about setting core affinity in
> gstreamer? Thread priority? It is possible to create special purpose element
> to do the trick?

You can do things like that. STREAM_STATUS messages get posted on the
bus when threads are started, you can catch those synchronously (from
the thread context that emitted them) and configure stuff. You can also
use your own thread pools, check out the examples under
tests/examples/streams/ in the gstreamer core source code.

Cheers
 -Tim



More information about the gstreamer-devel mailing list