From 2761e472af4817e4787ef06bc815bd2885be4d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 20 Oct 2016 19:31:58 +0200 Subject: [PATCH] vaapivideomemory: destroy derived image at unmap If the allocator was configured to use direct upload or rendering, the generated derived image created at mapping needs to be destroyed after unmapping, because, in order to process the surface, it should not be marked as "busy" by the driver. --- gst/vaapi/gstvaapivideomemory.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 453f1b4a24..69745ebb6d 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -325,6 +325,11 @@ gst_video_meta_unmap_vaapi_memory (GstVideoMeta * meta, guint plane, GST_VAAPI_VIDEO_MEMORY_FLAG_SET (mem, GST_VAAPI_VIDEO_MEMORY_FLAG_IMAGE_IS_CURRENT); } + + if (!use_native_formats (mem->usage_flag)) { + gst_vaapi_video_meta_set_image (mem->meta, NULL); + gst_vaapi_video_memory_reset_image (mem); + } } } return TRUE;