如何从GStreamer中的应用程序获取事件?

时间:2021-02-20 17:21:38

I send an event to a pipeline:

我将事件发送到管道:

GstElement* pipeline = gst_pipeline_new();
GstEvent*  event = gst_event_new_eos();
gst_element_send_event(pipeline, event);

How to pipeline get (handle) eos event which send. Thank so much!

如何管道获取(处理)发送的eos事件。感谢这么多!

2 个解决方案

#1


0  

You will need to listen to GstMessage on GstBus (gst_pipeline_get_bus). There is an GST_MESSAGE_EOS that will be emitted when the streaming reached the end.

您将需要监听GstBus上的GstMessage (gst_pipeline ine_get_bus)。有一个GST_MESSAGE_EOS,将在流到达末尾时发出。

#2


0  

If you just write a application, you should not care the event handle process, because the plug-in or base element library will do the gst_pad_set_event_function() operation, and the event handle function will handle the event you sent(GST_EVENT_EOS or others).

如果您只是编写一个应用程序,您不应该关心事件句柄过程,因为插件或基本元素库将执行gst_pad_set_event_function()操作,事件句柄函数将处理您发送的事件(GST_EVENT_EOS或其他)。

In the GStreamer source code, you can see that an event send to the element(pipeline) will push(by calling the gst_pad_push_event()) to a pad(src or sink, depending on GST_EVENT_IS_DOWNSTREAM(event)'s return value), then the pad judge if the event is its, if not, send if to the peer pad.

在GStreamer源代码中,您可以看到发送到元素(管道)的事件将推(通过调用gst_pad_push_event())到pad(src或sink,取决于gst_event_is_logistics (event)的返回值),然后pad判断事件是否为事件,如果不是,则发送到对等pad。

Is this helpful to u?

这对你有帮助吗?

#1


0  

You will need to listen to GstMessage on GstBus (gst_pipeline_get_bus). There is an GST_MESSAGE_EOS that will be emitted when the streaming reached the end.

您将需要监听GstBus上的GstMessage (gst_pipeline ine_get_bus)。有一个GST_MESSAGE_EOS,将在流到达末尾时发出。

#2


0  

If you just write a application, you should not care the event handle process, because the plug-in or base element library will do the gst_pad_set_event_function() operation, and the event handle function will handle the event you sent(GST_EVENT_EOS or others).

如果您只是编写一个应用程序,您不应该关心事件句柄过程,因为插件或基本元素库将执行gst_pad_set_event_function()操作,事件句柄函数将处理您发送的事件(GST_EVENT_EOS或其他)。

In the GStreamer source code, you can see that an event send to the element(pipeline) will push(by calling the gst_pad_push_event()) to a pad(src or sink, depending on GST_EVENT_IS_DOWNSTREAM(event)'s return value), then the pad judge if the event is its, if not, send if to the peer pad.

在GStreamer源代码中,您可以看到发送到元素(管道)的事件将推(通过调用gst_pad_push_event())到pad(src或sink,取决于gst_event_is_logistics (event)的返回值),然后pad判断事件是否为事件,如果不是,则发送到对等pad。

Is this helpful to u?

这对你有帮助吗?