简体   繁体   English

gstreamer中的哪个状态指示管道正常工作?

[英]Which state in gstreamer indicates that the pipeline is working correctly?

Concerning Gstream state changes, we should send a event when the pipeline is working correctly (Stream OK) and when there is an error we should send another event (Stream Error). 关于Gstream状态更改,我们应该在管道正常工作时发送一个事件(Stream OK),而当发生错误时,我们应该发送另一个事件(Stream Error)。

Catching errors over the message callback works, but we don't know which state indicate that the full pipeline is working correctly (from src to sync). 在消息回调中捕获错误是可行的,但是我们不知道哪个状态指示整个管道正常工作(从src到sync)。

There is no specific error state in GStreamer ( GStreamer states are: NULL, READY, PAUSED, PLAYING (*)). GStreamer中没有特定的错误状态( GStreamer状态为:NULL,READY,PAUSED,PLAYING(*))。 Thus, you need to watch and check if any error occurs. 因此,您需要观察并检查是否发生任何错误。 You should check, at least: 您至少应检查以下内容:

  • the return value of the function for changing the state ( gst_element_set_state ) 用于更改状态的函数的返回值gst_element_set_state
  • if any error message is sent to the bus: 如果有任何错误消息发送到总线:

    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. 通过侦听类型为GST_MESSAGE_ERROR或GST_MESSAGE_WARNING的GstMessage对象的元素/管道的GstBus,可以接收到错误。 The thrown errors should be inspected, and filtered if appropriate. 应该检查抛出的错误,并在适当时进行过滤。

(*) Note: actually, the complete list of states in the API includes also a pending state that may be relevant in some cases (see eg How to resume playing after paused using gstreamer? ) (*)注意:实际上, API中的状态的完整列表还包括在某些情况下可能相关的挂起状态(请参阅例如,在使用gstreamer暂停后如何继续播放?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM