gstreamer 中的哪个状态表示管道正常工作?
Which state in gstreamer indicates that the pipeline is working correctly?
关于Gstream状态变化,我们应该在管道正常工作时发送一个事件(Stream OK),当出现错误时我们应该发送另一个事件(Stream Error)。
通过消息回调捕获错误是有效的,但我们不知道哪个状态表明整个管道工作正常(从 src 到同步)。
GStreamer 中没有特定的错误状态(GStreamer states 是:NULL、READY、PAUSED、PLAYING (*))。因此,您需要观察并检查是否发生任何错误。您至少应该检查:
- return value of the function for changing the state (
gst_element_set_state
)
- 如果有任何错误消息发送到总线:
Errors can be received by listening to the GstBus of the
element/pipeline for GstMessage objects with the type
GST_MESSAGE_ERROR or GST_MESSAGE_WARNING. The thrown errors should be
inspected, and filtered if appropriate.
(*) 注意:实际上,完整的 list of states in the API includes also a pending state that may be relevant in some cases (see e.g. How to resume playing after paused using gstreamer?)
关于Gstream状态变化,我们应该在管道正常工作时发送一个事件(Stream OK),当出现错误时我们应该发送另一个事件(Stream Error)。
通过消息回调捕获错误是有效的,但我们不知道哪个状态表明整个管道工作正常(从 src 到同步)。
GStreamer 中没有特定的错误状态(GStreamer states 是:NULL、READY、PAUSED、PLAYING (*))。因此,您需要观察并检查是否发生任何错误。您至少应该检查:
- return value of the function for changing the state (
gst_element_set_state
) - 如果有任何错误消息发送到总线:
Errors can be received by listening to the GstBus of the element/pipeline for GstMessage objects with the type GST_MESSAGE_ERROR or GST_MESSAGE_WARNING. The thrown errors should be inspected, and filtered if appropriate.
(*) 注意:实际上,完整的 list of states in the API includes also a pending state that may be relevant in some cases (see e.g. How to resume playing after paused using gstreamer?)