videopool: avoid caps copy
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 27 Mar 2012 13:44:59 +0000 (15:44 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 27 Mar 2012 13:44:59 +0000 (15:44 +0200)
Now that the caps from the bufferpool are not returned as const we
can take a ref instead of doing a copy.

gst-libs/gst/video/gstvideopool.c
sys/ximage/ximagepool.c
sys/xvimage/xvimagepool.c

index 4fca40e..96801d1 100644 (file)
@@ -195,7 +195,7 @@ video_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
 
   if (priv->caps)
     gst_caps_unref (priv->caps);
-  priv->caps = gst_caps_copy (caps);
+  priv->caps = gst_caps_ref (caps);
 
   priv->params = params;
   if (priv->allocator)
index 68cc312..349c9c2 100644 (file)
@@ -501,7 +501,7 @@ ximage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
   /* keep track of the width and height and caps */
   if (priv->caps)
     gst_caps_unref (priv->caps);
-  priv->caps = gst_caps_copy (caps);
+  priv->caps = gst_caps_ref (caps);
 
   /* check for the configured metadata */
   priv->add_metavideo =
index 840e507..4ffdbd8 100644 (file)
@@ -538,7 +538,7 @@ xvimage_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
 
   if (priv->caps)
     gst_caps_unref (priv->caps);
-  priv->caps = gst_caps_copy (caps);
+  priv->caps = gst_caps_ref (caps);
   priv->info = info;
 
   /* enable metadata based on config of the pool */