From: Wim Taymans Date: Thu, 17 Nov 2011 16:07:41 +0000 (+0100) Subject: Merge branch 'master' into 0.11 X-Git-Tag: RELEASE-0.11.2~345 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7afdff3575a626b776b7ab075f50a8d327e4495a;p=platform%2Fupstream%2Fgst-plugins-base.git Merge branch 'master' into 0.11 Conflicts: gst-libs/gst/audio/gstaudiodecoder.c --- 7afdff3575a626b776b7ab075f50a8d327e4495a diff --cc gst-libs/gst/audio/gstaudiodecoder.c index c9a1ab6cd,a45e4e53b..6fb3ebed5 --- a/gst-libs/gst/audio/gstaudiodecoder.c +++ b/gst-libs/gst/audio/gstaudiodecoder.c @@@ -600,32 -570,85 +597,83 @@@ gst_audio_decoder_push_forward (GstAudi priv = dec->priv; ctx = &dec->priv->ctx; + g_return_val_if_fail (ctx->info.bpf != 0, GST_FLOW_ERROR); + + if (G_UNLIKELY (!buf)) { + g_assert_not_reached (); + return GST_FLOW_OK; + } + + GST_LOG_OBJECT (dec, "clipping buffer of size %d with ts %" GST_TIME_FORMAT - ", duration %" GST_TIME_FORMAT, GST_BUFFER_SIZE (buf), ++ ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buf), + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), + GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); + + /* clip buffer */ + buf = gst_audio_buffer_clip (buf, &dec->segment, ctx->info.rate, + ctx->info.bpf); + if (G_UNLIKELY (!buf)) { + GST_DEBUG_OBJECT (dec, "no data after clipping to segment"); + goto exit; + } + + /* decorate */ - gst_buffer_set_caps (buf, GST_PAD_CAPS (dec->srcpad)); - + if (G_UNLIKELY (priv->discont)) { + GST_LOG_OBJECT (dec, "marking discont"); + GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT); + priv->discont = FALSE; + } + + /* track where we are */ + if (G_LIKELY (GST_BUFFER_TIMESTAMP_IS_VALID (buf))) { + /* duration should always be valid for raw audio */ + g_assert (GST_BUFFER_DURATION_IS_VALID (buf)); - dec->segment.last_stop = ++ dec->segment.position = + GST_BUFFER_TIMESTAMP (buf) + GST_BUFFER_DURATION (buf); + } + + if (klass->pre_push) { + /* last chance for subclass to do some dirty stuff */ + ret = klass->pre_push (dec, &buf); + if (ret != GST_FLOW_OK || !buf) { + GST_DEBUG_OBJECT (dec, "subclass returned %s, buf %p", + gst_flow_get_name (ret), buf); + if (buf) + gst_buffer_unref (buf); + goto exit; + } + } + + GST_LOG_OBJECT (dec, "pushing buffer of size %d with ts %" GST_TIME_FORMAT - ", duration %" GST_TIME_FORMAT, GST_BUFFER_SIZE (buf), ++ ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buf), + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), + GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); + + ret = gst_pad_push (dec->srcpad, buf); + + exit: + return ret; + } + + /* mini aggregator combining output buffers into fewer larger ones, + * if so allowed/configured */ + static GstFlowReturn + gst_audio_decoder_output (GstAudioDecoder * dec, GstBuffer * buf) + { + GstAudioDecoderPrivate *priv; + GstFlowReturn ret = GST_FLOW_OK; + GstBuffer *inbuf = NULL; + + priv = dec->priv; + if (G_UNLIKELY (priv->agg < 0)) gst_audio_decoder_setup (dec); if (G_LIKELY (buf)) { - g_return_val_if_fail (ctx->info.bpf != 0, GST_FLOW_ERROR); - - GST_LOG_OBJECT (dec, - "output buffer of size %" G_GSIZE_FORMAT " with ts %" GST_TIME_FORMAT + GST_LOG_OBJECT (dec, "output buffer of size %d with ts %" GST_TIME_FORMAT - ", duration %" GST_TIME_FORMAT, GST_BUFFER_SIZE (buf), + ", duration %" GST_TIME_FORMAT, gst_buffer_get_size (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); - - /* clip buffer */ - buf = gst_audio_buffer_clip (buf, &dec->segment, ctx->info.rate, - ctx->info.bpf); - if (G_UNLIKELY (!buf)) { - GST_DEBUG_OBJECT (dec, "no data after clipping to segment"); - } else { - GST_LOG_OBJECT (dec, - "buffer after segment clipping has size %" G_GSIZE_FORMAT " with ts %" - GST_TIME_FORMAT ", duration %" GST_TIME_FORMAT, - gst_buffer_get_size (buf), GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)), - GST_TIME_ARGS (GST_BUFFER_DURATION (buf))); - } - } else { - GST_DEBUG_OBJECT (dec, "no output buffer"); } again: diff --cc gst-libs/gst/audio/gstaudioencoder.c index 485087228,14064f03b..81f61b5f1 --- a/gst-libs/gst/audio/gstaudioencoder.c +++ b/gst-libs/gst/audio/gstaudioencoder.c @@@ -1082,11 -1071,15 +1082,18 @@@ gst_audio_encoder_sink_setcaps (GstAudi GST_OBJECT_UNLOCK (enc); if (klass->set_format) - res = klass->set_format (enc, state); + res = klass->set_format (enc, &state); + + if (res) + ctx->info = state; + /* invalidate state to ensure no casual carrying on */ + if (!res) { + GST_DEBUG_OBJECT (enc, "subclass did not accept format"); - gst_audio_info_clear (state); ++ gst_audio_info_init (&state); + goto exit; + } + /* notify if new latency */ GST_OBJECT_LOCK (enc); if ((ctx->min_latency > 0 && ctx->min_latency != old_min_latency) || diff --cc gst-libs/gst/rtp/gstrtcpbuffer.h index 2a9d41ae3,aec9232f3..da8dce26d --- a/gst-libs/gst/rtp/gstrtcpbuffer.h +++ b/gst-libs/gst/rtp/gstrtcpbuffer.h @@@ -82,10 -92,15 +92,15 @@@ typedef enu GST_RTCP_PSFB_TYPE_PLI = 1, GST_RTCP_PSFB_TYPE_SLI = 2, GST_RTCP_PSFB_TYPE_RPSI = 3, - GST_RTCP_PSFB_TYPE_AFB = 15 + GST_RTCP_PSFB_TYPE_AFB = 15, + /* PSFB types assigned in RFC 5104 */ + GST_RTCP_PSFB_TYPE_FIR = 4, + GST_RTCP_PSFB_TYPE_TSTR = 5, + GST_RTCP_PSFB_TYPE_TSTN = 6, + GST_RTCP_PSFB_TYPE_VBCN = 7, } GstRTCPFBType; -/** +/** * GstRTCPSDESType: * @GST_RTCP_SDES_INVALID: Invalid SDES entry * @GST_RTCP_SDES_END: End of SDES list