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