+2005-12-05 Andy Wingo <wingo@pobox.com>
+
+ * ext/dv/gstdvdec.c: (gst_dvdec_chain):
+ * ext/flac/gstflacdec.c: (gst_flacdec_write):
+ * ext/flac/gstflacenc.c: (gst_flacenc_write_callback):
+ * ext/gdk_pixbuf/gstgdkpixbuf.c: (gst_gdk_pixbuf_chain):
+ * ext/gdk_pixbuf/pixbufscale.c: (gst_pixbufscale_chain):
+ * ext/jpeg/gstjpegdec.c: (gst_jpeg_dec_chain):
+ * ext/jpeg/gstjpegenc.c: (gst_jpegenc_chain):
+ * ext/ladspa/gstsignalprocessor.c: (gst_signal_processor_process):
+ * ext/libpng/gstpngdec.c: (user_info_callback), (gst_pngdec_task):
+ * ext/speex/gstspeexdec.c: (speex_dec_chain):
+ * ext/speex/gstspeexenc.c: (gst_speexenc_chain):
+ * gst/auparse/gstauparse.c: (gst_auparse_chain):
+ * gst/flx/gstflxdec.c: (gst_flxdec_chain):
+ * gst/goom/gstgoom.c: (gst_goom_chain):
+ * gst/matroska/matroska-demux.c:
+ (gst_matroska_demux_push_vorbis_codec_priv_data),
+ (gst_matroska_demux_add_wvpk_header):
+ * gst/multipart/multipartdemux.c: (gst_multipart_demux_chain):
+ * gst/multipart/multipartmux.c: (gst_multipart_mux_collected):
+ * gst/videomixer/videomixer.c: (gst_videomixer_collected):
+ * gst/wavenc/gstwavenc.c: (gst_wavenc_chain): Update for
+ alloc_buffer changes.
+
2005-12-05 Michael Smith <msmith@fluendo.com>
* docs/plugins/gst-plugins-good-plugins.args:
goto skip;
ret =
- gst_pad_alloc_buffer (dvdec->srcpad, 0,
+ gst_pad_alloc_buffer_and_set_caps (dvdec->srcpad, 0,
(720 * dvdec->height) * dvdec->bpp,
GST_PAD_CAPS (dvdec->srcpad), &outbuf);
if (ret != GST_FLOW_OK)
flacdec->frequency = frame->header.sample_rate;
}
- ret = gst_pad_alloc_buffer (flacdec->srcpad, flacdec->total_samples,
- samples * channels * ((width + 7) >> 3), GST_PAD_CAPS (flacdec->srcpad),
- &outbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (flacdec->srcpad,
+ flacdec->total_samples, samples * channels * ((width + 7) >> 3),
+ GST_PAD_CAPS (flacdec->srcpad), &outbuf);
if (ret != GST_FLOW_NOT_LINKED && ret != GST_FLOW_OK) {
GST_DEBUG ("stopping flac decoder engine (%d)", (gint) ret);
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
if (flacenc->stopped)
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
- if (gst_pad_alloc_buffer (flacenc->srcpad, flacenc->offset, bytes,
- GST_PAD_CAPS (flacenc->srcpad), &outbuf) != GST_FLOW_OK) {
+ if (gst_pad_alloc_buffer_and_set_caps (flacenc->srcpad, flacenc->offset,
+ bytes, GST_PAD_CAPS (flacenc->srcpad), &outbuf) != GST_FLOW_OK) {
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
}
gst_pad_set_explicit_caps (filter->srcpad, caps);
}
- outbuf = gst_pad_alloc_buffer (filter->srcpad, GST_BUFFER_OFFSET_NONE,
- filter->image_size);
+ outbuf =
+ gst_pad_alloc_buffer_and_set_caps (filter->srcpad,
+ GST_BUFFER_OFFSET_NONE, filter->image_size);
GST_BUFFER_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);
return;
}
- outbuf = gst_pad_alloc_buffer (pixbufscale->srcpad,
+ outbuf = gst_pad_alloc_buffer_and_set_caps (pixbufscale->srcpad,
GST_BUFFER_OFFSET_NONE, pixbufscale->to_buf_size);
gst_buffer_stamp (outbuf, buf);
dec->caps_framerate_denominator = dec->framerate_denominator;
}
- ret = gst_pad_alloc_buffer (dec->srcpad, GST_BUFFER_OFFSET_NONE,
+ ret = gst_pad_alloc_buffer_and_set_caps (dec->srcpad, GST_BUFFER_OFFSET_NONE,
I420_SIZE (width, height), GST_PAD_CAPS (dec->srcpad), &outbuf);
if (ret != GST_FLOW_OK)
goto alloc_failed;
GST_DEBUG_OBJECT (jpegenc, "got buffer of %u bytes", size);
- ret = gst_pad_alloc_buffer (jpegenc->srcpad, GST_BUFFER_OFFSET_NONE,
- jpegenc->bufsize, GST_PAD_CAPS (jpegenc->srcpad), &outbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (jpegenc->srcpad,
+ GST_BUFFER_OFFSET_NONE, jpegenc->bufsize, GST_PAD_CAPS (jpegenc->srcpad),
+ &outbuf);
if (ret != GST_FLOW_OK)
goto done;
srcpad = (GstSignalProcessorPad *) l2->data;
- ret = gst_pad_alloc_buffer (GST_PAD (srcpad), -1, self->buffer_frames,
- GST_PAD_CAPS (srcpad), &srcpad->pen);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (GST_PAD (srcpad), -1,
+ self->buffer_frames, GST_PAD_CAPS (srcpad), &srcpad->pen);
if (ret != GST_FLOW_OK) {
self->state = ret;
/* Allocate output buffer */
pngdec->rowbytes = png_get_rowbytes (pngdec->png, pngdec->info);
buffer_size = pngdec->height * GST_ROUND_UP_4 (pngdec->rowbytes);
- ret = gst_pad_alloc_buffer (pngdec->srcpad, GST_BUFFER_OFFSET_NONE,
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (pngdec->srcpad, GST_BUFFER_OFFSET_NONE,
buffer_size, GST_PAD_CAPS (pngdec->srcpad), &buffer);
if (ret != GST_FLOW_OK) {
goto beach;
/* Allocate output buffer */
rowbytes = png_get_rowbytes (pngdec->png, pngdec->info);
buffer_size = pngdec->height * GST_ROUND_UP_4 (rowbytes);
- ret = gst_pad_alloc_buffer (pngdec->srcpad, GST_BUFFER_OFFSET_NONE,
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (pngdec->srcpad, GST_BUFFER_OFFSET_NONE,
buffer_size, GST_PAD_CAPS (pngdec->srcpad), &buffer);
if (ret != GST_FLOW_OK) {
goto pause;
if (dec->header->nb_channels == 2)
speex_decode_stereo (dec->output, dec->frame_size, &dec->stereo);
- if ((res = gst_pad_alloc_buffer (dec->srcpad, GST_BUFFER_OFFSET_NONE,
+ if ((res =
+ gst_pad_alloc_buffer_and_set_caps (dec->srcpad,
+ GST_BUFFER_OFFSET_NONE,
dec->frame_size * dec->header->nb_channels * 2,
GST_PAD_CAPS (dec->srcpad), &outbuf)) != GST_FLOW_OK)
return res;
speex_bits_insert_terminator (&speexenc->bits);
outsize = speex_bits_nbytes (&speexenc->bits);
- ret = gst_pad_alloc_buffer (speexenc->srcpad,
+ ret = gst_pad_alloc_buffer_and_set_caps (speexenc->srcpad,
GST_BUFFER_OFFSET_NONE, outsize, GST_PAD_CAPS (speexenc->srcpad),
&outbuf);
const guint8 *data = gst_adapter_peek (auparse->adapter, avail);
GstBuffer *newbuf;
- if ((ret = gst_pad_alloc_buffer (auparse->srcpad, auparse->buffer_offset,
- avail, GST_PAD_CAPS (auparse->srcpad),
+ if ((ret =
+ gst_pad_alloc_buffer_and_set_caps (auparse->srcpad,
+ auparse->buffer_offset, avail, GST_PAD_CAPS (auparse->srcpad),
&newbuf)) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (newbuf), data, avail);
break;
/* create 32 bits output frame */
- res = gst_pad_alloc_buffer (flxdec->srcpad,
+ res = gst_pad_alloc_buffer_and_set_caps (flxdec->srcpad,
GST_BUFFER_OFFSET_NONE,
flxdec->size * 4, GST_PAD_CAPS (flxdec->srcpad), &out);
}
}
- ret = gst_pad_alloc_buffer (goom->srcpad, GST_BUFFER_OFFSET_NONE,
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (goom->srcpad, GST_BUFFER_OFFSET_NONE,
goom->width * goom->height * 4, GST_PAD_CAPS (goom->srcpad), &bufout);
if (ret != GST_FLOW_OK)
break;
for (i = 0; i < 2; i++) {
length = p[i + 1];
- if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE,
+ if (gst_pad_alloc_buffer_and_set_caps (stream->pad, GST_BUFFER_OFFSET_NONE,
length, stream->caps, &priv) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
offset += length;
}
length = stream->codec_priv_size - offset;
- if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, length,
- stream->caps, &priv) == GST_FLOW_OK) {
+ if (gst_pad_alloc_buffer_and_set_caps (stream->pad, GST_BUFFER_OFFSET_NONE,
+ length, stream->caps, &priv) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
ret = gst_pad_push (stream->pad, priv);
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
/* block_samples, flags and crc are already in the buffer */
newlen = block_length + sizeof (Wavpack4Header) - 12;
- if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, newlen,
- stream->caps, &newbuf) != GST_FLOW_OK) {
+ if (gst_pad_alloc_buffer_and_set_caps (stream->pad, GST_BUFFER_OFFSET_NONE,
+ newlen, stream->caps, &newbuf) != GST_FLOW_OK) {
return TRUE; /* not an error, pad might not be linked */
}
gst_multipart_find_pad_by_mime (multipart,
multipart->parsing_mime, &created);
if (srcpad != NULL) {
- ret = gst_pad_alloc_buffer (srcpad->pad, GST_BUFFER_OFFSET_NONE,
- datalen, GST_PAD_CAPS (srcpad->pad), &outbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (srcpad->pad,
+ GST_BUFFER_OFFSET_NONE, datalen, GST_PAD_CAPS (srcpad->pad),
+ &outbuf);
if (ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (multipart, "failed allocating a %d bytes "
"buffer", datalen);
headerlen = strlen (header);
newlen = headerlen + GST_BUFFER_SIZE (best->buffer);
- ret = gst_pad_alloc_buffer (mux->srcpad, GST_BUFFER_OFFSET_NONE, newlen,
- GST_PAD_CAPS (mux->srcpad), &newbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (mux->srcpad, GST_BUFFER_OFFSET_NONE,
+ newlen, GST_PAD_CAPS (mux->srcpad), &newbuf);
if (ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (mux, "failed allocating a %d bytes buffer", newlen);
g_free (header);
outsize = ROUND_UP_2 (mix->out_width) * ROUND_UP_2 (mix->out_height) * 4;
- outbuf = gst_pad_alloc_buffer (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize);
+ outbuf = gst_pad_alloc_buffer_and_set_caps (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize);
switch (mix->background) {
case VIDEO_MIXER_BACKGROUND_CHECKER:
gst_videomixer_fill_checker (GST_BUFFER_DATA (outbuf),
mix->out_width = mix->in_width;
mix->out_height = mix->in_height;
- ret = gst_pad_alloc_buffer (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize,
- newcaps, &outbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (mix->srcpad, GST_BUFFER_OFFSET_NONE,
+ outsize, newcaps, &outbuf);
gst_caps_unref (newcaps);
} else { /* Otherwise we just allocate a buffer from current caps */
- ret = gst_pad_alloc_buffer (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize,
- GST_PAD_CAPS (mix->srcpad), &outbuf);
+ ret =
+ gst_pad_alloc_buffer_and_set_caps (mix->srcpad, GST_BUFFER_OFFSET_NONE,
+ outsize, GST_PAD_CAPS (mix->srcpad), &outbuf);
}
if (ret != GST_FLOW_OK) {
if (wavenc->flush_header) {
GstBuffer *outbuf;
- result = gst_pad_alloc_buffer (wavenc->srcpad, GST_BUFFER_OFFSET_NONE,
- WAV_HEADER_LEN, GST_PAD_CAPS (wavenc->srcpad), &outbuf);
+ result =
+ gst_pad_alloc_buffer_and_set_caps (wavenc->srcpad,
+ GST_BUFFER_OFFSET_NONE, WAV_HEADER_LEN, GST_PAD_CAPS (wavenc->srcpad),
+ &outbuf);
if (result != GST_FLOW_OK) {
GST_WARNING_OBJECT (wavenc, "failed when allocating a %d bytes buffer "
"for headers", WAV_HEADER_LEN);