summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Isorce <j.isorce@samsung.com>2016-10-19 15:39:54 +0100
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-10-19 19:45:08 +0200
commit84f7a3ec516155314c07ad6c7d45954d2cfd33da (patch)
tree39ea99aac232ac237ec6f5f6714ec1829ec719eb
parentfb95a798183c2a962383ec60bc3c33fbd92c7f17 (diff)
vaapivideomemory: add explanation about the call 'dup (dmabuf_fd)'
In short GstFdMemory is configured to call close when using GstDmabufMemory. https://bugzilla.gnome.org/show_bug.cgi?id=755072
-rw-r--r--gst/vaapi/gstvaapivideomemory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index 3b2b4d82..75451499 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -825,6 +825,9 @@ gst_vaapi_dmabuf_memory_new (GstAllocator * allocator, GstVaapiVideoMeta * meta)
gst_vaapi_video_meta_set_surface_proxy (meta, proxy);
gst_vaapi_surface_proxy_unref (proxy);
+ /* Need dup because GstDmabufMemory creates the GstFdMemory with flag
+ * GST_FD_MEMORY_FLAG_NONE. So when being freed it calls close on the fd
+ * because GST_FD_MEMORY_FLAG_DONT_CLOSE is not set. */
dmabuf_fd = gst_vaapi_buffer_proxy_get_handle (dmabuf_proxy);
if (dmabuf_fd < 0 || (dmabuf_fd = dup (dmabuf_fd)) < 0)
goto error_create_dmabuf_handle;