mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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
This commit is contained in:
parent
16fbd4f86f
commit
65676c22ee
5 changed files with 15 additions and 0 deletions
|
@ -179,6 +179,9 @@ static void
|
||||||
gst_flac_dec_init (GstFlacDec * flacdec)
|
gst_flac_dec_init (GstFlacDec * flacdec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (flacdec), TRUE);
|
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
|
static gboolean
|
||||||
|
|
|
@ -156,6 +156,9 @@ static void
|
||||||
gst_speex_dec_init (GstSpeexDec * dec)
|
gst_speex_dec_init (GstSpeexDec * dec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
|
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;
|
dec->enh = DEFAULT_ENH;
|
||||||
|
|
||||||
|
|
|
@ -142,6 +142,9 @@ gst_wavpack_dec_init (GstWavpackDec * dec)
|
||||||
dec->stream_reader = gst_wavpack_stream_reader_new ();
|
dec->stream_reader = gst_wavpack_stream_reader_new ();
|
||||||
|
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (dec), TRUE);
|
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);
|
gst_wavpack_dec_reset (dec);
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,4 +224,7 @@ static void
|
||||||
gst_alaw_dec_init (GstALawDec * alawdec)
|
gst_alaw_dec_init (GstALawDec * alawdec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (alawdec), TRUE);
|
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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -169,4 +169,7 @@ static void
|
||||||
gst_mulawdec_init (GstMuLawDec * mulawdec)
|
gst_mulawdec_init (GstMuLawDec * mulawdec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (mulawdec), TRUE);
|
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));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue