videobufferpool: don't reset surface when created internally
authorHe Junyan <junyan.he@hotmail.com>
Sat, 15 Feb 2020 17:25:37 +0000 (01:25 +0800)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 21 Feb 2020 15:52:43 +0000 (15:52 +0000)
commit15e169fbf1d7ea57a122ec0bdbd38d51ba61284f
tree7f8d19a17d3fdaf2fc0506700874e3efbe2ccecc
parent57e792136c0036e39bcf69011324cf05642b6641
videobufferpool: don't reset surface when created internally

The bug fixing, in commit 89f202ea, just considers the case when
surface's DMABuf is set through gst_buffer_pool_acquire_buffer(),
which is typically a decoder's behavior. But vaapipostproc doesn't
provide any surface when calling gst_buffer_pool_acquire_buffer(),
thus a surface is created when GstMemory is allocated.

If the surface proxy in buffer's meta is reset at
buffer_pool_reset_buffer(), that surface will be destroyed and it
won't be available anymore. But GstBuffers are cached in the buffer
pool and they are reused again, hence only those images are rendered
repeatedly.

Fixes: #232
gst/vaapi/gstvaapivideobufferpool.c
gst/vaapi/gstvaapivideomemory.c
gst/vaapi/gstvaapivideomemory.h