GstInterpipe - Event Forwarding

From RidgeRun Developer Wiki




Previous: Caps Negotiation Index Next: Timestamp Synchronization




This page contains a detailed description of the GstInterpipe Event Forwarding feature.

Introduction

As with buffers, events can be transferred from the nodes to the listeners (and vice-versa). GStreamer handles three types of events:

  • Upstream Events: events that travel contrary to the buffer flow
  • Downstream Out-Of-Bounds Events: events traveling in the same direction as the buffer flow, but sent immediately.
  • Downstream In-Bounds Events: events traveling in the same direction as the buffer flow, but sent serialized with the buffers.

GstInterpipe supports the three types of events, each one under different considerations. Additionally, the EOS is treated with special care, hence controlled by independent properties. The following sections describe these scenarios.

Upstream Events

Upstream events are sent from the listeners to the node. Upstream events are only transferred if the event emitter is the only listener connected to the node. This was designed this way in order to avoid changing the node state to the other listeners. The following image describes this situation:

Upstream events transfer

Downstream Out-Of-Bounds Events

Out-Of-Bounds downstream events are sent from the node to the listeners. These events are sent to all of the listeners as soon as they are received. By setting the forward-events, the node can be configured to avoid sending events. By setting the accept-events, individual listeners can be configured to avoid receiving events. The following tables summarize these properties:

Property
Element interpipesink
Name forward-events
Description Allow the interpipesink to forward any kind of events to the listeners
Special Values
Table 1. Interpipesink "forward-events" property description


Property
Element interpipesrc
Name accept-events
Description Accept events coming from the node
Special Values
Table 2. Interpipesrc "accept-events" property description

Graphically, the following figure shows different configuration examples.

Downstream out-of-bounds event transfer

Downstream In-Bounds Events

In-bound downstream events travel from the node to all the listeners. The main difference is that they travel inlined with the buffer flow. Internally, both the interpipesink and interpipesrc can queue buffers, so serial events are queued as well so that they are pushed at the precise moment they need to be sent. The same set of properties controls the transmission of these events.

Graphically, this can be appreciated as the following image:

Downstream in bounds event transfer

End-Of-Stream Events

EOS events are a special type of in-bounds downstream events. The same queuing principles apply to these. However, this event typically causes drastic pipeline consequences, to it is likely that a pipeline could want to receive all event types, but not the EOS. For this reason, the EOS transfer can be controlled by setting forward-eos to disable EOS transfer completely from the node, or accept-eos to selectively block the EOS in individual listeners. The following tables summarize the properties.

Property
Element interpipesink
Name forward-eos
Description Allow the interpipesink to forward EOS events to the listeners
Special Values
Table 3. Interpipesink "forward-eos" property description

Property
Element interpipesrc
Name accept-eos
Description Accept EOS events coming from the node
Special Values
Table 4. Interpipesrc "accept-eos" property description


Graphically, this can be appreciated as the following image:

Downstream EOS event transfer



Previous: Caps Negotiation Index Next: Timestamp Synchronization