summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSong Bing <b06498@freescale.com>2014-12-16 12:10:53 +0100
committerWim Taymans <wtaymans@redhat.com>2014-12-16 12:29:49 +0100
commitf81af1d922b62dbd81b7676b8540ea8ab271491c (patch)
treea222f0f43480ad63e2b89fb9742e04a5feea4c77
parent899461d722e45f591eeddf33c405677170d63de4 (diff)
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
-rw-r--r--gst-libs/gst/video/gstvideopool.c7
-rw-r--r--sys/ximage/ximagepool.c7
-rw-r--r--sys/xvimage/xvimagepool.c7
3 files changed, 18 insertions, 3 deletions
diff --git a/gst-libs/gst/video/gstvideopool.c b/gst-libs/gst/video/gstvideopool.c
index 4475f45a4..546a46524 100644
--- a/gst-libs/gst/video/gstvideopool.c
+++ b/gst-libs/gst/video/gstvideopool.c
@@ -122,11 +122,13 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
GstVideoBufferPoolPrivate *priv = vpool->priv;
GstVideoInfo info;
GstCaps *caps;
+ guint size, min_buffers, max_buffers;
gint width, height;
GstAllocator *allocator;
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;
if (caps == NULL)
@@ -170,6 +172,9 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
}
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);
/* ERRORS */
diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c
index 6cc2cfab5..b9c8340e5 100644
--- a/sys/ximage/ximagepool.c
+++ b/sys/ximage/ximagepool.c
@@ -559,8 +559,10 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
GstXImageBufferPoolPrivate *priv = xpool->priv;
GstVideoInfo info;
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;
if (caps == NULL)
@@ -613,6 +615,9 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
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);
/* ERRORS */
diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c
index 244a51ad2..db434fc98 100644
--- a/sys/xvimage/xvimagepool.c
+++ b/sys/xvimage/xvimagepool.c
@@ -80,9 +80,11 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
GstXvImageBufferPoolPrivate *priv = xvpool->priv;
GstVideoInfo info;
GstCaps *caps;
+ guint size, min_buffers, max_buffers;
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;
if (caps == NULL)
@@ -144,6 +146,9 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
priv->crop.w = priv->info.width;
priv->crop.h = priv->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);
/* ERRORS */