4 GST States and Transition Rules (graph to follow)
5 -------------------------------
7 This should be a map of possible state transitions and what triggers them.
10 GST_STATE_NEW: a new element has this, if it has nothing set except name.
11 GST_STATE_INCOMPLETE: any element that has some, but not enough
12 information to function is in this state.
13 GST_STATE_COMPLETE: if the element has enough data, but is not in any kind
14 of running or explicitely stopped state. ready to be used.
15 GST_STATE_DISCOVERY: anything the element does in this state must be reset
16 after discovery. any data read from sync source must be cached.
17 GST_STATE_PREROLL: not a lot different from PLAYING, except sinks don't
18 render what they're getting. useful for elements that require
19 data to get in sync, such as an MPEG video decoder that needs
20 IBBPBB before starting at the next P.
21 GST_STATE_RUNNING: this is the normal state of the pipeline, where data
22 goes all the way through the pipeline normally.
23 GST_STATE_STOPPED: an explicit stop state, different from COMPLETE in that
24 the state doesn't get reset.
28 creating an element (gst_*_new*)
30 GST_STATE_NEW -> GST_STATE_INCOMPLETE
31 setting anything in the element that isn't sufficient to bring it
32 to a useful state (gst_object_set)
34 GST_STATE_INCOMPLETE -> GST_STATE_COMPLETE
35 setting whatever the last bit of info the element was looking for
38 GST_STATE_COMPLETE -> GST_STATE_INCOMPLETE
39 changing anything that invalidates the complete state of the element
41 GST_STATE_COMPLETE -> GST_STATE_DISCOVERY
42 setting the state to DISCOVERY
45 GST_STATE_DISCOVERY -> GST_STATE_COMPLETE
46 setting the state !DISCOVERY
47 [ used when autoplug is over ]
49 GST_STATE_DISCOVERY -> GST_STATE_PREROLL
50 setting the state to PREROLL
51 [ you can go straight to preroll from discovery if you want ]
53 GST_STATE_DISCOVERY -> GST_STATE_RUNNING
54 setting the state to RUNNING
55 [ you can even go straight to running from preroll ]
57 GST_STATE_DISCOVERY -> GST_STATE_STOPPED
58 setting the state to STOPPED
59 [ normally you'd go from discovery to stopped when you load a src ]
61 GST_STATE_PREROLL -> GST_STATE_RUNNING
62 setting the state to RUNNING
63 [ preroll generally leads straight to running, as in above ]
65 GST_STATE_PREROLL -> GST_STATE_STOPPED
66 setting the state to STOPPED
67 [ it is possible to go to stopped, i.e load file@time ]
69 GST_STATE_RUNNING -> GST_STATE_PREROLL
70 setting the state to PREROLL
71 [ unsure if you'd need this state, you'd go to stopped first ]
73 GST_STATE_RUNNING -> GST_STATE_STOPPED
74 setting the state to STOPPED
77 GST_STATE_STOPPED -> GST_STATE_PREROLL
78 setting the state to PREROLL
79 [ if you seek to intermediate time while stopped, you'd preroll to
80 prepare to start running again immediately ]
82 GST_STATE_STOPPED -> GST_STATE_RUNNING
83 setting the state to RUNNING