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() (*)
108 ! wait for commands (release lock)
117 flag GST_THREAD_ACTIVE is set
118 flag GST_THREAD_SPINNING is set
120 BH is waiting for commands.
121 flag GST_THREAD_ACTIVE is set
122 flag GST_THREAD_SPINNING is unset
128 ! while (flag SPINNING is set) {
132 set command for BH (PAUSED) !
133 unset SPINNING flag ! status = iterate ()
134 signal for new command !
135 wait for ACK (release lock) !
136 lock mutex (reacquired after iteration)
141 change state of children to READY (*) (!EOS)
143 ! wait for commands (release lock)
144 (lock reacquired after wait)
145 unlock (release lock)
150 set command for BH (PAUSED)
151 unset SPINNING flag (nop)
152 signal for new command
153 wait for ACK (release lock) !
154 (lock reacquired after wait for cmd)
155 change state of children to READY (*)
157 ! wait for commands (release lock)
158 (lock reacquired after wait)
159 unlock (release lock)
165 similar to READY->PAUSED
171 - figure all state change scenarios occuring in code marked with (*)