[gst-devel] gstreamer/glib scheduler behavior

Wim Taymans wim at fluendo.com
Wed Apr 19 07:01:19 CEST 2006


On Tue, 2006-04-18 at 18:38 +0200, David Giguet wrote:
> I have some questions about gstreamer/glib scheduler:
> 
> - Is gstreamer run loop get descheduled and give some CPU to other
> process/threads when it has nothing to do ?

In GStreamer 0.10, elements (mostly sources or demuxers) start a kernel
thread to perform the data passing. The normal rules apply for
scheduling these threads, ie.
a running thread gets unscheduled if a) it consumed its CPU slice b) if
needs to acquire a mutex (rare, happens only when manipulating the
running pipeline) c) it performs a blocking operation such as
select/read/cond_wait/... 
So, most of a typical playback pipeline is spent in cond_wait for the
clock synchronisation, during that time any other thread can run freely.

> 
> - Is gstreamer going into a sleep function when it has nothing to do or
> is it blocked on a semaphore or mutex ?

It is blocked on a mutex or any other blocking kernel operation
currently.

> 
> - Is it possible to increase thread priority for audio driver ? Is it
> done inside the plug-in ?

Since we rely on glib's GThread API, there is a method
g_thread_set_priority() which claims it doesn't do much on Linux...

> 
> - If I want to implement a video output plug-in of a video player, will
> gstreamer call video output plug-in according to the video  time stamp
> included in the input file or should I manage some sleep functions
> inside the video output plug-in ?

The gstvideosink base class will do any synchronisation for you, you
just need to render the images when your vmethod is called. An example
of a well written videosink can be found in the gst-plugins-base module
in sys/xvimage/xvimagesink.c

Wim
> 
> David

> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
-- 
Wim Taymans <wim at fluendo.com>





More information about the gstreamer-devel mailing list