GstInterpipe: Difference between revisions

no edit summary
No edit summary
Line 2: Line 2:


== Overview ==
== Overview ==
GstInterpipe is a Gstreamer plug-in that allows communication between two independent pipelines. The plug-in consists of two elements:
GstInterpipe is a Gstreamer plug-in that allows communication between two or more independent pipelines. The plug-in consists of two elements:
* interpipesink
* interpipesink
* interpipesrc
* interpipesrc
Line 8: Line 8:
Generally speaking, the idea is that given a source pipeline:
Generally speaking, the idea is that given a source pipeline:
<pre style="background:#d6e4f1">
<pre style="background:#d6e4f1">
v4l2src ! interpipesink name=video_src
v4l2src ! interpipesink name=video_srcor
</pre>
</pre>


Line 17: Line 17:
</pre>  
</pre>  


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


The concept behind the Interpipes 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 setting an element's parameter value.  Application developers don't get mired down in stalled pipelines due to one branch of a complex pipeline changed state.
The concept behind the Interpipes 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 in a complex pipeline like the one in the figure 1:
For example, take a look in a complex pipeline:


[[File:Complex_pipeline.png|thumb|center|800px|Figure 1: Complex Pipeline]]
[[File:Complex_pipeline.png|thumb|center|800px|Figure 1: Complex Pipeline]]
Line 41: Line 41:
* Replace tee and selector elements allowing dynamic pipeline flow control with GStreamer Daemon
* Replace tee and selector elements allowing dynamic pipeline flow control with GStreamer Daemon


The principal features the plug-in exposes are the following. These ones are explained with further detail later.
The principle list of plug-in features include:


* '''Buffer transfer''' <br>Interpipesink will transfer automagically the buffers it receives to all the interpipesrcs that are currently listening to it.
* '''Buffer transfer''' <br>Interpipesink will transfer automagically the buffers it receives to all the interpipesrcs that are currently listening to it.  There is no data copy.


*'''Dynamic switching''' <br> Interpipesrc can switch the interpipesink they are listening to at any time just by setting the property to the new value. No need to worry about the pipeline's state, dangerous events like EOS, pad probes, valves, selectors, pad links, etc...
*'''Dynamic switching''' <br> Interpipesrc can switch the interpipesink they are listening to at any time just by setting the property to the new value. No need to worry about the pipeline's state, dangerous events like EOS, pad probes, valves, selectors, pad links, etc...
Line 49: Line 49:
*'''Caps negotiation''' <br> Even though interpipes break a big pipeline into smaller ones, the caps negotiation process takes into account all of them. This means that it is guaranteed that the negotiated caps will be supported by the source and all its listeners (or fail due to missing valid intersection).
*'''Caps negotiation''' <br> Even though interpipes break a big pipeline into smaller ones, the caps negotiation process takes into account all of them. This means that it is guaranteed that the negotiated caps will be supported by the source and all its listeners (or fail due to missing valid intersection).


*'''Event forwarding''' <br> Similar to buffers, events may be forwarded from the interpipesinks to the interpipesrcs, and viceversa. The project takes into account downstream and upstream events, as well as in-bounds and out-of-bands events.
*'''Event forwarding''' <br> Similar to buffers, events may be forwarded from the interpipesinks to the interpipesrcs, and vice versa. The project takes into account downstream and upstream events, as well as in-bounds and out-of-bands events.


*'''Timestamp synchronization''' <br> The base times of independent pipelines will likely be different. Given that a buffer will be transferred from one pipe to another, this may represent a problem in situations where synchronization is a must. GstInterpipe takes care of this situation by compensating the buffer's timestamps according to the pipeline's base time, ensuring appropriate synchronization.
*'''Timestamp synchronization''' <br> The base times of independent pipelines will likely be different. Given that a buffer will be transferred from one pipe to another, this may represent a problem in situations where synchronization is a must. GstInterpipe takes care of this situation by compensating the buffer's timestamps according to the pipeline's base time, ensuring appropriate synchronization.
Line 57: Line 57:
The current release exposes the following limitations and known bugs:
The current release exposes the following limitations and known bugs:


*'''Specialized clocks''' <br>At the time being, pipelines negotiate their clock independently. If a pipeline uses a special clock (i.e.: GstAudioSinkClock), the associated pipes (being independent) may negotiate different clocks, typically GstSystemClock. This could be a big problem if, for example, synchronization between streams is required. It is currently responsibility of the application to set the special clock in all the involved pipes by calling [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html#gst-pipeline-set-clock gst_pipeline_set_clock].
*'''Specialized clocks''' <br>For the time being, pipelines negotiate their clock independently. If a pipeline uses a special clock (i.e.: GstAudioSinkClock), the associated pipes (being independent) may negotiate different clocks, typically GstSystemClock. This could be a big problem if, for example, synchronization between streams is required. It is currently responsibility of the application to set the special clock in all the involved pipes by calling [https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstPipeline.html#gst-pipeline-set-clock gst_pipeline_set_clock].


= Getting the Software =
= Getting the Software =


GstInterpipe is an open source project and can be downloaded from GitHub. RidgeRun is trying to push the interpipes to the next gstreamer release and the link will be available soon. The project will be hosted at Github
GstInterpipe is an open source project. RidgeRun is actively pushing the interpipes to the next GStreamer release and the link will be available soon. The project is hosted at Github


  https://github.com/RidgeRun/gst-interpipe
  https://github.com/RidgeRun/gst-interpipe


Contact support@ridgerun.com for any question.
Contact support@ridgerun.com with any questions.


As with every open source project, there's an open invitation to provide feedback to the maintainers as bug reports, feature requests and even source code collaborations. The following table summarizes the recommended methods to collaborate with RidgeRun:
As with every open source project, there's an open invitation to provide feedback to the maintainers as bug reports, feature requests and source code collaborations. The following table summarizes the recommended methods to collaborate with RidgeRun:


{| class="wikitable"
{| class="wikitable"
Line 119: Line 119:


If you don't want to install the plugin in the default location, it may also be found by setting GST_PLUGIN_PATH to the library location. For example:
If you don't want to install the plugin in the default location, it may also be found by setting GST_PLUGIN_PATH to the library location. For example:
  GST_PLUGIN_PATH=/home/mgruner/gst-interpipe-1.0/gst/interpipe/.libs gst-inspect-1.0 interpipe
  GST_PLUGIN_PATH=$HOME/gst-interpipe-1.0/gst/interpipe/.libs gst-inspect-1.0 interpipe


=User Guide=
=User Guide=