From 21b184284bc4e9c6740457e74312c8eabdb28a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 23 May 2016 22:30:04 +0200 Subject: [PATCH] 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). --- gst/vaapi/gstvaapivideobufferpool.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c index 32d80834e4..fa8ded20c0 100644 --- a/gst/vaapi/gstvaapivideobufferpool.c +++ b/gst/vaapi/gstvaapivideobufferpool.c @@ -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)) goto error_invalid_config; - if (!caps || !gst_video_info_from_caps (new_vip, caps)) + if (!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, GST_BUFFER_POOL_OPTION_DMABUF_MEMORY); @@ -218,6 +220,11 @@ error_no_caps: GST_ERROR_OBJECT (pool, "no valid caps in config"); return FALSE; } +error_invalid_caps: + { + GST_ERROR_OBJECT (pool, "invalid caps %" GST_PTR_FORMAT, caps); + return FALSE; + } error_create_allocator: { GST_ERROR_OBJECT (pool, "failed to create GstVaapiVideoAllocator object");