From: Andy Wingo Date: Mon, 5 Dec 2005 13:03:00 +0000 (+0000) Subject: Update for alloc_buffer changes. X-Git-Tag: RELEASE-0_10_0~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fbfd29bbe207f93ce17bf52ba1bc46c78cf25d2;p=platform%2Fupstream%2Fgst-plugins-good.git Update for alloc_buffer changes. Original commit message from CVS: 2005-12-05 Andy Wingo * 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. --- diff --git a/ChangeLog b/ChangeLog index 0b6c27abe..ca46d5659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2005-12-05 Andy Wingo + + * 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 * docs/plugins/gst-plugins-good-plugins.args: diff --git a/ext/dv/gstdvdec.c b/ext/dv/gstdvdec.c index 32b75aff1..fb355d0e1 100644 --- a/ext/dv/gstdvdec.c +++ b/ext/dv/gstdvdec.c @@ -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) diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 5f534253c..dc8ed7b2f 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -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; diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index c90e11923..75c837961 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -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; } diff --git a/ext/gdk_pixbuf/gstgdkpixbuf.c b/ext/gdk_pixbuf/gstgdkpixbuf.c index 9a602ea88..34a1678e8 100644 --- a/ext/gdk_pixbuf/gstgdkpixbuf.c +++ b/ext/gdk_pixbuf/gstgdkpixbuf.c @@ -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); diff --git a/ext/gdk_pixbuf/pixbufscale.c b/ext/gdk_pixbuf/pixbufscale.c index 9edef4007..6b52b426a 100644 --- a/ext/gdk_pixbuf/pixbufscale.c +++ b/ext/gdk_pixbuf/pixbufscale.c @@ -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); diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c index 8b26c3d36..0ad04c42f 100644 --- a/ext/jpeg/gstjpegdec.c +++ b/ext/jpeg/gstjpegdec.c @@ -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; diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 490121e9b..2485d2f63 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -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; diff --git a/ext/ladspa/gstsignalprocessor.c b/ext/ladspa/gstsignalprocessor.c index 9caf7b7ba..375ea8395 100644 --- a/ext/ladspa/gstsignalprocessor.c +++ b/ext/ladspa/gstsignalprocessor.c @@ -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; diff --git a/ext/libpng/gstpngdec.c b/ext/libpng/gstpngdec.c index 67a19e7ec..874114a26 100644 --- a/ext/libpng/gstpngdec.c +++ b/ext/libpng/gstpngdec.c @@ -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; diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c index 6cd8374d6..5f68a32bb 100644 --- a/ext/speex/gstspeexdec.c +++ b/ext/speex/gstspeexdec.c @@ -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; diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 9b6022371..777b75ba1 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -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); diff --git a/gst/auparse/gstauparse.c b/gst/auparse/gstauparse.c index 1b5cf540e..d39c239b6 100644 --- a/gst/auparse/gstauparse.c +++ b/gst/auparse/gstauparse.c @@ -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); diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index 93c10fd04..3c0cc0693 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -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); diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index e5a6618db..5e7bd8c56 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -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; diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index d7f46d47c..188bab19a 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -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 */ } diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c index 0138f2636..89e7954f0 100644 --- a/gst/multipart/multipartdemux.c +++ b/gst/multipart/multipartdemux.c @@ -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); diff --git a/gst/multipart/multipartmux.c b/gst/multipart/multipartmux.c index 1c588b69b..44e5d0bd2 100644 --- a/gst/multipart/multipartmux.c +++ b/gst/multipart/multipartmux.c @@ -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); diff --git a/gst/videomixer/videomixer.c b/gst/videomixer/videomixer.c index a71ddcdec..f0f2377c1 100644 --- a/gst/videomixer/videomixer.c +++ b/gst/videomixer/videomixer.c @@ -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) { diff --git a/gst/wavenc/gstwavenc.c b/gst/wavenc/gstwavenc.c index 29cc1f02c..da6b8b7df 100644 --- a/gst/wavenc/gstwavenc.c +++ b/gst/wavenc/gstwavenc.c @@ -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);