GstInterpipe - GstInterpipe Overview

From RidgeRun Developer Wiki




  Index Next: Features and Limitations




GstInterpipe is a RidgeRun GStreamer plug-in that allows pipeline buffers and events to flow between two or more independent pipelines. The plug-in consists of two elements:

  • interpipesink: Sink for internal pipeline buffers communication
  • interpipesrc: Source for internal pipeline buffers communication

The relation between both elements is that the interpipesink element collects buffers and events from an independent pipeline so that they can be received by other independent pipelines through the interpipesrc element. In other words, the interpipesrc element is a listener of the interpipesink element.

Generally speaking, the idea is that given a source pipeline:

v4l2src ! interpipesink name=video_src

Various independent sink pipelines may listen to it by:

interpipesrc listen-to=video_src ! xvimagesink
interpipesrc listen-to=video_src num-buffers=1 ! jpegenc ! filesink location=snapshot.jpeg 

The following picture represents the above pipelines interconnection using GstInterpipe:

Figure 1: Gstinterpipe simple pipeline diagram

The state of each pipeline is independent, each one can manage events on their own, and sink pipelines can be attached or detached at any moment.

GstInterpipe is intended to reduce a big complex pipeline system into smaller and simpler independent pipelines. So, you can view and handle those independent pipelines as different blocks that you can control independently (change its state or modify properties) and connect or disconnect them with other blocks at runtime. It allows you to have multiple source and sink pipelines in an application with the possibility of dynamically changing the source pipeline that a sink pipeline is listening. It is like having a set of different pipes that you can plug and unplug between them at runtime, so the system changes its behavior according to the pipe interconnection configuration.

The concept behind the GstInterpipes project is to simplify the construction of GStreamer applications, which often has the complexity of requiring dynamic pipelines. It transforms the construction process from low level pad probe manipulation to the higher level of setting an element's parameter value. Application developers don't get mired down in stalled pipelines due to one branch of a complex pipeline changing state.

For example, take a look at a complex pipeline:

Figure 2: Complex Single Pipeline

Use interpipe elements to replace select and tee elements.

The complex pipeline of figure 2 can be constructed into smaller, independent pipelines using interpipe elements as it is illustrated in figure 3:

Figure 3: Ten independent simple pipelines using Interpipes

This way the stream flow in a complex pipeline is reduced to simply setting the correct listeners in the interpipe elements thus removing the complexity of re-configuring pads or some other complex and error-prone logic.



  Index Next: Features and Limitations