One video sink with multiple sink pads

Sebastian Dröge sebastian at centricular.com
Sat Mar 8 05:55:36 PST 2014


On Sa, 2014-03-08 at 10:42 +0100, Carlos Rafael Giani wrote:
> Hello,
> 
> I wonder if a video sink with multiple sink pads is feasible. All sinks 
> I have seen so far use only one sink pad.
> Could multiple sink pads in theory lead to problems? I am thinking of 
> all the efforts for prerolling, asynchronous state changes and so on.

There's not really a problem with a sink that has multiple sinkpads,
just that GstBaseSink does not support more than one sinkpad :)

You'll have to replicate all the async state change and preroll logic in
your sink, but based on the GstBaseSink code this shouldn't be too
difficult.

> I was thinking of using a GPU here for effects like picture-in-picture. 
> An alternative of course is to compose the various input frames into one 
> output frame in a transform element which uses the GPU.
> However, the problems with this approach are: (1) requires either an 
> offscreen context (may be buggy with some drivers) or a small window 
> somewhere where this is rendered,  (2) additional effort required by the 
> GPU, since the compositing would not directly go to the output 
> framebuffer, but to an offscreen one instead, which is why I thought of 
> putting this into the sink directly, to not waste MIPS.

You could take a look at gst-plugins-gl and how things are done there.
Or you could write a "yourgpumixer" element that only takes the
different input frames but does not mix them, and instead puts them all
into one GstBuffer with a GstMeta that describes the mixing operation
that should happen... and inside your sink you then get a single input
stream and can do the actual mixing.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- 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: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140308/3a7cfc9e/attachment.pgp>


More information about the gstreamer-devel mailing list