Best way to throw away unwanted data in a plugin element

Tim Müller tim at
Tue Apr 29 08:23:11 PDT 2014

On Tue, 2014-04-29 at 08:08 -0700, MartinK wrote:

Hi Martin,

> My element is processing a file in push mode. The first buffer it
> handles contains a header block which contains the offset to the data
> to be sent downstream. The offset is not known in advance and may
> point to data beyond the first n buffers. Is it possible to throw away
> the first n buffers without gstreamer (0.10) aborting the pipeline? 

Sure: when you receive a buffer in your chain function that you want to
throw away, just gst_buffer_unref() it and return GST_FLOW_OK from the
chain function to get the next buffer. Repeat until you get a buffer you
want to push out.


Tim Müller, Centricular Ltd -

More information about the gstreamer-devel mailing list