Element.setState

Sets the state of the element. This function will try to set the requested state by going through all the intermediary states and calling the class's state change function for each.

This function can return #GST_STATE_CHANGE_ASYNC, in which case the element will perform the remainder of the state change asynchronously in another thread. An application can use [gst.element.Element.getState] to wait for the completion of the state change or it can wait for a [gst.types.MessageType.AsyncDone] or [gst.types.MessageType.StateChanged] on the bus.

State changes to [gst.types.State.Ready] or [gst.types.State.Null] never return #GST_STATE_CHANGE_ASYNC.

Parameters

statethe element's new #GstState.

Returns

Result of the state change using #GstStateChangeReturn.

MT safe.