Can I have two sinks using the same chain function?

Tim-Philipp Müller t.i.m at zen.co.uk
Sat May 19 04:12:13 PDT 2012


On Fri, 2012-05-18 at 11:34 -0700, iron_guitarist1987 wrote:

> Sorry to bombard you with so many questions, but what I want to do is an
> element that takes in a video in one sinkpad, and a stream of plain text
> strings from another sink pad. I would like to have two static always pads
> for this.

That's fine. The main problem with this kind of set up is to co-ordinate
both pads, buffers may arrive in no particular order on those pads, and
the buffer timestamps / durations usually don't align perfectly, so e.g.
one buffer on the text pad might "correspond to" to say 50 buffers on
the video pad, and next time to 25 buffers, etc.

> The question is, do I need to use GstCollectPads, GstBufferList, or can I
> just call the chain function with two buffers directly (and how to do it)? 

You don't have to use GstCollectPads(2). But I would recommend you do,
because it takes care of the co-ordination of the different pads for you
to some extent.

GstBufferList is for passing multiple buffers to the same pad in one go.
You probably don't need to use that (it's likely to just going to make
things more complicated). It's usually used in a context where a buffer
is split into multiple buffers with small headers prepended to the split
parts (e.g. in an RTP context).


> It's difficult when I can't find any other elements that does this. All I
> find are elements that have request pads and most don't even have chain
> functions. I swear that I'm gonna do some video tutorials about Gstreamer
> plugin development once I comprehend all this wizardry! 

GstTextOverlay does this, but has a lot of quite complicated custom code
to deal with seeking/flushing (which you may not need).

Other examples include muxers or deinterleave.

Cheers
 -Tim



More information about the gstreamer-devel mailing list