update for bufferpool changes
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 15 Mar 2012 21:11:17 +0000 (22:11 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 15 Mar 2012 21:11:17 +0000 (22:11 +0100)
ext/dv/gstdvdec.c
ext/gdk_pixbuf/gstgdkpixbuf.c
ext/jpeg/gstjpegdec.c
ext/libpng/gstpngdec.c
gst/goom/gstgoom.c
gst/goom2k1/gstgoom.c
gst/rtp/gstrtpvrawdepay.c
sys/v4l2/gstv4l2bufferpool.c
sys/v4l2/gstv4l2sink.c
sys/v4l2/gstv4l2src.c

index 71fc8afa2a304bb289ff773e58aed2a4c793598e..9e895d7e65b0385b7dcf0e7971ed362567f08340 100644 (file)
@@ -286,7 +286,7 @@ gst_dvdec_negotiate_pool (GstDVDec * dec, GstCaps * caps, GstVideoInfo * info)
   dec->pool = pool;
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, caps, size, min, max);
 
   if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE)) {
     /* just set the option, if the pool can support it we will transparently use
index 3952888f7f06690d13966176c60ca3147844cb5f..588e1656c935e07939db1153ef071b2557ee5ff3 100644 (file)
@@ -255,7 +255,7 @@ gst_gdk_pixbuf_setup_pool (GstGdkPixbuf * filter, GstVideoInfo * info)
 
   /* and configure */
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, target, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, target, size, min, max);
   gst_buffer_pool_set_config (pool, config);
 
   if (filter->pool) {
index b5d6f44ce220f18b64b5ac1ba93fe4a51bd6be85..eeb44a2fe902d35a421b2f84886a0911d26c0a61 100644 (file)
@@ -1166,6 +1166,7 @@ gst_jpeg_dec_buffer_pool (GstJpegDec * dec, GstCaps * caps)
   GstBufferPool *pool;
   guint size, min, max;
   GstStructure *config;
+  static GstAllocationParams params = { 0, 0, 0, 15, };
 
   GST_DEBUG_OBJECT (dec, "setting up bufferpool");
 
@@ -1193,7 +1194,8 @@ gst_jpeg_dec_buffer_pool (GstJpegDec * dec, GstCaps * caps)
   }
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 15);
+  gst_buffer_pool_config_set_params (config, caps, size, min, max);
+  gst_buffer_pool_config_set_allocator (config, NULL, &params);
   /* and store */
   gst_buffer_pool_set_config (pool, config);
 
index 7c569ed97a38714ef78bf4665704f9436ce9f52e..aae356fca59eed4277fb9a5c72d9b3c1ca792e1a 100644 (file)
@@ -372,7 +372,7 @@ gst_pngdec_negotiate_pool (GstPngDec * dec, GstCaps * caps, GstVideoInfo * info)
   dec->pool = pool;
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, caps, size, min, max);
 
   if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE)) {
     /* just set the option, if the pool can support it we will transparently use
index 20d2445b6ac635a07f5a6dd39112aef592d39adc..caf8ce932ee243223e3301a417723bae4c19de89 100644 (file)
@@ -309,7 +309,7 @@ gst_goom_src_negotiate (GstGoom * goom)
   }
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, target, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, target, size, min, max);
   gst_buffer_pool_set_config (pool, config);
 
   if (goom->pool) {
index 8917c958f45d4a5b020e88a0863ef2a825e843f4..42737d2ebc6160941f504efb54683bbddade9301 100644 (file)
@@ -305,7 +305,7 @@ gst_goom_src_negotiate (GstGoom * goom)
   }
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, target, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, target, size, min, max);
   gst_buffer_pool_set_config (pool, config);
 
   if (goom->pool) {
index c19ea4d4aac2b6a14c158a3476c3a1ead3ae86ed..1d49cd19ccea54c28c4e807e655d6b5d54061b2f 100644 (file)
@@ -148,7 +148,7 @@ gst_rtp_vraw_depay_negotiate_pool (GstRtpVRawDepay * depay, GstCaps * caps,
   depay->pool = pool;
 
   config = gst_buffer_pool_get_config (pool);
-  gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 0);
+  gst_buffer_pool_config_set_params (config, caps, size, min, max);
   if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE)) {
     /* just set the metadata, if the pool can support it we will transparently use
      * it through the video info API. We could also see if the pool support this
index 65187926804576498b14d421980fd8387d765cd0..306814717c9c5183e4afc836bd0a8f87e7567a35 100644 (file)
@@ -244,7 +244,8 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
   GstV4l2Object *obj = pool->obj;
   const GstCaps *caps;
   guint size, min_buffers, max_buffers;
-  guint prefix, padding, align;
+  GstAllocator *allocator;
+  GstAllocationParams params;
 
   GST_DEBUG_OBJECT (pool, "set config");
 
@@ -266,8 +267,11 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
   }
 
   /* parse the config and keep around */
-  if (!gst_buffer_pool_config_get (config, &caps, &size, &min_buffers,
-          &max_buffers, &prefix, &padding, &align))
+  if (!gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers,
+          &max_buffers))
+    goto wrong_config;
+
+  if (!gst_buffer_pool_config_get_allocator (config, &allocator, &params))
     goto wrong_config;
 
   GST_DEBUG_OBJECT (pool, "config %" GST_PTR_FORMAT, config);
@@ -275,13 +279,10 @@ gst_v4l2_buffer_pool_set_config (GstBufferPool * bpool, GstStructure * config)
   pool->size = size;
   pool->max_buffers = MAX (min_buffers, max_buffers);
   pool->min_buffers = MIN (pool->max_buffers, min_buffers);
-  gst_allocation_params_init (&pool->params);
-  pool->params.prefix = prefix;
-  pool->params.padding = padding;
-  pool->params.align = align;
+  pool->params = params;
 
-  gst_buffer_pool_config_set (config, caps, size, min_buffers,
-      max_buffers, prefix, padding, align);
+  gst_buffer_pool_config_set_params (config, caps, size, min_buffers,
+      max_buffers);
 
   return GST_BUFFER_POOL_CLASS (parent_class)->set_config (bpool, config);
 
@@ -890,7 +891,7 @@ gst_v4l2_buffer_pool_new (GstV4l2Object * obj, GstCaps * caps)
   pool->obj = obj;
 
   s = gst_buffer_pool_get_config (GST_BUFFER_POOL_CAST (pool));
-  gst_buffer_pool_config_set (s, caps, obj->sizeimage, 2, 0, 0, 0, 0);
+  gst_buffer_pool_config_set_params (s, caps, obj->sizeimage, 2, 0);
   gst_buffer_pool_set_config (GST_BUFFER_POOL_CAST (pool), s);
 
   return GST_BUFFER_POOL (pool);
index 4df872934a50f1391cb8fe226222ec51ce050037..a2e2fe5d28ad283b022edc987ca12306b3e4b5ee 100644 (file)
@@ -640,8 +640,7 @@ gst_v4l2sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
 
     /* we had a pool, check caps */
     config = gst_buffer_pool_get_config (pool);
-    gst_buffer_pool_config_get (config, &pcaps, &size, NULL, NULL, NULL, NULL,
-        NULL);
+    gst_buffer_pool_config_get_params (config, &pcaps, &size, NULL, NULL);
 
     GST_DEBUG_OBJECT (v4l2sink,
         "we had a pool with caps %" GST_PTR_FORMAT, pcaps);
index e8f30da2d37ac62c9796807633e7563ed4645fd1..a27ad3a71c1e2352747877dc218515fd7ca1e576 100644 (file)
@@ -576,9 +576,8 @@ gst_v4l2src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query)
     const GstCaps *caps;
 
     config = gst_buffer_pool_get_config (pool);
-    gst_buffer_pool_config_get (config, &caps, NULL, NULL, NULL, NULL, NULL,
-        NULL);
-    gst_buffer_pool_config_set (config, caps, size, min, max, 0, 0, 0);
+    gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL);
+    gst_buffer_pool_config_set_params (config, caps, size, min, max);
 
     /* if downstream supports video metadata, add this to the pool config */
     if (gst_query_has_allocation_meta (query, GST_VIDEO_META_API_TYPE))