vaapivideobufferpool: check for vaapi meta first

If the configured meta doesn't request vaapi meta then it is not a
vaapi buffer pool. Bail out as soon as possible.
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-01-29 11:54:38 +01:00
parent ed505f5ed4
commit 377dd0cc6c

View file

@ -154,6 +154,10 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
if (!gst_video_info_from_caps (&new_allocation_vinfo, caps))
goto error_invalid_caps;
if (!gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META))
goto error_no_vaapi_video_meta_option;
allocator = NULL;
if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL))
goto error_invalid_allocator;
@ -198,10 +202,6 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
}
}
if (!gst_buffer_pool_config_has_option (config,
GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META))
goto error_no_vaapi_video_meta_option;
/* create a new allocator if needed */
if (!allocator) {
if (priv->use_dmabuf_memory) {