xv: imagepool: Improve error logging

The shm creation function can return a GError, use this to improve the error
reporting.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7285>
This commit is contained in:
Nicolas Dufresne 2024-07-31 12:35:20 -04:00 committed by GStreamer Marge Bot
parent ab70aa60e2
commit adcc6c8d38

View file

@ -62,6 +62,7 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
GstCaps *caps; GstCaps *caps;
guint size, min_buffers, max_buffers; guint size, min_buffers, max_buffers;
GstXvContext *context; GstXvContext *context;
GError *error = NULL;
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
&max_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->pre_alloc_mem = gst_xvimage_allocator_alloc (xvpool->allocator,
xvpool->im_format, &info, xvpool->padded_width, xvpool->im_format, &info, xvpool->padded_width,
xvpool->padded_height, &xvpool->crop, NULL); xvpool->padded_height, &xvpool->crop, &error);
if (!xvpool->pre_alloc_mem) { 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; return FALSE;
} else { } else {
gint i; gint i;