[gst-devel] Threads in 0.8.10

MDK mdk at mdk.org.pl
Mon Jul 4 14:43:54 CEST 2005


Dnia 04-07-2005, pon o godzinie 17:39 +0200, Ronald S. Bultje
napisał(a):

> Also, make thread2/3 be a child in
> thread1, and set state on thread1. That's what playbin does, it appears
> to work fine.

Thanks! That works. But... as long as I use "simple" elements inside
threads. If I "wrap" elements into more bins, it fails. To be more
precise, that WORKS:

Thread_1: BIN (Filesrc -> DecodeBin) -> MyLoopyElement
Thread_2: Queue -> XVImageSink
Thread_3: Queue -> Alsasink

That DOESN'T work (plays cool but 50% chance of deadlock on pausing):

Thread_1: BIN( BIN(Filesrc -> DecodeBin) -> MyLoopyElement)  
Thread_2: BIN( Queue -> XVImageSink)
Thread_3: BIN( Queue -> AlsaSink)

I need to have the elements in the bins because I use them for seeking.
On the seeking operation, I remove the bins from threads, and add them
(temporarily) to a pipeline (actually - 3 pipelines, one for each bin,
so that queues "connect elements with different schedluers"). I manualy
do a few iterations (until I get a frame on the videoprobe) and than I
re-attach the bins to threads. 

Thanks to this, I get a very nice, totaly smooth "seek with preview"
operation (audio scrubbing is also possible this way). 

BTW, all solutions work (even the ones I submitted in the first place)
with big queues (like the default one - one second). Problems start, if
I reduce the queues to something like 5/25th of a second (your solution
still works though). 

-- 
Michał Dominik K.
mdk at mdk.org.pl
www.mdk.org.pl


 




More information about the gstreamer-devel mailing list