va: pool: ignore size in config

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1667>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-10-04 11:14:38 +02:00
parent 75dc98cc08
commit e73b866fe0

View file

@ -74,10 +74,10 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config)
GstVideoAlignment video_align = { 0, }; GstVideoAlignment video_align = { 0, };
GstVideoInfo caps_info, alloc_info; GstVideoInfo caps_info, alloc_info;
gint width, height; gint width, height;
guint size, min_buffers, max_buffers; guint min_buffers, max_buffers;
guint32 usage_hint; guint32 usage_hint;
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, if (!gst_buffer_pool_config_get_params (config, &caps, NULL, &min_buffers,
&max_buffers)) &max_buffers))
goto wrong_config; goto wrong_config;
@ -87,9 +87,6 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config)
if (!gst_video_info_from_caps (&caps_info, caps)) if (!gst_video_info_from_caps (&caps_info, caps))
goto wrong_caps; goto wrong_caps;
if (size < GST_VIDEO_INFO_SIZE (&caps_info))
goto wrong_size;
if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL)) if (!gst_buffer_pool_config_get_allocator (config, &allocator, NULL))
goto wrong_config; goto wrong_config;
@ -103,8 +100,7 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config)
width = GST_VIDEO_INFO_WIDTH (&caps_info); width = GST_VIDEO_INFO_WIDTH (&caps_info);
height = GST_VIDEO_INFO_HEIGHT (&caps_info); height = GST_VIDEO_INFO_HEIGHT (&caps_info);
GST_LOG_OBJECT (vpool, "%dx%d - %u | caps %" GST_PTR_FORMAT, width, height, GST_LOG_OBJECT (vpool, "%dx%d | %" GST_PTR_FORMAT, width, height, caps);
size, caps);
gst_object_replace ((GstObject **) & vpool->allocator, gst_object_replace ((GstObject **) & vpool->allocator,
GST_OBJECT (allocator)); GST_OBJECT (allocator));
@ -130,9 +126,6 @@ gst_va_pool_set_config (GstBufferPool * pool, GstStructure * config)
gst_buffer_pool_config_set_video_alignment (config, &video_align); gst_buffer_pool_config_set_video_alignment (config, &video_align);
} }
GST_VIDEO_INFO_SIZE (&caps_info) =
MAX (size, GST_VIDEO_INFO_SIZE (&caps_info));
alloc_info = caps_info; alloc_info = caps_info;
GST_VIDEO_INFO_WIDTH (&alloc_info) = width; GST_VIDEO_INFO_WIDTH (&alloc_info) = width;
GST_VIDEO_INFO_HEIGHT (&alloc_info) = height; GST_VIDEO_INFO_HEIGHT (&alloc_info) = height;
@ -167,13 +160,6 @@ wrong_caps:
"failed getting geometry from caps %" GST_PTR_FORMAT, caps); "failed getting geometry from caps %" GST_PTR_FORMAT, caps);
return FALSE; return FALSE;
} }
wrong_size:
{
GST_WARNING_OBJECT (vpool,
"Provided size is to small for the caps: %u < %" G_GSIZE_FORMAT, size,
GST_VIDEO_INFO_SIZE (&caps_info));
return FALSE;
}
failed_to_align: failed_to_align:
{ {
GST_WARNING_OBJECT (pool, "Failed to align"); GST_WARNING_OBJECT (pool, "Failed to align");