[gst-devel] Dirt simple mixer

Erik Walthinsen omega at cse.ogi.edu
Sat Nov 25 09:00:32 CET 2000


Here's an example if a really simple mixer.  You can see how a complex
source might work.  In a more complex mixer I'd seriously contemplate
making a completely new Bin designed to schedule this stuff specifically,
since at the very minimum you must walk through every channel exactly
once per iteration.

I'd love to end up with a generic Bin/Thread that's capable of pulling off
even the most complex situations stock, but I fear some thigs may be too
specialized.

The question is how to deal with sources like this.  My first thought
would be to force them into inverse-chain mode, where the pullfunc is used
independently for each channel, but the problem with that is the same
reason there's a single alsasrc and not 8 single ones: there needs to be
some coordination between the operations on each channel.  This could be
set up with some work inside the element, where the first one causes the
buffers to be read, and they sit around waiting for the rest of the
channels to _pull. 

If it's a loopfunc, problem solved, since there are no special means of
deal with them, they just loop doing stuff.  And it solves the specific
problem of keeping all channels flowing by forcing a push of each channel
once per loop through alsasrc:

alsasrc pushes on channel 0, buffer goes all the way to mix, the next pull
(assuming the mixer is stupid) walks back and switches back to alsasrc,
which promptly pushes out channel 1.  Problem solved.

If it's not a loopfunc, but a collection of pads with pullfuncs, then we
can fabricate a loop that does the same thing.  You lose control there,
since all it will do is go in a loop and pull from each pad in turn.

The question then is what if you have a complex source with no pattern of
requests from the pads.  If you're not cothreaded, no problem, you just
get each pad's loopfunc called on whatever stack as appropriate.  This
does require that the Src *not* be a scheduling entry into the Bin.  If
you are cothreaded, the pull function would have to inform the element
which pad it is that's being pulled, before switching cothreads.  The
loopfunc_wrapper would have to pick up that hint and call the pullfunc of
the appropriate pad.  Hmm.

I'm writing up a document listing all the possible ways we might construct
a source, and how they are actually scheduled and run.  I'll send it out
tonight when I finish the first draft.


BTW, I can't get to irc.openprojects.net at the moment, so IRC is rather
hosed.  If it's still unavaible tomorrow morning, head to seul.org:7776,
#gstreamer.

         Erik Walthinsen <omega at cse.ogi.edu> - Staff Programmer @ OGI
        Quasar project - http://www.cse.ogi.edu/DISC/projects/quasar/
   Video4Linux Two drivers and stuff - http://www.cse.ogi.edu/~omega/v4l2/
        __
       /  \             SEUL: Simple End-User Linux - http://www.seul.org/
      |    | M E G A           Helping Linux become THE choice
      _\  /_                          for the home or office user
-------------- next part --------------
#FIG 3.2
Landscape
Center
Inches
Letter  
100.00
Single
-2
1200 2
6 3300 1725 4800 2175
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 1725 4800 1725 4800 2175 3300 2175 3300 1725
4 0 0 50 0 0 12 0.0000 4 180 720 3450 2025 Equalizer\001
-6
6 3300 2325 4800 2775
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 2325 4800 2325 4800 2775 3300 2775 3300 2325
4 0 0 50 0 0 12 0.0000 4 180 720 3450 2625 Equalizer\001
-6
6 3300 2925 4800 3375
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 2925 4800 2925 4800 3375 3300 3375 3300 2925
4 0 0 50 0 0 12 0.0000 4 180 720 3450 3225 Equalizer\001
-6
6 3300 3525 4800 3975
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 3525 4800 3525 4800 3975 3300 3975 3300 3525
4 0 0 50 0 0 12 0.0000 4 180 720 3450 3825 Equalizer\001
-6
6 3300 4125 4800 4575
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 4125 4800 4125 4800 4575 3300 4575 3300 4125
4 0 0 50 0 0 12 0.0000 4 180 720 3450 4425 Equalizer\001
-6
6 3300 4725 4800 5175
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 4725 4800 4725 4800 5175 3300 5175 3300 4725
4 0 0 50 0 0 12 0.0000 4 180 720 3450 5025 Equalizer\001
-6
6 3300 5325 4800 5775
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 5325 4800 5325 4800 5775 3300 5775 3300 5325
4 0 0 50 0 0 12 0.0000 4 180 720 3450 5625 Equalizer\001
-6
6 3300 5925 4800 6375
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 3300 5925 4800 5925 4800 6375 3300 6375 3300 5925
4 0 0 50 0 0 12 0.0000 4 180 720 3450 6225 Equalizer\001
-6
6 5700 1725 7200 2175
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 1725 7200 1725 7200 2175 5700 2175 5700 1725
4 0 0 50 0 0 12 0.0000 4 135 360 5850 2025 Gain\001
-6
6 5700 2325 7200 2775
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 2325 7200 2325 7200 2775 5700 2775 5700 2325
4 0 0 50 0 0 12 0.0000 4 135 360 5850 2625 Gain\001
-6
6 5700 2925 7200 3375
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 2925 7200 2925 7200 3375 5700 3375 5700 2925
4 0 0 50 0 0 12 0.0000 4 135 360 5850 3225 Gain\001
-6
6 5700 3525 7200 3975
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 3525 7200 3525 7200 3975 5700 3975 5700 3525
4 0 0 50 0 0 12 0.0000 4 135 360 5850 3825 Gain\001
-6
6 5700 4125 7200 4575
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 4125 7200 4125 7200 4575 5700 4575 5700 4125
4 0 0 50 0 0 12 0.0000 4 135 360 5850 4425 Gain\001
-6
6 5700 5325 7200 5775
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 5325 7200 5325 7200 5775 5700 5775 5700 5325
4 0 0 50 0 0 12 0.0000 4 135 360 5850 5625 Gain\001
-6
6 5700 5925 7200 6375
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 5925 7200 5925 7200 6375 5700 6375 5700 5925
4 0 0 50 0 0 12 0.0000 4 135 360 5850 6225 Gain\001
-6
6 5700 4725 7200 5175
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 5700 4725 7200 4725 7200 5175 5700 5175 5700 4725
4 0 0 50 0 0 12 0.0000 4 135 360 5850 5025 Gain\001
-6
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 1950 3300 1950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 2550 3300 2550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 3150 3300 3150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 3750 3300 3750
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 4350 3300 4350
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 4950 3300 4950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 5550 3300 5550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 2550 6150 3300 6150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 1950 5700 1950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 2550 5700 2550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 3150 5700 3150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 3750 5700 3750
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 4350 5700 4350
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 4950 5700 4950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 5550 5700 5550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 4800 6150 5700 6150
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 1800 2550 1800 2550 2100 2400 2100 2400 1800
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 2400 2550 2400 2550 2700 2400 2700 2400 2400
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 3000 2550 3000 2550 3300 2400 3300 2400 3000
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 3600 2550 3600 2550 3900 2400 3900 2400 3600
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 4200 2550 4200 2550 4500 2400 4500 2400 4200
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 4800 2550 4800 2550 5100 2400 5100 2400 4800
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 5400 2550 5400 2550 5700 2400 5700 2400 5400
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 2400 6000 2550 6000 2550 6300 2400 6300 2400 6000
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 900 1200 2550 1200 2550 6900 900 6900 900 1200
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 8100 1500 9600 1500 9600 6900 8100 6900 8100 1500
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 10500 3150 11700 3150 11700 5100 10500 5100 10500 3150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 1950 8100 1950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 2550 8100 2550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 3150 8100 3150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 3750 8100 3750
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 4350 8100 4350
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 4950 8100 4950
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 5550 8100 5550
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 7200 6150 8100 6150
2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
	 9600 4200 10500 4200
2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
	 600 600 12000 600 12000 7200 600 7200 600 600
4 0 0 50 0 0 12 0.0000 4 135 555 1050 1500 alsasrc\001
4 0 0 50 0 0 12 0.0000 4 135 270 8325 1875 mix\001
4 0 0 50 0 0 12 0.0000 4 135 630 10650 3450 alsasink\001
4 0 0 50 0 0 12 0.0000 4 135 480 825 975 thread\001
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/octet-stream
Size: 5960 bytes
Desc: 
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20001125/6e94943d/attachment.obj>


More information about the gstreamer-devel mailing list