gpt4 book ai didi

linux - gstreamer 中的哪个状态表示管道正常工作?

转载 作者:太空宇宙 更新时间:2023-11-04 10:21:08 25 4
gpt4 key购买 nike

关于 Gstream 状态变化,我们应该在管道正常工作时发送一个事件(Stream OK),当出现错误时我们应该发送另一个事件(Stream Error)。

通过消息回调捕获错误是可行的,但我们不知道哪个状态表明整个管道正在正常工作(从 src 到同步)。

最佳答案

GStreamer 中没有特定的错误状态(GStreamer states 是:NULL、READY、PAUSED、PLAYING (*))。因此,您需要观察并检查是否发生任何错误。您至少应该检查:

  • return value改变状态的函数(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还包括在某些情况下可能相关的 pending 状态(参见例如 How to resume playing after paused using gstreamer? )

关于linux - gstreamer 中的哪个状态表示管道正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43844600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com