get_state
Description:
public virtual StateChangeReturn get_state (
out State state,
out State pending,
ClockTime timeout)
Gets the state of the element.
For elements that performed an ASYNC state change, as reported by
set_state, this function will block up to the specified timeout value for the state change to complete. If the element completes the state
change or goes into an error, this function returns immediately with a return value of
SUCCESS or
FAILURE respectively.
For elements that did not return ASYNC, this function returns
the current and pending state immediately.
This function returns NO_PREROLL if the element
successfully changed its state but is not able to provide data yet. This mostly happens for live sources that only produce data in
PLAYING. While the state change return is equivalent to
SUCCESS, it is returned to the application to signal that
some sink elements might not be able to complete their state change because an element is not producing data to complete the preroll. When
setting the element to playing, the preroll will complete and playback will start.
Parameters:
| state |
a pointer to State to hold the state. Can be null. |
| pending |
a pointer to State to hold the pending state. Can be null. |
| timeout |
a ClockTime to specify the timeout for an async state change or
CLOCK_TIME_NONE for infinite timeout. |
Returns:
| SUCCESS if the element has no more pending state and
the last state change succeeded, ASYNC if the element is
still performing a state change or FAILURE if the last
state change failed. MT safe. |