mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-25 19:21:06 +00:00
videopool: Choose the biggest buffer size
We should respect what has been negotiated.
This commit is contained in:
parent
c47004d3db
commit
c5824f1b43
1 changed files with 11 additions and 0 deletions
|
@ -138,6 +138,9 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
if (!gst_video_info_from_caps (&info, caps))
|
if (!gst_video_info_from_caps (&info, caps))
|
||||||
goto wrong_caps;
|
goto wrong_caps;
|
||||||
|
|
||||||
|
if (size < info.size)
|
||||||
|
goto wrong_size;
|
||||||
|
|
||||||
if (!gst_buffer_pool_config_get_allocator (config, &allocator, ¶ms))
|
if (!gst_buffer_pool_config_get_allocator (config, &allocator, ¶ms))
|
||||||
goto wrong_config;
|
goto wrong_config;
|
||||||
|
|
||||||
|
@ -172,6 +175,7 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
gst_buffer_pool_config_set_video_alignment (config, &priv->video_align);
|
gst_buffer_pool_config_set_video_alignment (config, &priv->video_align);
|
||||||
}
|
}
|
||||||
priv->info = info;
|
priv->info = info;
|
||||||
|
info.size = MAX (size, info.size);
|
||||||
|
|
||||||
gst_buffer_pool_config_set_params (config, caps, info.size, min_buffers,
|
gst_buffer_pool_config_set_params (config, caps, info.size, min_buffers,
|
||||||
max_buffers);
|
max_buffers);
|
||||||
|
@ -195,6 +199,13 @@ 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 (pool,
|
||||||
|
"Provided size is to small for the caps: %u", size);
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
|
|
Loading…
Reference in a new issue