audiodecoders: use default pad accept-caps handling

Avoids useless check of downstream caps when handling an
accept-caps query

Elements: a52dec, amrnbdec, amrwbdec, mad
This commit is contained in:
Thiago Santos 2015-08-15 11:46:13 -03:00
parent ba2a874ffc
commit 79bfd0f42c
4 changed files with 12 additions and 0 deletions

View file

@ -229,6 +229,10 @@ gst_a52dec_init (GstA52Dec * a52dec)
a52dec->state = NULL;
a52dec->samples = NULL;
gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
(a52dec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (a52dec));
/* retrieve and intercept base class chain.
* Quite HACKish, but that's dvd specs/caps for you,
* since one buffer needs to be split into 2 frames */

View file

@ -144,6 +144,9 @@ static void
gst_amrnbdec_init (GstAmrnbDec * amrnbdec)
{
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrnbdec), TRUE);
gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
(amrnbdec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (amrnbdec));
}
static gboolean

View file

@ -107,6 +107,9 @@ static void
gst_amrwbdec_init (GstAmrwbDec * amrwbdec)
{
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrwbdec), TRUE);
gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
(amrwbdec), TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (amrwbdec));
}
static gboolean

View file

@ -144,6 +144,8 @@ gst_mad_init (GstMad * mad)
dec = GST_AUDIO_DECODER (mad);
gst_audio_decoder_set_tolerance (dec, 20 * GST_MSECOND);
gst_audio_decoder_set_use_default_pad_acceptcaps (dec, TRUE);
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dec));
mad->half = FALSE;
mad->ignore_crc = TRUE;