[gst-devel] how to use hardware buffer in the pipeline

Will Newton will.newton at gmail.com
Thu Jun 7 10:53:16 CEST 2007


On 6/7/07, zhangfei gao <gaozhangfei at yahoo.com.cn> wrote:
> Hi,
>
> gstreamer has provided a method allowed using hardware buffer, I feel
> confused how to use this feature.
>
> 1. GstBaseSink provides an overridable ::buffer_alloc function to be
> overwitten, but I could not find the free buffer function.

As I understand it you create a new buffer class that provides a
finalize method that can free it's memory when the refcount reaches 0.
e.g. see xvimagesink.

In my experience it doesn't actually work though! I implemented my
buffer_alloc function but it is not used by other elements of my
pipeline (they use the standard malloc based buffer_alloc). I'm just
doing audio so memory bandwidth is not such an issue for me so I
haven't tried to find a proper solution.

> option 2: encoder and overlay2sink provide the hardware buffer, then there
> will be a problem. Since I use tee element, which buffer is really used by
> camerasrc, from overlay2sink or from encoder ,is there any conflict.

You can define a custom buffer copy function, perhaps you could do
something in there.




More information about the gstreamer-devel mailing list