确保gstreamer接收器元素中的EOS

问题描述 投票:0回答:1

BLUF:我需要知道接收器元素何时完成处理 EOS 信号。

我有一个动态管道,视频数据流到 T 型连接器,T 型连接器将视频扇出到不同的文件。 我附加到 T 恤上的部件可以随时创建,也可以随时停止。 在正常情况下,当我处理完 Tee 的特定分支时,我想停止数据流入该分支,向其中发送 EOS,一旦该分支上的所有数据都已处理完毕,就断开所有分支的连接从 T 恤中取出这些部分,将元素状态设置为 NULL,并执行其他垃圾收集任务。

文档给出了正在运行的管道中热交换元素的示例;特别是,步骤 4 描述了如何确保您要交换的元素已完成所有数据的处理:

4a) 在 element2 src 上填充事件探针

4b) 将 EOS 发送到 element2,这确保 element2 刷新它所保存的最后一位数据。

4c) 等待 EOS 出现在探针中,放下 EOS

接收器元素没有 src 焊盘,我可以将其附加到并等待 EOS 发出完成信号。

如何确定水槽何时完成?

gstreamer python-gstreamer
1个回答
0
投票

如果您在管道中设置

message-forward=true
,接收器将在接收并处理 EOS 时向总线发布消息。这将被包装在 GST_MESSAGE_ELEMENT 而不是 GST_MESSAGE_EOS 中,因为只有当所有接收器都收到 EOS 时,后者才会被发布。

以下是文档:

https://gstreamer.freedesktop.org/documentation/gstreamer/gstbin.html?gi-language=c#GstBin:message-forward

相关部分:

message-forward 

“message-forward” gboolean
Forward all children messages, even those that would normally be filtered by the bin. This can be interesting when one wants to be notified of the EOS state of individual elements, for example.

The messages are converted to an ELEMENT message with the bin as the source. The structure of the message is named GstBinForwarded and contains a field named message that contains the original forwarded GstMessage.
© www.soinside.com 2019 - 2024. All rights reserved.