update for memory api changes
authorWim Taymans <wim.taymans@collabora.co.uk>
Thu, 15 Mar 2012 12:37:36 +0000 (13:37 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Thu, 15 Mar 2012 12:37:36 +0000 (13:37 +0100)
13 files changed:
ext/faad/gstfaad.c
ext/kate/gstkateenc.c
ext/modplug/gstmodplug.cc
ext/rtmp/gstrtmpsrc.c
gst-libs/gst/signalprocessor/gstsignalprocessor.c
gst/dtmf/gstdtmfsrc.c
gst/dtmf/gstrtpdtmfdepay.c
gst/jpegformat/gstjifmux.c
gst/mpegdemux/gstpesfilter.c
gst/videoparsers/gsth264parse.c
sys/pvr2d/gstpvrbufferpool.c
sys/pvr2d/gstpvrbufferpool.h
tests/check/elements/schroenc.c

index 94ac0a7..54a14f3 100644 (file)
@@ -755,7 +755,7 @@ init:
 
       /* note: info.samples is total samples, not per channel */
       /* FIXME, add bufferpool and allocator support to the base class */
-      outbuf = gst_buffer_new_allocate (NULL, info.samples * faad->bps, 0);
+      outbuf = gst_buffer_new_allocate (NULL, info.samples * faad->bps, NULL);
       gst_buffer_fill (outbuf, 0, out, info.samples * faad->bps);
       gst_audio_buffer_reorder_channels (outbuf, GST_AUDIO_FORMAT_S16,
           faad->channels, faad->aac_positions, faad->gst_positions);
index db36569..1e03c35 100644 (file)
@@ -391,7 +391,7 @@ gst_kate_enc_create_buffer (GstKateEnc * ke, kate_packet * kp,
   g_return_val_if_fail (kp != NULL, NULL);
   g_return_val_if_fail (kp->data != NULL, NULL);
 
-  buffer = gst_buffer_new_allocate (NULL, kp->nbytes, 0);
+  buffer = gst_buffer_new_allocate (NULL, kp->nbytes, NULL);
   if (G_UNLIKELY (!buffer)) {
     GST_WARNING_OBJECT (ke, "Failed to allocate buffer for %u bytes",
         (guint) kp->nbytes);
index 5e1d176..d849a44 100644 (file)
@@ -722,7 +722,7 @@ gst_modplug_loop (GstModPlug * modplug)
   }
 
   /* read and output a buffer */
-  out = gst_buffer_new_allocate (NULL, modplug->read_bytes, 0);
+  out = gst_buffer_new_allocate (NULL, modplug->read_bytes, NULL);
 
   gst_buffer_map (out, &map, GST_MAP_WRITE);
   if (!modplug->mSoundFile->Read (map.data, modplug->read_bytes)) {
index 0103cad..be94bae 100644 (file)
@@ -316,7 +316,7 @@ gst_rtmp_src_create (GstPushSrc * pushsrc, GstBuffer ** buffer)
   GST_DEBUG ("reading from %" G_GUINT64_FORMAT
       ", size %u", src->cur_offset, size);
 
-  buf = gst_buffer_new_allocate (NULL, size, 0);
+  buf = gst_buffer_new_allocate (NULL, size, NULL);
   if (G_UNLIKELY (buf == NULL)) {
     GST_ERROR_OBJECT (src, "Failed to allocate %u bytes", size);
     return GST_FLOW_ERROR;
index 2e3290d..380b2f5 100644 (file)
@@ -740,7 +740,7 @@ gst_signal_processor_prepare (GstSignalProcessor * self, guint nframes)
 
     srcpad->pen =
         gst_buffer_new_allocate (NULL,
-        samples_avail * srcpad->channels * sizeof (gfloat), 0);
+        samples_avail * srcpad->channels * sizeof (gfloat), NULL);
 
     if (srcpad->channels > 1) {
       GstSignalProcessorGroup *group = &self->group_out[out_group_index++];
index b3f24ff..60bc8a5 100644 (file)
@@ -547,11 +547,12 @@ gst_dtmf_src_generate_tone (GstDTMFSrcEvent * event, DTMF_KEY key,
   double i = 0;
   double amplitude, f1, f2;
   double volume_factor;
+  static GstAllocationParams params = { 0, 0, 0, 1, };
 
   /* Create a buffer for the tone */
   tone_size = ((duration / 1000) * sample_rate * SAMPLE_SIZE * CHANNELS) / 8;
 
-  buffer = gst_buffer_new_allocate (NULL, tone_size, 1);
+  buffer = gst_buffer_new_allocate (NULL, tone_size, &params);
 
   gst_buffer_map (buffer, &map, GST_MAP_READWRITE);
   p = (gint16 *) map.data;
index db4d6fb..0dda885 100644 (file)
@@ -342,12 +342,13 @@ gst_dtmf_src_generate_tone (GstRtpDTMFDepay * rtpdtmfdepay,
   guint32 clock_rate = 8000 /* default */ ;
   GstRTPBaseDepayload *depayload = GST_RTP_BASE_DEPAYLOAD (rtpdtmfdepay);
   gint volume;
+  static GstAllocationParams params = { 0, 0, 0, 1, };
 
   clock_rate = depayload->clock_rate;
 
   /* Create a buffer for the tone */
   tone_size = (payload.duration * SAMPLE_SIZE * CHANNELS) / 8;
-  buf = gst_buffer_new_allocate (NULL, tone_size, 1);
+  buf = gst_buffer_new_allocate (NULL, tone_size, &params);
   GST_BUFFER_DURATION (buf) = payload.duration * GST_SECOND / clock_rate;
   volume = payload.volume;
 
index b9552b1..82cd18a 100644 (file)
@@ -670,7 +670,7 @@ gst_jif_mux_recombine_image (GstJifMux * self, GstBuffer ** new_buf,
       gst_buffer_get_size (old_buf), size);
 
   /* allocate new buffer */
-  buf = gst_buffer_new_allocate (NULL, size, 0);
+  buf = gst_buffer_new_allocate (NULL, size, NULL);
 
   /* copy buffer metadata */
   gst_buffer_copy_into (buf, old_buf,
index abf5e57..f728e4b 100644 (file)
@@ -472,7 +472,7 @@ push_out:
     }
 
     if (datalen > 0) {
-      out = gst_buffer_new_allocate (NULL, datalen, 0);
+      out = gst_buffer_new_allocate (NULL, datalen, NULL);
       gst_buffer_fill (out, 0, data, datalen);
       ret = gst_pes_filter_data_push (filter, TRUE, out);
       filter->first = FALSE;
index 58264d5..420394f 100644 (file)
@@ -375,7 +375,7 @@ gst_h264_parse_wrap_nal (GstH264Parse * h264parse, guint format, guint8 * data,
 
   GST_DEBUG_OBJECT (h264parse, "nal length %d", size);
 
-  buf = gst_buffer_new_allocate (NULL, nl + size, 0);
+  buf = gst_buffer_new_allocate (NULL, nl + size, NULL);
   if (format == GST_H264_PARSE_FORMAT_AVC) {
     tmp = GUINT32_TO_BE (size << (32 - 8 * nl));
   } else {
@@ -415,7 +415,7 @@ gst_h264_parser_store_nal (GstH264Parse * h264parse, guint id,
     return;
   }
 
-  buf = gst_buffer_new_allocate (NULL, size, 0);
+  buf = gst_buffer_new_allocate (NULL, size, NULL);
   gst_buffer_fill (buf, 0, nalu->data + nalu->offset, size);
 
   if (store[id])
@@ -953,7 +953,7 @@ gst_h264_parse_make_codec_data (GstH264Parse * h264parse)
   if (!found || !num_pps)
     return NULL;
 
-  buf = gst_buffer_new_allocate (NULL, 5 + 1 + sps_size + 1 + pps_size, 0);
+  buf = gst_buffer_new_allocate (NULL, 5 + 1 + sps_size + 1 + pps_size, NULL);
   gst_buffer_map (buf, &map, GST_MAP_WRITE);
   data = map.data;
 
index 7c269db..03e229c 100644 (file)
@@ -186,7 +186,8 @@ pvr_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config)
   pvrpool->caps = gst_caps_copy (caps);
   pvrpool->info = info;
   pvrpool->size = size;
-  pvrpool->align = align;
+  gst_allocation_params_init (&pvrpool->params);
+  pvrpool->params.align = align;
   pvrpool->padded_width = GST_VIDEO_INFO_WIDTH (&info);
   pvrpool->padded_height = GST_VIDEO_INFO_HEIGHT (&info);
 
@@ -259,7 +260,7 @@ pvr_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
 
   info = &pvrpool->info;
 
-  pvr = gst_buffer_new_allocate (NULL, pvrpool->size, pvrpool->align);
+  pvr = gst_buffer_new_allocate (NULL, pvrpool->size, &pvrpool->params);
   meta = gst_buffer_add_pvr_meta (pvr, pvrpool->pvrsink);
   if (meta == NULL) {
     gst_buffer_unref (pvr);
index c34504d..b749b7c 100644 (file)
@@ -60,7 +60,8 @@ struct _GstPVRBufferPool
 
   /* output (padded) size including any codec padding: */
   gint padded_width, padded_height;
-  guint size, align;
+  guint size;
+  GstAllocationParams params;
 
   GstElement *pvrsink;
 
index 463447b..00afa18 100644 (file)
@@ -112,7 +112,7 @@ GST_START_TEST (test_encode_simple)
 
   fail_unless (gst_pad_push_event (srcpad, gst_event_new_segment (&seg)));
 
-  buffer = gst_buffer_new_allocate (NULL, 320 * 240 + 2 * 160 * 120, 0);
+  buffer = gst_buffer_new_allocate (NULL, 320 * 240 + 2 * 160 * 120, NULL);
   gst_buffer_memset (buffer, 0, 0, -1);
 
   for (i = 0; i < 20; i++) {