[gst-devel] Newbie Question: Loops and Queues
Wim Taymans
wim.taymans at chello.be
Mon Feb 11 14:59:26 CET 2002
On Mon, 2002-02-11 at 23:23, rahul at reno.cis.upenn.edu wrote:
> Hi Folks,
Hi,
> I am trying to write a simple pipeline, with a fakesrc, a queue, and a
> thread, where the thread has an identity and a fakesink. It seems to run
> fine, with a handoff signal defined on the sink, and nowhere else. It
> has 3 cothreads, presumable for the src, sink, and identity.
yup,
fakesrc ! { queue ! identity ! fakesink }
would give 3 cothreads for fakesrc, identity and fakesink. the queue is
handled without a cothread. It'll show that the scheduler is not optimal
as it could do this pipeline without cothreads. The scheduler currently
creates a cothread for all non-decoupled elements.
>
> I have gone throught the queue examples and tests in the CVS, perhaps I
> missed it, but I could not find an example of a loop based
> situation(which identity supports) where the thread spawns cothreads
> which read from queue and give to identity. Is it correct to think that
> I ought to be using identity in loop mode? In the distribution lat.c
> shows the example of identity and queue, but does not demo a pad_pull.
gst-launch is your friend, along with the --gst-mask=-1 option. the line
for the above example would be like:
./gst-launch --gst-mask=-1 fakesrc ! identity loop_based=true ! fakesink
2>&1 | less -R
again the scheduler decides to use a cothread for fakesrc, identity and
fakesink while that would not be needed (arguably one cothread for this
chain would be optimal, for error recovery reasons).
I have a fast scheduler scheduler laying around that does just that but
it can only handle one loop based element ATM. If there is demand I can
check it in so people can play with it. latency for a 12 element
pipeline drops from 65µs to 45µs with this optimisation on my Athlon
1.2GHz (measured with lat.c if I understand the result correctly).
>
> I'd be grateful is someone could point me to an appropriate example, or
> illustrate in a bit of pseudocode, what I ought to be doing. I am using
> these examples and the debug masks to try and understand how gstreamer
> does what it does..
The key here is to set the loop_base property in identity with
g_object_set (identity, "loop_based", TRUE, NULL);
Wim
> Thanks a lot,
> Rahul
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
>
More information about the gstreamer-devel
mailing list