From bee3d7b6833d775990aa07a4c89198e78bbfab54 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 27 Mar 2012 12:44:02 +0200 Subject: [PATCH] update for get_param changes Remove the const from the GstCaps. Fix some GstStructure leaks. --- gst-libs/gst/video/gstvideopool.c | 2 +- sys/ximage/ximagepool.c | 2 +- sys/ximage/ximagesink.c | 3 ++- sys/xvimage/xvimagepool.c | 2 +- sys/xvimage/xvimagesink.c | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/video/gstvideopool.c b/gst-libs/gst/video/gstvideopool.c index c56a2ccf6f..4fca40e6f4 100644 --- a/gst-libs/gst/video/gstvideopool.c +++ b/gst-libs/gst/video/gstvideopool.c @@ -170,7 +170,7 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) GstVideoBufferPool *vpool = GST_VIDEO_BUFFER_POOL_CAST (pool); GstVideoBufferPoolPrivate *priv = vpool->priv; GstVideoInfo info; - const GstCaps *caps; + GstCaps *caps; gint width, height; GstAllocator *allocator; GstAllocationParams params; diff --git a/sys/ximage/ximagepool.c b/sys/ximage/ximagepool.c index 46ebe7a98c..68cc312b4d 100644 --- a/sys/ximage/ximagepool.c +++ b/sys/ximage/ximagepool.c @@ -481,7 +481,7 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) GstXImageBufferPool *xpool = GST_XIMAGE_BUFFER_POOL_CAST (pool); GstXImageBufferPoolPrivate *priv = xpool->priv; GstVideoInfo info; - const GstCaps *caps; + GstCaps *caps; if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL)) goto wrong_config; diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index 6578539229..cdc879040b 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1440,7 +1440,7 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) g_mutex_unlock (ximagesink->flow_lock); if (pool != NULL) { - const GstCaps *pcaps; + GstCaps *pcaps; /* we had a pool, check caps */ config = gst_buffer_pool_get_config (pool); @@ -1454,6 +1454,7 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) gst_object_unref (pool); pool = NULL; } + gst_structure_free (config); } if (pool == NULL && need_pool) { GstVideoInfo info; diff --git a/sys/xvimage/xvimagepool.c b/sys/xvimage/xvimagepool.c index af8087a3ce..840e507beb 100644 --- a/sys/xvimage/xvimagepool.c +++ b/sys/xvimage/xvimagepool.c @@ -517,7 +517,7 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) GstXvImageBufferPool *xvpool = GST_XVIMAGE_BUFFER_POOL_CAST (pool); GstXvImageBufferPoolPrivate *priv = xvpool->priv; GstVideoInfo info; - const GstCaps *caps; + GstCaps *caps; if (!gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL)) goto wrong_config; diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 08b6a2abc8..10fe8fd239 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1954,7 +1954,7 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) g_mutex_unlock (xvimagesink->flow_lock); if (pool != NULL) { - const GstCaps *pcaps; + GstCaps *pcaps; /* we had a pool, check caps */ GST_DEBUG_OBJECT (xvimagesink, "check existing pool caps"); @@ -1965,9 +1965,9 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) GST_DEBUG_OBJECT (xvimagesink, "pool has different caps"); /* different caps, we can't use this pool */ gst_object_unref (pool); - gst_structure_free (config); pool = NULL; } + gst_structure_free (config); } if (pool == NULL && need_pool) { GstVideoInfo info;