va: allocator: Implement mem_copy for VA memory.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sat, 3 Apr 2021 12:16:22 +0000 (14:16 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 8 Apr 2021 16:34:06 +0000 (16:34 +0000)
commit07a0b6347208914f6b1ebf7e09bc54587dd6d49a
treebd70f796b2c32a626141542e6bcc888aa080e6af
parent57d8de68d107faddedc76306c97d1fb03cbcb709
va: allocator: Implement mem_copy for VA memory.

Implementation of mem_copy() virtual method for GstVaAllocator.

It's a deep copy where a new VA memory is popped out from the pool or,
if pool is empty, a new memory is allocated. The original memory is
mapped to read, and if its VAImage is not derived and size to copy is
the whole surface, the mapped VAImage of the original memory is put in
the new memory. Otherwise a slow memcpy is done between both memories.

Fixes: #1568
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2136>
sys/va/gstvaallocator.c