mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +00:00
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()
This commit is contained in:
parent
02f16e82e9
commit
faebca3383
1 changed files with 13 additions and 9 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue