Threading in gstream pipeline

Nicolas Dufresne nicolas.dufresne at collabora.com
Thu Mar 27 12:56:29 PDT 2014


Le mercredi 26 mars 2014 à 10:57 -0700, manickam palaniappan a écrit :

> But when doing a htop cmd on the machine running gstreamer pipeline, I
> found to my surprise that there were as many as 16 processes spawned
> by gstreamer pipeline, roughly on the basis of 1 process per element.
> This means every element behaves like a process. But then running some
> 10 pipelines like this on a system could easily choke the system.

GStreamer does not create processes, but threads. You need no to confuse
the concept. The number of thread highly depends on the pipeline. 16
seems a log, but you could put 16 queue one after the other and you'd
get that.

> Is my understanding right? If so, what can be done to alleviate
> scaling issues where a machine may need to cater to 10 or more
> pipelines.

It should not be a problem on modern operating system, though share more
information, since we don't usually use that many threads for normal
playback.

> 
> And letting some light on the detail of how threading/multiprocessing
> is implemented in gstreamer would be really helpful.

Generally speaking, threading is implemented per element. Some element
must provide a thread, like sources, and queues. Demuxer may be
providing a thread too, and then some decoders and encoders provide a
threads to improve parallelism. GStreamer API is thread safe, but there
is no central management of all threads.

Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140327/a8c32565/attachment.sig>


More information about the gstreamer-devel mailing list