Commit 7fbfd29b authored by Andy Wingo's avatar Andy Wingo

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.
parent c28031af
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:
......
......@@ -273,7 +273,7 @@ gst_dvdec_chain (GstPad * pad, GstBuffer * buf)
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)
......
......@@ -488,9 +488,10 @@ gst_flacdec_write (const FLAC__SeekableStreamDecoder * decoder,
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;
......
......@@ -538,8 +538,8 @@ gst_flacenc_write_callback (const FLAC__SeekableStreamEncoder * encoder,
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;
}
......
......@@ -329,8 +329,9 @@ gst_gdk_pixbuf_chain (GstPad * pad, GstData * _data)
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);
......
......@@ -409,7 +409,7 @@ gst_pixbufscale_chain (GstPad * pad, GstData * _data)
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);
......
......@@ -815,7 +815,7 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * 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;
......
......@@ -411,8 +411,10 @@ gst_jpegenc_chain (GstPad * pad, GstBuffer * buf)
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;
......
......@@ -325,8 +325,9 @@ gst_signal_processor_process (GstSignalProcessor * self)
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;
......
......@@ -192,7 +192,8 @@ user_info_callback (png_structp png_ptr, png_infop info)
/* 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;
......@@ -397,7 +398,8 @@ gst_pngdec_task (GstPad * pad)
/* 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;
......
......@@ -478,7 +478,9 @@ speex_dec_chain (GstPad * pad, GstBuffer * buf)
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;
......
......@@ -996,7 +996,7 @@ gst_speexenc_chain (GstPad * pad, GstBuffer * buf)
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);
......
......@@ -388,8 +388,9 @@ Samples :
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);
......
......@@ -554,7 +554,7 @@ gst_flxdec_chain (GstPad * pad, GstBuffer * buf)
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);
......
......@@ -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);
if (ret != GST_FLOW_OK)
break;
......
......@@ -2005,7 +2005,7 @@ gst_matroska_demux_push_vorbis_codec_priv_data (GstMatroskaDemux * demux,
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);
......@@ -2016,8 +2016,8 @@ gst_matroska_demux_push_vorbis_codec_priv_data (GstMatroskaDemux * demux,
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)
......@@ -2063,8 +2063,8 @@ gst_matroska_demux_add_wvpk_header (GstMatroskaTrackContext * stream,
/* 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 */
}
......
......@@ -285,8 +285,10 @@ gst_multipart_demux_chain (GstPad * pad, GstBuffer * buf)
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);
......
......@@ -461,8 +461,9 @@ gst_multipart_mux_collected (GstCollectPads * pads, GstMultipartMux * mux)
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);
......
......@@ -1044,7 +1044,7 @@ gst_videomixer_loop (GstElement * element)
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),
......@@ -1106,12 +1106,14 @@ gst_videomixer_collected (GstCollectPads * pads, GstVideoMixer * mix)
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) {
......
......@@ -665,8 +665,10 @@ gst_wavenc_chain (GstPad * pad, GstBuffer * buf)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment