vaapivideobufferpool: split caps validation

When validating the caps from bufferpool config, this patch distinguishes the
error from no caps received (NULL) from the invalid caps (cannot be converted
into GstVideoInfo structure).
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-05-23 22:30:04 +02:00
parent 1f5ba28bd0
commit 21b184284b

View file

@ -145,8 +145,10 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL)) if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
goto error_invalid_config; goto error_invalid_config;
if (!caps || !gst_video_info_from_caps (new_vip, caps)) if (!caps)
goto error_no_caps; goto error_no_caps;
if (!gst_video_info_from_caps (new_vip, caps))
goto error_invalid_caps;
use_dmabuf_memory = gst_buffer_pool_config_has_option (config, use_dmabuf_memory = gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_DMABUF_MEMORY); GST_BUFFER_POOL_OPTION_DMABUF_MEMORY);
@ -218,6 +220,11 @@ error_no_caps:
GST_ERROR_OBJECT (pool, "no valid caps in config"); GST_ERROR_OBJECT (pool, "no valid caps in config");
return FALSE; return FALSE;
} }
error_invalid_caps:
{
GST_ERROR_OBJECT (pool, "invalid caps %" GST_PTR_FORMAT, caps);
return FALSE;
}
error_create_allocator: error_create_allocator:
{ {
GST_ERROR_OBJECT (pool, "failed to create GstVaapiVideoAllocator object"); GST_ERROR_OBJECT (pool, "failed to create GstVaapiVideoAllocator object");