From faebca3383b49275b64b6b11b0e0884741ad8858 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 24 Oct 2016 20:09:59 +0200 Subject: [PATCH] plugins: move src allocator error to instantiator Just as we did in ensure_sinkpad_allocator(), let's move the error message into the ensure_srcpad_allocator() from the caller, gst_vaapi_plugin_base_decide_allocation() --- gst/vaapi/gstvaapipluginbase.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 4222680..70ebb3b 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -576,7 +576,16 @@ ensure_srcpad_allocator (GstVaapiPluginBase * plugin, GstVideoInfo * vinfo) plugin->srcpad_allocator = gst_vaapi_video_allocator_new (plugin->display, vinfo, 0, GST_VAAPI_IMAGE_USAGE_FLAG_NATIVE_FORMATS); - return plugin->srcpad_allocator != NULL; + if (!plugin->srcpad_allocator) + goto error_create_allocator; + return TRUE; + + /* ERRORS */ +error_create_allocator: + { + GST_ERROR_OBJECT (plugin, "failed to create src pad's allocator"); + return FALSE; + } } /** @@ -884,13 +893,13 @@ gst_vaapi_plugin_base_decide_allocation (GstVaapiPluginBase * plugin, if (!pool) { if (!ensure_srcpad_allocator (plugin, &vi)) - goto error_create_allocator; + goto error; /* Update video size with allocator's image size */ gst_allocator_get_vaapi_image_size (plugin->srcpad_allocator, &size); pool = gst_vaapi_plugin_base_create_pool (plugin, caps, size, min, max, pool_options, plugin->srcpad_allocator); if (!pool) - goto error_create_pool; + goto error; } if (update_pool) @@ -919,12 +928,7 @@ error_ensure_display: plugin->display_type_req); return FALSE; } -error_create_allocator: - { - GST_ERROR_OBJECT (plugin, "failed to create allocator"); - return FALSE; - } -error_create_pool: +error: { /* error message already sent */ return FALSE; -- 2.7.4