va: bufferpool: use release_buffer to clean the mem.
authorHe Junyan <junyan.he@intel.com>
Tue, 13 Oct 2020 07:28:24 +0000 (15:28 +0800)
committerHe Junyan <junyan.he@intel.com>
Thu, 15 Oct 2020 04:02:29 +0000 (12:02 +0800)
commit21f4c31a525bbca9cabe68b74ddf8d05e7925da5
tree5c2745a4039e32efb8238ae07103d84b90dce5e0
parent634eb1fc3866b7eee7956733477deec6e84aa94d
va: bufferpool: use release_buffer to clean the mem.

The current bufferpool wastes all pre-allocate buffers when the
buffer pool is actived.
The pool->priv->size is 0 for va buffer pool. And every time, the
reset_buffer() will clean all mem and make the buffer size 0, that
can cache the gst_buffer in the buffer pool.
But when the buffer pool is activing, the default_start() just
allocate the buffer and release_buffer() immediately, all the pre
allocated buffers and surfaces are destroyed because of
gst_buffer_get_size (buffer) != pool->priv->size.
We need to use release_buffer() to do the clean job at the pool
start time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1686>
sys/va/gstvapool.c