Update for alloc_buffer changes.

Original commit message from CVS:
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.
This commit is contained in:
Andy Wingo 2005-12-05 13:03:00 +00:00
parent c28031af5a
commit 7fbfd29bbe
20 changed files with 81 additions and 38 deletions

View file

@ -1,3 +1,28 @@
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> 2005-12-05 Michael Smith <msmith@fluendo.com>
* docs/plugins/gst-plugins-good-plugins.args: * docs/plugins/gst-plugins-good-plugins.args:

View file

@ -273,7 +273,7 @@ gst_dvdec_chain (GstPad * pad, GstBuffer * buf)
goto skip; goto skip;
ret = ret =
gst_pad_alloc_buffer (dvdec->srcpad, 0, gst_pad_alloc_buffer_and_set_caps (dvdec->srcpad, 0,
(720 * dvdec->height) * dvdec->bpp, (720 * dvdec->height) * dvdec->bpp,
GST_PAD_CAPS (dvdec->srcpad), &outbuf); GST_PAD_CAPS (dvdec->srcpad), &outbuf);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)

View file

@ -488,9 +488,10 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder * decoder,
flacdec->frequency = frame->header.sample_rate; flacdec->frequency = frame->header.sample_rate;
} }
ret = gst_pad_alloc_buffer (flacdec->srcpad, flacdec->total_samples, ret =
samples * channels * ((width + 7) >> 3), GST_PAD_CAPS (flacdec->srcpad), gst_pad_alloc_buffer_and_set_caps (flacdec->srcpad,
&outbuf); flacdec->total_samples, samples * channels * ((width + 7) >> 3),
GST_PAD_CAPS (flacdec->srcpad), &outbuf);
if (ret != GST_FLOW_NOT_LINKED && ret != GST_FLOW_OK) { if (ret != GST_FLOW_NOT_LINKED && ret != GST_FLOW_OK) {
GST_DEBUG ("stopping flac decoder engine (%d)", (gint) ret); GST_DEBUG ("stopping flac decoder engine (%d)", (gint) ret);
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;

View file

@ -538,8 +538,8 @@ gst_flacenc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
if (flacenc->stopped) if (flacenc->stopped)
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK; return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
if (gst_pad_alloc_buffer (flacenc->srcpad, flacenc->offset, bytes, if (gst_pad_alloc_buffer_and_set_caps (flacenc->srcpad, flacenc->offset,
GST_PAD_CAPS (flacenc->srcpad), &outbuf) != GST_FLOW_OK) { bytes, GST_PAD_CAPS (flacenc->srcpad), &outbuf) != GST_FLOW_OK) {
return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR; return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
} }

View file

@ -329,8 +329,9 @@ gst_gdk_pixbuf_chain (GstPad * pad, GstData * _data)
gst_pad_set_explicit_caps (filter->srcpad, caps); gst_pad_set_explicit_caps (filter->srcpad, caps);
} }
outbuf = gst_pad_alloc_buffer (filter->srcpad, GST_BUFFER_OFFSET_NONE, outbuf =
filter->image_size); 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_TIMESTAMP (outbuf) = GST_BUFFER_TIMESTAMP (buf);
GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf); GST_BUFFER_DURATION (outbuf) = GST_BUFFER_DURATION (buf);

View file

@ -409,7 +409,7 @@ gst_pixbufscale_chain (GstPad * pad, GstData * _data)
return; 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_OFFSET_NONE, pixbufscale->to_buf_size);
gst_buffer_stamp (outbuf, buf); gst_buffer_stamp (outbuf, buf);

View file

@ -815,7 +815,7 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf)
dec->caps_framerate_denominator = dec->framerate_denominator; 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); I420_SIZE (width, height), GST_PAD_CAPS (dec->srcpad), &outbuf);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
goto alloc_failed; goto alloc_failed;

View file

@ -411,8 +411,10 @@ gst_jpegenc_chain (GstPad * pad, GstBuffer * buf)
GST_DEBUG_OBJECT (jpegenc, "got buffer of %u bytes", size); GST_DEBUG_OBJECT (jpegenc, "got buffer of %u bytes", size);
ret = gst_pad_alloc_buffer (jpegenc->srcpad, GST_BUFFER_OFFSET_NONE, ret =
jpegenc->bufsize, GST_PAD_CAPS (jpegenc->srcpad), &outbuf); 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) if (ret != GST_FLOW_OK)
goto done; goto done;

View file

@ -325,8 +325,9 @@ gst_signal_processor_process (GstSignalProcessor * self)
srcpad = (GstSignalProcessorPad *) l2->data; srcpad = (GstSignalProcessorPad *) l2->data;
ret = gst_pad_alloc_buffer (GST_PAD (srcpad), -1, self->buffer_frames, ret =
GST_PAD_CAPS (srcpad), &srcpad->pen); 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) { if (ret != GST_FLOW_OK) {
self->state = ret; self->state = ret;

View file

@ -192,7 +192,8 @@ user_info_callback (png_structp png_ptr, png_infop info)
/* Allocate output buffer */ /* Allocate output buffer */
pngdec->rowbytes = png_get_rowbytes (pngdec->png, pngdec->info); pngdec->rowbytes = png_get_rowbytes (pngdec->png, pngdec->info);
buffer_size = pngdec->height * GST_ROUND_UP_4 (pngdec->rowbytes); 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); buffer_size, GST_PAD_CAPS (pngdec->srcpad), &buffer);
if (ret != GST_FLOW_OK) { if (ret != GST_FLOW_OK) {
goto beach; goto beach;
@ -397,7 +398,8 @@ gst_pngdec_task (GstPad * pad)
/* Allocate output buffer */ /* Allocate output buffer */
rowbytes = png_get_rowbytes (pngdec->png, pngdec->info); rowbytes = png_get_rowbytes (pngdec->png, pngdec->info);
buffer_size = pngdec->height * GST_ROUND_UP_4 (rowbytes); 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); buffer_size, GST_PAD_CAPS (pngdec->srcpad), &buffer);
if (ret != GST_FLOW_OK) { if (ret != GST_FLOW_OK) {
goto pause; goto pause;

View file

@ -478,7 +478,9 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
if (dec->header->nb_channels == 2) if (dec->header->nb_channels == 2)
speex_decode_stereo (dec->output, dec->frame_size, &dec->stereo); 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, dec->frame_size * dec->header->nb_channels * 2,
GST_PAD_CAPS (dec->srcpad), &outbuf)) != GST_FLOW_OK) GST_PAD_CAPS (dec->srcpad), &outbuf)) != GST_FLOW_OK)
return res; return res;

View file

@ -996,7 +996,7 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
speex_bits_insert_terminator (&speexenc->bits); speex_bits_insert_terminator (&speexenc->bits);
outsize = speex_bits_nbytes (&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), GST_BUFFER_OFFSET_NONE, outsize, GST_PAD_CAPS (speexenc->srcpad),
&outbuf); &outbuf);

View file

@ -388,8 +388,9 @@ Samples :
const guint8 *data = gst_adapter_peek (auparse->adapter, avail); const guint8 *data = gst_adapter_peek (auparse->adapter, avail);
GstBuffer *newbuf; GstBuffer *newbuf;
if ((ret = gst_pad_alloc_buffer (auparse->srcpad, auparse->buffer_offset, if ((ret =
avail, GST_PAD_CAPS (auparse->srcpad), gst_pad_alloc_buffer_and_set_caps (auparse->srcpad,
auparse->buffer_offset, avail, GST_PAD_CAPS (auparse->srcpad),
&newbuf)) == GST_FLOW_OK) { &newbuf)) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (newbuf), data, avail); memcpy (GST_BUFFER_DATA (newbuf), data, avail);

View file

@ -554,7 +554,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
break; break;
/* create 32 bits output frame */ /* 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, GST_BUFFER_OFFSET_NONE,
flxdec->size * 4, GST_PAD_CAPS (flxdec->srcpad), &out); flxdec->size * 4, GST_PAD_CAPS (flxdec->srcpad), &out);

View file

@ -370,7 +370,8 @@ gst_goom_chain (GstPad * pad, GstBuffer * bufin)
} }
} }
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); goom->width * goom->height * 4, GST_PAD_CAPS (goom->srcpad), &bufout);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
break; break;

View file

@ -2005,7 +2005,7 @@ gst_matroska_demux_push_vorbis_codec_priv_data (GstMatroskaDemux * demux,
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
length = p[i + 1]; 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) { length, stream->caps, &priv) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (priv), &p[offset], length); memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
@ -2016,8 +2016,8 @@ gst_matroska_demux_push_vorbis_codec_priv_data (GstMatroskaDemux * demux,
offset += length; offset += length;
} }
length = stream->codec_priv_size - offset; length = stream->codec_priv_size - offset;
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, length, if (gst_pad_alloc_buffer_and_set_caps (stream->pad, GST_BUFFER_OFFSET_NONE,
stream->caps, &priv) == GST_FLOW_OK) { length, stream->caps, &priv) == GST_FLOW_OK) {
memcpy (GST_BUFFER_DATA (priv), &p[offset], length); memcpy (GST_BUFFER_DATA (priv), &p[offset], length);
ret = gst_pad_push (stream->pad, priv); ret = gst_pad_push (stream->pad, priv);
if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED) if (ret != GST_FLOW_OK && ret != GST_FLOW_NOT_LINKED)
@ -2063,8 +2063,8 @@ gst_matroska_demux_add_wvpk_header (GstMatroskaTrackContext * stream,
/* block_samples, flags and crc are already in the buffer */ /* block_samples, flags and crc are already in the buffer */
newlen = block_length + sizeof (Wavpack4Header) - 12; newlen = block_length + sizeof (Wavpack4Header) - 12;
if (gst_pad_alloc_buffer (stream->pad, GST_BUFFER_OFFSET_NONE, newlen, if (gst_pad_alloc_buffer_and_set_caps (stream->pad, GST_BUFFER_OFFSET_NONE,
stream->caps, &newbuf) != GST_FLOW_OK) { newlen, stream->caps, &newbuf) != GST_FLOW_OK) {
return TRUE; /* not an error, pad might not be linked */ return TRUE; /* not an error, pad might not be linked */
} }

View file

@ -285,8 +285,10 @@ gst_multipart_demux_chain (GstPad * pad, GstBuffer * buf)
gst_multipart_find_pad_by_mime (multipart, gst_multipart_find_pad_by_mime (multipart,
multipart->parsing_mime, &created); multipart->parsing_mime, &created);
if (srcpad != NULL) { if (srcpad != NULL) {
ret = gst_pad_alloc_buffer (srcpad->pad, GST_BUFFER_OFFSET_NONE, ret =
datalen, GST_PAD_CAPS (srcpad->pad), &outbuf); 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) { if (ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (multipart, "failed allocating a %d bytes " GST_WARNING_OBJECT (multipart, "failed allocating a %d bytes "
"buffer", datalen); "buffer", datalen);

View file

@ -461,8 +461,9 @@ gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
headerlen = strlen (header); headerlen = strlen (header);
newlen = headerlen + GST_BUFFER_SIZE (best->buffer); newlen = headerlen + GST_BUFFER_SIZE (best->buffer);
ret = gst_pad_alloc_buffer (mux->srcpad, GST_BUFFER_OFFSET_NONE, newlen, ret =
GST_PAD_CAPS (mux->srcpad), &newbuf); 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) { if (ret != GST_FLOW_OK) {
GST_WARNING_OBJECT (mux, "failed allocating a %d bytes buffer", newlen); GST_WARNING_OBJECT (mux, "failed allocating a %d bytes buffer", newlen);
g_free (header); g_free (header);

View file

@ -1044,7 +1044,7 @@ gst_videomixer_loop (GstElement * element)
outsize = ROUND_UP_2 (mix->out_width) * ROUND_UP_2 (mix->out_height) * 4; 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) { switch (mix->background) {
case VIDEO_MIXER_BACKGROUND_CHECKER: case VIDEO_MIXER_BACKGROUND_CHECKER:
gst_videomixer_fill_checker (GST_BUFFER_DATA (outbuf), gst_videomixer_fill_checker (GST_BUFFER_DATA (outbuf),
@ -1106,12 +1106,14 @@ gst_videomixer_collected (GstCollectPads * pads, GstVideoMixer * mix)
mix->out_width = mix->in_width; mix->out_width = mix->in_width;
mix->out_height = mix->in_height; mix->out_height = mix->in_height;
ret = gst_pad_alloc_buffer (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize, ret =
newcaps, &outbuf); gst_pad_alloc_buffer_and_set_caps (mix->srcpad, GST_BUFFER_OFFSET_NONE,
outsize, newcaps, &outbuf);
gst_caps_unref (newcaps); gst_caps_unref (newcaps);
} else { /* Otherwise we just allocate a buffer from current caps */ } else { /* Otherwise we just allocate a buffer from current caps */
ret = gst_pad_alloc_buffer (mix->srcpad, GST_BUFFER_OFFSET_NONE, outsize, ret =
GST_PAD_CAPS (mix->srcpad), &outbuf); 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 (ret != GST_FLOW_OK) {

View file

@ -665,8 +665,10 @@ gst_wavenc_chain (GstPad * pad, GstBuffer * buf)
if (wavenc->flush_header) { if (wavenc->flush_header) {
GstBuffer *outbuf; GstBuffer *outbuf;
result = gst_pad_alloc_buffer (wavenc->srcpad, GST_BUFFER_OFFSET_NONE, result =
WAV_HEADER_LEN, GST_PAD_CAPS (wavenc->srcpad), &outbuf); 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) { if (result != GST_FLOW_OK) {
GST_WARNING_OBJECT (wavenc, "failed when allocating a %d bytes buffer " GST_WARNING_OBJECT (wavenc, "failed when allocating a %d bytes buffer "
"for headers", WAV_HEADER_LEN); "for headers", WAV_HEADER_LEN);