From adcc6c8d383b3b4667e8efbe093e0f658b3a6683 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Wed, 31 Jul 2024 12:35:20 -0400 Subject: [PATCH] xv: imagepool: Improve error logging The shm creation function can return a GError, use this to improve the error reporting. Part-of: --- subprojects/gst-plugins-base/sys/xvimage/xvimagepool.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/sys/xvimage/xvimagepool.c b/subprojects/gst-plugins-base/sys/xvimage/xvimagepool.c index e1ee903f89..1da0ded7c2 100644 --- a/subprojects/gst-plugins-base/sys/xvimage/xvimagepool.c +++ b/subprojects/gst-plugins-base/sys/xvimage/xvimagepool.c @@ -62,6 +62,7 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) GstCaps *caps; guint size, min_buffers, max_buffers; GstXvContext *context; + GError *error = NULL; if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers)) @@ -134,10 +135,11 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) xvpool->pre_alloc_mem = gst_xvimage_allocator_alloc (xvpool->allocator, xvpool->im_format, &info, xvpool->padded_width, - xvpool->padded_height, &xvpool->crop, NULL); + xvpool->padded_height, &xvpool->crop, &error); if (!xvpool->pre_alloc_mem) { - GST_ERROR_OBJECT (pool, "couldn't allocate image"); + GST_ERROR_OBJECT (pool, "Couldn't allocate image: %s", error->message); + g_error_free (error); return FALSE; } else { gint i;