From 7e90ae4c2e0962376d2c256e6c226e98915cab0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Thu, 20 Oct 2016 16:31:21 +0200 Subject: [PATCH] vaapivideomemory: error log is derive image fails Instead of a silently failure of the derive image, this patch log an error message according to the failure. --- gst/vaapi/gstvaapivideomemory.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 0f63a3c05a..b0d6fd13b5 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -692,12 +692,12 @@ allocator_configure_surface_info (GstVaapiDisplay * display, surface = new_surface (display, vinfo); if (!surface) - goto bail; + goto error_no_surface; image = gst_vaapi_surface_derive_image (surface); if (!image) - goto bail; + goto error_no_derive_image; if (!gst_vaapi_image_map (image)) - goto bail; + goto error_cannot_map; updated = gst_video_info_update_from_image (&allocator->surface_info, image); @@ -711,10 +711,28 @@ allocator_configure_surface_info (GstVaapiDisplay * display, gst_vaapi_image_unmap (image); bail: - if (surface) - gst_vaapi_object_unref (surface); if (image) gst_vaapi_object_unref (image); + if (surface) + gst_vaapi_object_unref (surface); + return; + +error_no_surface: + { + GST_ERROR_OBJECT (allocator, "Cannot create a VA Surface"); + return; + } +error_no_derive_image: + { + GST_ERROR_OBJECT (allocator, + "Cannot create a derived image from surface %p", surface); + goto bail; + } +error_cannot_map: + { + GST_ERROR_OBJECT (allocator, "Cannot map VA derived image %p", image); + goto bail; + } } static inline void