a question regarding pipeline design: single vs. multiple bins

Sebastian Dröge sebastian at centricular.com
Wed Feb 17 07:25:25 UTC 2016


On Di, 2016-02-16 at 13:51 -0800, Andres Gonzalez wrote:
> Hi,
> 
> The design of this example pipeline is different from most other available
> examples and is very interesting because it uses several bins instead of the
> usual single pipeline/bin approach:
> 
> https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp/server-rtpaux.c

It's actually the recommended approach to divide your pipeline into
separate, reusable bins that each represent a logical component instead
of having a single pipeline with a lot of plain elements.

It also makes your life easier usually as you only have to handle a
single bin instead of multiple elements in many cases.

> This example uses one top-level bin, a pipeline created using
> gst_pipeline_new(), then in addition, several more bins are created using
> gst_bin_new(). So the video and audio paths are each in their own separate
> bin. This appears to me to be a nice approach because it obviously
> partitions the video path separate from the audio path all within the outter
> bin/pipeline. 
> 
> Question: Using this multiple bin design, are there any additional
> considerations that must be addressed that are different from those needed
> for a single bin design?   That is, as long as all of the pads are linked
> correctly, is that sufficient when using a multiple bin design?

It's working the same as with separate elements. Only thing you need to
ensure is that all pads of internal elements that should be available
to the outside of the bin must be added as ghostpads to the bin.

> Question: Given the exact same media elements, in the same link order, does
> an additional bin containing the video/audio elements for example, cause a
> performance difference between that of not using an additional/separate bin
> to contain all the video/audio elements?  

Yes it causes a very minimal performance difference as there's another
pad that has to be passed, and during state changes another element
(the bin) has to be traversed. You won't notice this except in
artificial benchmarks.

> The reason I am asking, is that I am having problems using this multiple bin
> design and I want to make sure I am not missing some other higher-level
> consideration that is different from the typical single bin design approach.

Which problems?

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160217/a16c46ca/attachment.sig>


More information about the gstreamer-devel mailing list