vaapivideomemory: release proxy's data if downstream

The surface created for downstream is going to be filled by VAAPI
elements. So, the driver needs write access on that surface.

This patch releases the derived image held by the proxy, thus the
surface is unmarked as busy.

This is how it has to be done as discussed on libva mailing list.

https://bugzilla.gnome.org/show_bug.cgi?id=755072
This commit is contained in:
Julien Isorce 2016-10-19 15:37:04 +01:00 committed by Víctor Manuel Jáquez Leal
parent 69a2406a20
commit 33af1fc578

View file

@ -992,6 +992,14 @@ gst_vaapi_dmabuf_memory_new (GstAllocator * base_allocator,
gst_mini_object_set_qdata (GST_MINI_OBJECT_CAST (mem),
GST_VAAPI_BUFFER_PROXY_QUARK, dmabuf_proxy,
(GDestroyNotify) gst_vaapi_buffer_proxy_unref);
/* When a VA surface is going to be filled by a VAAPI element
* (decoder or VPP), it has _not_ be marked as busy in the driver.
* Releasing the surface's derived image, held by the buffer proxy,
* the surface will be unmarked as busy. */
if (allocator->direction == GST_PAD_SRC)
gst_vaapi_buffer_proxy_release_data (dmabuf_proxy);
return mem;
/* ERRORS */