dad31e22dc8dfbb1acd8109e2ca3dc77e3d0ff8d
[platform/upstream/gstreamer.git] / docs / random / wtay / eos4
1
2 case 1) 
3
4 (--------------------------------------------------)
5 ! bin                                              !
6 ! (--------)         (--------)         (--------) !
7 ! ! fakesrc!         !identity!         !fakesink! !
8 ! !   1   src ----- sink  1  src ---- sink   1   ! !
9 ! (--------)         (--------)         (--------) !
10 !                                                  !
11 ! (--------)         (--------)         (--------) !
12 ! !fakesrc !         !identity!         !fakesink! !
13 ! !   2   src ----- sink  2  src ---- sink   2   ! !
14 ! (--------)         (--------)         (--------) !
15 (--------------------------------------------------)
16
17   just two scheduled chains in a single bin.
18
19 .scheduling.
20   
21   we have two chains here fs1-i1-fsk1 and fs2-i2-fsk2
22   fakesrc1 will output 1 buffer, fakesrc2 3 buffers
23
24 .eos.
25
26   fs1 will call gst_pad_set_eos (src, TRUE) on its srcpad
27   in the _get function and returns a NULL buffer.
28
29   gst_pad_set_eos will recurse down the pipeline and set
30   all the pads in i1 and fsk1 to EOS too. none of these elements
31   override the default behaviour so gst_pad_set_eos returns TRUE.
32
33   fakesrc signals EOS.  since an element in chain1 has signales
34   EOS, chain1 becomes EOS. All the elements in the chain are set
35   to the READY state and the chain is not scheduled anymore because
36   its EOS flag is on.
37
38   the same procedure happens for chain2. At that point, the bin 
39   has no chains to schedule and so it fires EOS.
40
41
42 case 2) 
43
44 (---------------------------------------------------)
45 ! bin                                               !
46 ! (--------)         (--------)         (---------) !
47 ! ! disksrc!         ! mpg123 !         !audiosink! !
48 ! !   1   src ----- sink  1  src ---- sink   1    ! !
49 ! (--------)         (--------)         (---------) !
50 !                                                   !
51 ! (--------)         (--------)         (---------) !
52 ! !disksrc !         ! mpg123 !         !audiosink! !
53 ! !   2   src ----- sink  2  src ---- sink   2    ! !
54 ! (--------)         (--------)         (---------) !
55 (---------------------------------------------------)
56
57   same as case 1, an mp3 mixer where the mixing is performed
58   in hardware (in the audiosink).
59   we want to show how the EOS state can be undone.
60
61 .scheduling.
62   
63   we have two chains here ds1-mpg1-ask1 and ds2-mpg2-ask2
64   the song in chain1 is about to end, chain2 has just begun
65   playing a song.
66
67 .eos.
68
69   disksrc1 will set the src pad to EOS with gst_pad_set_eos (pad, TRUE)
70   the call recurses up and down, disksrc1 signals EOS. the chain with
71   disksrc1 becomes EOS and is excluded from the scheduling algorithm.
72   disksrc1 is set to the READY state.
73
74   the user then changes the location of disksrc1 to the new mp3 song.
75   The user then sets the element state of disksrc to PLAYING. disksrc
76   performs gst_pad_set_eos (pad, FALSE)
77
78   the call recurses up and down and returns TRUE. chain1 is set to !EOS
79   so that it will be scheduled again.
80
81   disksrc1 is set to PLAYING and the new mp3 is playing again.
82
83  
84