mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
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:
parent
ba2a874ffc
commit
79bfd0f42c
4 changed files with 12 additions and 0 deletions
|
@ -229,6 +229,10 @@ gst_a52dec_init (GstA52Dec * a52dec)
|
||||||
a52dec->state = NULL;
|
a52dec->state = NULL;
|
||||||
a52dec->samples = 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.
|
/* retrieve and intercept base class chain.
|
||||||
* Quite HACKish, but that's dvd specs/caps for you,
|
* Quite HACKish, but that's dvd specs/caps for you,
|
||||||
* since one buffer needs to be split into 2 frames */
|
* since one buffer needs to be split into 2 frames */
|
||||||
|
|
|
@ -144,6 +144,9 @@ static void
|
||||||
gst_amrnbdec_init (GstAmrnbDec * amrnbdec)
|
gst_amrnbdec_init (GstAmrnbDec * amrnbdec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrnbdec), TRUE);
|
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
|
static gboolean
|
||||||
|
|
|
@ -107,6 +107,9 @@ static void
|
||||||
gst_amrwbdec_init (GstAmrwbDec * amrwbdec)
|
gst_amrwbdec_init (GstAmrwbDec * amrwbdec)
|
||||||
{
|
{
|
||||||
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (amrwbdec), TRUE);
|
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
|
static gboolean
|
||||||
|
|
|
@ -144,6 +144,8 @@ gst_mad_init (GstMad * mad)
|
||||||
|
|
||||||
dec = GST_AUDIO_DECODER (mad);
|
dec = GST_AUDIO_DECODER (mad);
|
||||||
gst_audio_decoder_set_tolerance (dec, 20 * GST_MSECOND);
|
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->half = FALSE;
|
||||||
mad->ignore_crc = TRUE;
|
mad->ignore_crc = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue