Skip to content

Commit 46a673d

Browse files
committed
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.
1 parent caaed62 commit 46a673d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

gst-libs/gst/vaapi/gstvaapisurface_drm.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,20 @@ gst_vaapi_surface_get_drm_buf_handle (GstVaapiSurface * surface, guint type)
3636
if (!image)
3737
goto error_derive_image;
3838

39+
if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF)
40+
proxy =
41+
gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
42+
image->internal_image.buf, type, NULL, NULL);
43+
else
3944
proxy =
4045
gst_vaapi_buffer_proxy_new_from_object (GST_VAAPI_OBJECT (surface),
4146
image->internal_image.buf, type, gst_vaapi_object_unref, image);
4247
if (!proxy)
4348
goto error_alloc_export_buffer;
49+
50+
if (type == GST_VAAPI_BUFFER_MEMORY_TYPE_DMA_BUF)
51+
gst_vaapi_object_unref (image);
52+
4453
return proxy;
4554

4655
/* ERRORS */

0 commit comments

Comments
 (0)