7 (--------------------------------------------------)
9 ! (--------) (--------) (--------) !
10 ! ! fakesrc! !identity! !fakesink! !
11 ! ! src ----- sink src ---- sink ! !
12 ! (--------) (--------) (--------) !
13 (--------------------------------------------------)
17 case1 has just one scheduled entity (chain) no problem here.
21 fakesrc detects the end of stream. It just returned the last buffer.
22 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
23 After that it will return a NULL buffer.
25 gst_pad_set_eos() will notify the parent about the plugins attempt to
26 signal eos. the parent disables scheduling for the chain containing
29 no more chains are being scheduled so the bin fires EOS.
35 (-----------------------------------------------------------------------)
39 ! (--------) (--------) (--------) ! (--------)! !
40 ! ! fakesrc! !identity! ! queue ! ! !fakesink!! !
41 ! ! src ----- sink src ---- sink src ---- sink !! !
42 ! (--------) (--------) (--------) ! (--------)! !
44 (-----------------------------------------------------------------------)
48 case2 has two scheduled entities: fsr-i-q, q-fsk.
49 The first one is scheduled by the bin, the second one by the thread.
53 fakesrc detects the end of stream. It just returned the last buffer.
54 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
55 After that it will return a NULL buffer.
57 gst_pad_set_eos() will notify the parent about the plugins attempt to
58 signal eos. the parent will take chain1 out if its scheduled chains.
60 the bin does not fire EOS yet because the thread has not yet signaled
63 after the queue has sent out the last buffer, its calls eos on its
64 src pad. the chain with the queue is removed from the threads scheduled
65 chains. there are no more chains to schedule, the thread fires EOS.
67 The bin now has no more scheduled chains and no more pending subbins,
73 (-----------------------------------------------------------------------)
77 ! (--------) (--------) (--------) ! (--------)! !
78 ! ! fakesrc! ! tee ! ! queue1 ! ! !fakesink!! !
79 ! ! src ----- sink src ---- sink src ---- sink !! !
80 ! (--------) ! ! (--------) ! (--------)! !
81 ! ! ! (---------------) !
83 ! ! ! (---------------) !
85 ! ! ! (--------) ! (--------)! !
86 ! ! ! ! queue2 ! ! !fakesink!! !
87 ! ! src ---- sink src ---- sink !! !
88 ! ! ! (--------) ! (--------)! !
89 ! (--------) (---------------) !
90 (-----------------------------------------------------------------------)
94 case3 has tree scheduled entities: fsr-t(-q1,-q2), q1-fsk. q2-fsk
95 the first one is managed by the bin, the second two are managed by the
100 fakesrc detects the end of stream. It just returned the last buffer.
101 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
102 After that it will return a NULL buffer.
104 chain1 is taken out of the scheduling algorithm of the bin.
106 after a while, the threads finish their scheduling and fire EOS too.
108 The bin now has no more scheduled chains and no more pending subbins,
114 (-----------------------------------------------------------------------)
116 ! (---------------) !
118 ! (--------) (----------) (--------) ! (--------)! !
119 ! ! fakesrc! !mpeg1parse! ! queue1 ! ! !fakesink!! !
120 ! ! src -- sink src ---- sink src ---- sink !! !
121 ! (--------) ! ! (--------) ! (--------)! !
122 ! ! ! (---------------) !
124 ! ! ! (---------------) !
126 ! ! ! (--------) ! (--------)! !
127 ! ! ! ! queue2 ! ! !fakesink!! !
128 ! ! src ---- sink src ---- sink !! !
129 ! ! ! (--------) ! (--------)! !
130 ! (----------) (---------------) !
131 (-----------------------------------------------------------------------)
133 this case differs from case3 in that one of the queues can be empty
134 while the other isn't. we assume queue1 is empty while queue2 isn't yet.
138 case3 has tree scheduled entities: fsr-t(-q1,-q2), q1-fsk. q2-fsk
139 the first one is managed by the bin, the second two are managed by the
144 fakesrc detects the end of stream. It just returned the last buffer.
145 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
146 After that it will return a NULL buffer.
148 chain1 is taken out of the scheduling algorithm of the bin.
150 after a while, the threads finish their scheduling and fire EOS too.
151 chain2 (with queue1) is taken out of the scheduling first because it
154 chain3 (with queue2) finally removes its last scheduled chain and
157 The bin now has no more scheduled chains and no more pending subbins,
163 (-----------------------------------------------------------------------)
165 ! (---------------) !
167 ! (--------) (----------) (--------) ! ! !
168 ! !disksrc1! ! effect ! ! mixer ! ! ! !
169 ! ! src -- sink src ---- sink src -- sink ! !
170 ! (--------) (----------) ! ! ! ! !
171 ! ! ! (---------------) !
172 ! (--------) (----------) ! ! !
173 ! !disksrc2! ! effect ! ! ! !
174 ! ! src -- sink src ---- sink ! !
175 ! (--------) (----------) (--------) !
176 (-----------------------------------------------------------------------)
178 This is a simple audio mixer (mp3audio mixer).
179 We assume disksrc1 is going to be in EOS while disksrc2 is still in !EOS
184 two chains are detected: disksrc1-effect-mixer-audiosink,
185 disksrc2-effect-mixer-audiosink
189 disksrc1 has passed the last buffer in the _get function. with its next
190 call to _get, it will return a NULL buffer and set the src pad to EOS.
192 the EOS call travels up till the mixer element because it has overridden
193 the handler. The first chain is disabled from the scheduler.
195 finally disksrc2 run into EOS, same procedure as with disksrc1, except
196 now the mixer also sets EOS to its src pad, chain2 becomes inactive too
197 and the bin fires EOS because there are no more chains to schedule.
199 somebody sets the location of disksrc1 to a new mp3 file, the srcpad
200 is set to !EOS, chain1 is scheduled again, mixer is activated again too
201 and audio is playing again...
206 (-------------------------------------------------------------------------------------)
208 ! (---------------) !
209 ! (---------------------------------------------) !audiosink ! !
211 ! ! (--------) (----------) (-----) ! (--------) ! ! !
212 ! ! !disksrc1! ! effect ! !queue! ! ! mixer ! ! ! !
213 ! ! ! src -- sink src -- sink src -- sink src -- sink ! !
214 ! ! (--------) (----------) (-----) ! ! ! ! ! !
215 ! (---------------------------------------------) ! ! ! ! !
216 ! ! ! (---------------) !
217 ! (---------------------------------------------) ! ! !
219 ! ! (--------) (----------) (-----) ! ! ! !
220 ! ! !disksrc2! ! effect ! !queue! ! ! ! !
221 ! ! ! src -- sink src -- sink src -- sink ! !
222 ! ! (--------) (----------) (-----) ! (--------) !
223 ! (---------------------------------------------) !
224 (-------------------------------------------------------------------------------------)
226 This is a simple audio mixer (mp3audio mixer).
227 We assume disksrc1 is going to be in EOS while disksrc2 is still in !EOS
231 Scheduling is a bit tricky here: we have two threads with each one chain ds1-e-q and
232 ds2-e-q. the mixer element is loop based and forms a third chain, mixer-audiosink
236 disksrc1 has passed the last buffer in the _get function. with its next
237 call to _get, it will return a NULL buffer and set the src pad to EOS.
239 the EOS call travels up till the queue element because it has overridden
240 the handler. The first chain is disabled from the scheduler. thread1 fires EOS
241 because it does not have any chains to schedule.
243 the mixer element pulls buffers from queue1 until queue1 is empty. At that time,
244 queue1 sets the pad to EOS, mixer now knows that it does not have to request
245 another buffer from that pad again.
247 disksrc2 finally sets its pad to EOS, rendering chain2 unscheduled which makes
248 the thread2 fire an EOS.
250 the mixer element pulls buffers from queue2 until queue2 is empty. At that time,
251 queue2 sets the pad to EOS, mixer now knows that it does not have to request
252 another buffer from that pad again. all pads for the mixer are in EOS now so
253 it sets the src pad to EOS. the last chain now also becomes unscheduled and