代码之家  ›  专栏  ›  技术社区  ›  DarenW

如何在运行时更改GStreamer管道的拓扑?

  •  0
  • DarenW  · 技术社区  · 8 年前

    我有一个GStreamer管道,它的拓扑结构有时会改变。我们所做的是:

    gst_element_set_state(pipeline, GST_STATE_READY);
    gst_element_unlink(node1, tee);
    gst_element_link(node1, oldfilm);
    gst_element_link(oldfilm, tee);
    gst_element_set_state(pipeline, GST_STATE_PLAYING);
    

    我们假设在重新连接元素时必须停止管道。问题:我们的应用程序挂起,通常在我们更改拓扑后的前几次视频流停止,然后对gst\u element\u set\u state(pipeline,gst\u state\u PLAYING)的下一次调用永远不会返回。应用程序仍然响应^C,这当然会杀死它。

    我们的结论是,我们做得不对。在应用程序运行时,改变管道拓扑的正确方法是什么?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Florian Zwoch    8 年前

    早在2016年的GStreamer会议上,我就听到了一个关于这个话题的演讲,在这种情况下,这个话题非常有用。

    幻灯片: https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2016/Jose%20A.%20Santos%20-%20How%20to%20work%20with%20dynamic%20pipelines%20using%20GStreamer.pdf

    谈话: https://gstconf.ubicast.tv/videos/how-to-work-dynamic-pipelines/

    我希望这可以解释如何处理这些类型的问题。