4 (--------------------------------------------------)
6 ! (--------) (--------) (--------) !
7 ! ! fakesrc! !identity! !fakesink! !
8 ! ! src ----- sink src ---- sink ! !
9 ! (--------) (--------) (--------) !
10 (--------------------------------------------------)
14 case1 has just one scheduled entity (chain) no problem here.
18 fakesrc detects the end of stream. It just returned the last buffer.
19 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
20 After that it will return a NULL buffer.
22 gst_pad_set_eos() will notify the parent about the plugins attempt to
23 signal eos. the parent disables scheduling for the chain containing
26 no more chains are being scheduled so the bin fires EOS.
32 (-----------------------------------------------------------------------)
36 ! (--------) (--------) (--------) ! (--------)! !
37 ! ! fakesrc! !identity! ! queue ! ! !fakesink!! !
38 ! ! src ----- sink src ---- sink src ---- sink !! !
39 ! (--------) (--------) (--------) ! (--------)! !
41 (-----------------------------------------------------------------------)
45 case2 has two scheduled entities: fsr-i-q, q-fsk.
46 The first one is scheduled by the bin, the second one by the thread.
50 fakesrc detects the end of stream. It just returned the last buffer.
51 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
52 After that it will return a NULL buffer.
54 gst_pad_set_eos() will notify the parent about the plugins attempt to
55 signal eos. the parent will take chain1 out if its scheduled chains.
57 the bin does not fire EOS yet because the thread has not yet signaled
60 after the queue has sent out the last buffer, its calls eos on its
61 src pad. the chain with the queue is removed from the threads scheduled
62 chains. there are no more chains to schedule, the thread fires EOS.
64 The bin now has no more scheduled chains and no more pending subbins,
70 (-----------------------------------------------------------------------)
74 ! (--------) (--------) (--------) ! (--------)! !
75 ! ! fakesrc! ! tee ! ! queue1 ! ! !fakesink!! !
76 ! ! src ----- sink src ---- sink src ---- sink !! !
77 ! (--------) ! ! (--------) ! (--------)! !
78 ! ! ! (---------------) !
80 ! ! ! (---------------) !
82 ! ! ! (--------) ! (--------)! !
83 ! ! ! ! queue2 ! ! !fakesink!! !
84 ! ! src ---- sink src ---- sink !! !
85 ! ! ! (--------) ! (--------)! !
86 ! (--------) (---------------) !
87 (-----------------------------------------------------------------------)
91 case3 has tree scheduled entities: fsr-t(-q1,-q2), q1-fsk. q2-fsk
92 the first one is managed by the bin, the second two are managed by the
97 fakesrc detects the end of stream. It just returned the last buffer.
98 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
99 After that it will return a NULL buffer.
101 chain1 is taken out of the scheduling algorithm of the bin.
103 after a while, the threads finish their scheduling and fire EOS too.
105 The bin now has no more scheduled chains and no more pending subbins,
111 (-----------------------------------------------------------------------)
113 ! (---------------) !
115 ! (--------) (----------) (--------) ! (--------)! !
116 ! ! fakesrc! !mpeg1parse! ! queue1 ! ! !fakesink!! !
117 ! ! src -- sink src ---- sink src ---- sink !! !
118 ! (--------) ! ! (--------) ! (--------)! !
119 ! ! ! (---------------) !
121 ! ! ! (---------------) !
123 ! ! ! (--------) ! (--------)! !
124 ! ! ! ! queue2 ! ! !fakesink!! !
125 ! ! src ---- sink src ---- sink !! !
126 ! ! ! (--------) ! (--------)! !
127 ! (----------) (---------------) !
128 (-----------------------------------------------------------------------)
130 this case differs from case3 in that one of the queues can be empty
131 while the other isn't. we assume queue1 is empty while queue2 isn't yet.
135 case3 has tree scheduled entities: fsr-t(-q1,-q2), q1-fsk. q2-fsk
136 the first one is managed by the bin, the second two are managed by the
141 fakesrc detects the end of stream. It just returned the last buffer.
142 The next _pull will cause the srcpad to trigger gst_pad_set_eos ().
143 After that it will return a NULL buffer.
145 chain1 is taken out of the scheduling algorithm of the bin.
147 after a while, the threads finish their scheduling and fire EOS too.
148 chain2 (with queue1) is taken out of the scheduling first because it
151 chain3 (with queue2) finally removes its last scheduled chain and
154 The bin now has no more scheduled chains and no more pending subbins,
160 (-----------------------------------------------------------------------)
162 ! (---------------) !
164 ! (--------) (----------) (--------) ! ! !
165 ! !disksrc1! ! effect ! ! mixer ! ! ! !
166 ! ! src -- sink src ---- sink src -- sink ! !
167 ! (--------) (----------) ! ! ! ! !
168 ! ! ! (---------------) !
169 ! (--------) (----------) ! ! !
170 ! !disksrc2! ! effect ! ! ! !
171 ! ! src -- sink src ---- sink ! !
172 ! (--------) (----------) (--------) !
173 (-----------------------------------------------------------------------)
175 This is a simple audio mixer (mp3audio mixer).
176 We assume disksrc1 is going to be in EOS while disksrc2 is still in !EOS
181 two chains are detected: disksrc1-effect-mixer-audiosink,
182 disksrc2-effect-mixer-audiosink
186 disksrc1 has passed the last buffer in the _get function. with its next
187 call to _get, it will return a NULL buffer and set the src pad to EOS.
189 the EOS call travels up till the mixer element because it has overridden
190 the handler. The first chain is disabled from the scheduler.
192 finally disksrc2 run into EOS, same procedure as with disksrc1, except
193 now the mixer also sets EOS to its src pad, chain2 becomes inactive too
194 and the bin fires EOS because there are no more chains to schedule.
196 somebody sets the location of disksrc1 to a new mp3 file, the srcpad
197 is set to !EOS, chain1 is scheduled again, mixer is activated again too
198 and audio is playing again...
203 (-------------------------------------------------------------------------------------)
205 ! (---------------) !
206 ! (---------------------------------------------) !audiosink ! !
208 ! ! (--------) (----------) (-----) ! (--------) ! ! !
209 ! ! !disksrc1! ! effect ! !queue! ! ! mixer ! ! ! !
210 ! ! ! src -- sink src -- sink src -- sink src -- sink ! !
211 ! ! (--------) (----------) (-----) ! ! ! ! ! !
212 ! (---------------------------------------------) ! ! ! ! !
213 ! ! ! (---------------) !
214 ! (---------------------------------------------) ! ! !
216 ! ! (--------) (----------) (-----) ! ! ! !
217 ! ! !disksrc2! ! effect ! !queue! ! ! ! !
218 ! ! ! src -- sink src -- sink src -- sink ! !
219 ! ! (--------) (----------) (-----) ! (--------) !
220 ! (---------------------------------------------) !
221 (-------------------------------------------------------------------------------------)
223 This is a simple audio mixer (mp3audio mixer).
224 We assume disksrc1 is going to be in EOS while disksrc2 is still in !EOS
228 Scheduling is a bit tricky here: we have two threads with each one chain ds1-e-q and
229 ds2-e-q. the mixer element is loop based and forms a third chain, mixer-audiosink
233 disksrc1 has passed the last buffer in the _get function. with its next
234 call to _get, it will return a NULL buffer and set the src pad to EOS.
236 the EOS call travels up till the queue element because it has overridden
237 the handler. The first chain is disabled from the scheduler. thread1 fires EOS
238 because it does not have any chains to schedule.
240 the mixer element pulls buffers from queue1 until queue1 is empty. At that time,
241 queue1 sets the pad to EOS, mixer now knows that it does not have to request
242 another buffer from that pad again.
244 disksrc2 finally sets its pad to EOS, rendering chain2 unscheduled which makes
245 the thread2 fire an EOS.
247 the mixer element pulls buffers from queue2 until queue2 is empty. At that time,
248 queue2 sets the pad to EOS, mixer now knows that it does not have to request
249 another buffer from that pad again. all pads for the mixer are in EOS now so
250 it sets the src pad to EOS. the last chain now also becomes unscheduled and