mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 05:46:13 +00:00
videopool: update buffer size after video alignment
Update the new buffer size after alignment in the pool configuration before calling the parent set_config. This ensures that the parent knows about the buffer size that we will allocate and makes the size check work in the release_buffer method. Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741420
This commit is contained in:
parent
0b7537f93b
commit
8baf1ec500
3 changed files with 18 additions and 3 deletions
|
@ -122,11 +122,13 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
GstVideoBufferPoolPrivate *priv = vpool->priv;
|
GstVideoBufferPoolPrivate *priv = vpool->priv;
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
guint size, min_buffers, max_buffers;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
GstAllocator *allocator;
|
GstAllocator *allocator;
|
||||||
GstAllocationParams params;
|
GstAllocationParams params;
|
||||||
|
|
||||||
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
|
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
|
||||||
|
&max_buffers))
|
||||||
goto wrong_config;
|
goto wrong_config;
|
||||||
|
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
|
@ -170,6 +172,9 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
}
|
}
|
||||||
priv->info = info;
|
priv->info = info;
|
||||||
|
|
||||||
|
gst_buffer_pool_config_set_params (config, caps, info.size, min_buffers,
|
||||||
|
max_buffers);
|
||||||
|
|
||||||
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
|
@ -542,8 +542,10 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
GstXImageBufferPool *xpool = GST_XIMAGE_BUFFER_POOL_CAST (pool);
|
GstXImageBufferPool *xpool = GST_XIMAGE_BUFFER_POOL_CAST (pool);
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
guint size, min_buffers, max_buffers;
|
||||||
|
|
||||||
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
|
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
|
||||||
|
&max_buffers))
|
||||||
goto wrong_config;
|
goto wrong_config;
|
||||||
|
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
|
@ -596,6 +598,9 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
|
|
||||||
xpool->info = info;
|
xpool->info = info;
|
||||||
|
|
||||||
|
gst_buffer_pool_config_set_params (config, caps, info.size, min_buffers,
|
||||||
|
max_buffers);
|
||||||
|
|
||||||
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
|
@ -60,9 +60,11 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
GstXvImageBufferPool *xvpool = GST_XVIMAGE_BUFFER_POOL_CAST (pool);
|
GstXvImageBufferPool *xvpool = GST_XVIMAGE_BUFFER_POOL_CAST (pool);
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
GstCaps *caps;
|
GstCaps *caps;
|
||||||
|
guint size, min_buffers, max_buffers;
|
||||||
GstXvContext *context;
|
GstXvContext *context;
|
||||||
|
|
||||||
if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL))
|
if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
|
||||||
|
&max_buffers))
|
||||||
goto wrong_config;
|
goto wrong_config;
|
||||||
|
|
||||||
if (caps == NULL)
|
if (caps == NULL)
|
||||||
|
@ -124,6 +126,9 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
|
||||||
xvpool->crop.w = xvpool->info.width;
|
xvpool->crop.w = xvpool->info.width;
|
||||||
xvpool->crop.h = xvpool->info.height;
|
xvpool->crop.h = xvpool->info.height;
|
||||||
|
|
||||||
|
gst_buffer_pool_config_set_params (config, caps, info.size, min_buffers,
|
||||||
|
max_buffers);
|
||||||
|
|
||||||
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
return GST_BUFFER_POOL_CLASS (parent_class)->set_config (pool, config);
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
|
|
Loading…
Reference in a new issue