[gst-devel] How to implement a pull-based sink?

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Feb 4 17:06:00 CET 2010


On Thu, 2010-02-04 at 11:49 +0800, Hsu France wrote:

Hi,

> I'm a newbie for gstreamer and  working on a sink that I wish it would
> provide buffer for source. I think it would be a pull-based sink.
>  (...)
> I implemented this sink based on base-sink, and added the virtual
> function: buffer_alloc() (gst_my_sink_buffer_alloc) and render()
> (gst_my_sink_render). 

What kind of sink is this?

There's no need for the sink to operate in pull mode to be able to
provide buffers to upstream. It should be sufficient to implement a
buffer alloc function.

Take for example:

 $ GST_DEBUG=*src:5,*sink:5 videotestsrc num-buffers=2 ! ximagesink

This will operate in push mode, but videotestsrc will call
gst_pad_alloc_buffer() to get a buffer from ximagesink and then fill
that with data and push it back to ximagesink.

Pull mode for sinks is something that's not really used much in practice
and is rarely useful. Maybe you could provide some more details of what
you're trying to do?

 Cheers
  -Tim






More information about the gstreamer-devel mailing list