summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <j.isorce@samsung.com>2016-10-19 15:37:04 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2017-02-02 20:33:36 +0100
commit33af1fc5786a179a22ecb9c43021ddd24c382263 (patch)
tree120531284baa45459d55606d0f4b39a14387fdf7
parent69a2406a20335ce045c4c67a9ff98e2c96d143c9 (diff)
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
-rw-r--r--gst/vaapi/gstvaapivideomemory.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index ed1fdf75..ebb0065f 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -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 */