4 - the managing container (top half). This is the main thread that
5 will create and control the main_loop.
7 - the main_loop (bottom half), this is the thread that actually does
20 At this point only the top half exists.
21 flag GST_THREAD_ACTIVE is unset
23 flow: (TH column 1, BH column 2, ! denotes (possible) thread switch)
26 wait for spin up (release lock) !
28 set flag GST_THREAD_ACTIVE
29 change state of children to READY (*)
31 ! wait for commands (release lock)
32 (lock reacquired after wait)
35 (*) marks a spot that could potentially induce another state change.
42 BH is waiting for commands.
43 flag GST_THREAD_ACTIVE is set
47 set command for BH (NULL)
48 signal for new command
49 wait for ACK (release lock) !
50 (lock reacquired after wait for cmd)
51 change state of children to NULL (*)
53 unset flag GST_THREAD_ACTIVE
54 ! unlock (release lock)
56 (lock reacquired after wait)
65 BH is waiting for commands.
66 flag GST_THREAD_ACTIVE is set
70 set command for BH (PAUSED)
71 signal for new command
72 wait for ACK (release lock) !
73 (lock reacquired after wait for cmd)
74 change state of children to READY (*)
76 ! wait for commands (release lock)
77 (lock reacquired after wait)
85 BH is waiting for commands.
86 flag GST_THREAD_ACTIVE is set
90 set command for BH (PLAYING)
91 signal for new command
92 wait for ACK (release lock) !
93 (lock reacquired after wait for cmd)
94 change state of children to PLAYING (*)
95 set flag GST_THREAD_SPINNING
96 while (flag SPINNING is set) {
99 (lock reacquired after wait) !
100 unlock (release lock) !
101 ! status = iterate() (*)
107 ! wait for commands (release lock)
116 flag GST_THREAD_ACTIVE is set
117 flag GST_THREAD_SPINNING is set
119 BH is waiting for commands.
120 flag GST_THREAD_ACTIVE is set
121 flag GST_THREAD_SPINNING is unset
127 ! while (flag SPINNING is set) {
131 set command for BH (PAUSED) !
132 unset SPINNING flag ! status = iterate ()
133 signal for new command !
134 wait for ACK (release lock) !
135 lock mutex (reacquired after iteration)
140 change state of children to READY (*) (!EOS)
142 ! wait for commands (release lock)
143 (lock reacquired after wait)
144 unlock (release lock)
149 set command for BH (PAUSED)
150 unset SPINNING flag (nop)
151 signal for new command
152 wait for ACK (release lock) !
153 (lock reacquired after wait for cmd)
154 change state of children to READY (*)
156 ! wait for commands (release lock)
157 (lock reacquired after wait)
158 unlock (release lock)
164 similar to READY->PAUSED
170 - figure all all state change scenarios occuring in code marked with (*)