mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-10 16:32:36 +00:00
update for memory api changes
This commit is contained in:
parent
9f700cc3c4
commit
6cbb840385
13 changed files with 20 additions and 16 deletions
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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++];
|
||||
|
|
|
@ -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, ¶ms);
|
||||
|
||||
gst_buffer_map (buffer, &map, GST_MAP_READWRITE);
|
||||
p = (gint16 *) map.data;
|
||||
|
|
|
@ -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, ¶ms);
|
||||
GST_BUFFER_DURATION (buf) = payload.duration * GST_SECOND / clock_rate;
|
||||
volume = payload.volume;
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue