From: Thiago Santos Date: Sat, 15 Aug 2015 12:16:23 +0000 (-0300) Subject: audiodecoders: use default pad accept-caps handling X-Git-Tag: 1.6.0~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=65676c22ee6e9494b07f179b799c628a357ac589;p=platform%2Fupstream%2Fgst-plugins-good.git audiodecoders: use default pad accept-caps handling Avoids useless check of downstream caps when handling an accept-caps query Elements: flacdec, speexdec, wavpackdec, mulawdec, alawdec --- diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 62ac391..515ffbd 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -179,6 +179,9 @@ static void gst_flac_dec_init (GstFlacDec * flacdec) { gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (flacdec), TRUE); + gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST + (flacdec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (flacdec)); } static gboolean diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c index 587255d..daceaee 100644 --- a/ext/speex/gstspeexdec.c +++ b/ext/speex/gstspeexdec.c @@ -156,6 +156,9 @@ static void gst_speex_dec_init (GstSpeexDec * dec) { gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE); + gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST + (dec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec)); dec->enh = DEFAULT_ENH; diff --git a/ext/wavpack/gstwavpackdec.c b/ext/wavpack/gstwavpackdec.c index 9f9fd53..f939390 100644 --- a/ext/wavpack/gstwavpackdec.c +++ b/ext/wavpack/gstwavpackdec.c @@ -142,6 +142,9 @@ gst_wavpack_dec_init (GstWavpackDec * dec) dec->stream_reader = gst_wavpack_stream_reader_new (); gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE); + gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST + (dec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec)); gst_wavpack_dec_reset (dec); } diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c index 8ef75d2..88df489 100644 --- a/gst/law/alaw-decode.c +++ b/gst/law/alaw-decode.c @@ -224,4 +224,7 @@ static void gst_alaw_dec_init (GstALawDec * alawdec) { gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (alawdec), TRUE); + gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST + (alawdec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (alawdec)); } diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c index a4bd0a6..4d463bc 100644 --- a/gst/law/mulaw-decode.c +++ b/gst/law/mulaw-decode.c @@ -169,4 +169,7 @@ static void gst_mulawdec_init (GstMuLawDec * mulawdec) { gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (mulawdec), TRUE); + gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST + (mulawdec), TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (mulawdec)); }