From 1dbcc8a0e199f2da6a0ab8e949f13341916128a3 Mon Sep 17 00:00:00 2001 From: Julien Isorce Date: Sun, 4 Oct 2015 23:44:16 +0100 Subject: [PATCH] gstvaapisurface_drm: release image when done Otherwise intel-vaapi-driver will fail to process the exported surface because it will find it is currently derived, so considered as busy. https://bugzilla.gnome.org/show_bug.cgi?id=755072 --- gst-libs/gst/vaapi/gstvaapisurface_drm.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst-libs/gst/vaapi/gstvaapisurface_drm.c b/gst-libs/gst/vaapi/gstvaapisurface_drm.c index 1a2ba20d28..426019a35a 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface_drm.c +++ b/gst-libs/gst/vaapi/gstvaapisurface_drm.c @@ -36,11 +36,20 @@ gst_vaapi_surface_get_drm_buf_handle (GstVaapiSurface * surface, guint type) if (!image) goto error_derive_image; + if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) + proxy = + gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface), + image->internal_image.buf, type, NULL, NULL); + else proxy = gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface), image->internal_image.buf, type, gst_vaapi_object_unref, image); if (!proxy) goto error_alloc_export_buffer; + + if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF) + gst_vaapi_object_unref (image); + return proxy; /* ERRORS */