/* 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);
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);
}
/* 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)) {
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;
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++];
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, ¶ms);
gst_buffer_map (buffer, &map, GST_MAP_READWRITE);
p = (gint16 *) map.data;
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, ¶ms);
GST_BUFFER_DURATION (buf) = payload.duration * GST_SECOND / clock_rate;
volume = payload.volume;
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,
}
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;
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 {
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])
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;
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);
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);
/* output (padded) size including any codec padding: */
gint padded_width, padded_height;
- guint size, align;
+ guint size;
+ GstAllocationParams params;
GstElement *pvrsink;
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++) {