summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Santos <thiagoss@osg.samsung.com>2015-08-15 12:58:40 -0300
committerThiago Santos <thiagoss@osg.samsung.com>2015-08-15 13:51:16 -0300
commit56b822f9f675bb3afeded9e5420bd0d126b5917a (patch)
treef9017dffd5c0efac8a1292475374970863ecb744
parenta5ed877783e67bb1d4bc34ac54e2770137e1ad8a (diff)
audiodecoders: use default pad accept-caps handling
Avoids useless check of downstream caps when handling an accept-caps query Elements: dtsdec, faad, gsmdec, mpg123audiodec, opusdec, sbcdec, adpcmdec, sirendec
-rw-r--r--ext/dts/gstdtsdec.c4
-rw-r--r--ext/faad/gstfaad.c3
-rw-r--r--ext/gsm/gstgsmdec.c3
-rw-r--r--ext/mpg123/gstmpg123audiodec.c3
-rw-r--r--ext/opus/gstopusdec.c3
-rw-r--r--ext/sbc/gstsbcdec.c3
-rw-r--r--gst/adpcmdec/adpcmdec.c3
-rw-r--r--gst/siren/gstsirendec.c3
8 files changed, 25 insertions, 0 deletions
diff --git a/ext/dts/gstdtsdec.c b/ext/dts/gstdtsdec.c
index a593eee32..b7260861d 100644
--- a/ext/dts/gstdtsdec.c
+++ b/ext/dts/gstdtsdec.c
@@ -209,6 +209,10 @@ gst_dtsdec_init (GstDtsDec * dtsdec)
dtsdec->request_channels = DCA_CHANNEL;
dtsdec->dynamic_range_compression = FALSE;
+ gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
+ (dtsdec), TRUE);
+ GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (dtsdec));
+
/* retrieve and intercept base class chain.
* Quite HACKish, but that's dvd specs for you,
* since one buffer needs to be split into 2 frames */
diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c
index 918d636a8..65a3f8950 100644
--- a/ext/faad/gstfaad.c
+++ b/ext/faad/gstfaad.c
@@ -175,6 +175,9 @@ gst_faad_class_init (GstFaadClass * klass)
static void
gst_faad_init (GstFaad * faad)
{
+ gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
+ (faad), TRUE);
+ GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (faad));
gst_faad_reset (faad);
}
diff --git a/ext/gsm/gstgsmdec.c b/ext/gsm/gstgsmdec.c
index 33b39507b..e02631f5a 100644
--- a/ext/gsm/gstgsmdec.c
+++ b/ext/gsm/gstgsmdec.c
@@ -105,6 +105,9 @@ static void
gst_gsmdec_init (GstGSMDec * gsmdec)
{
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (gsmdec), TRUE);
+ gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
+ (gsmdec), TRUE);
+ GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (gsmdec));
}
static gboolean
diff --git a/ext/mpg123/gstmpg123audiodec.c b/ext/mpg123/gstmpg123audiodec.c
index 60d197971..46f6db962 100644
--- a/ext/mpg123/gstmpg123audiodec.c
+++ b/ext/mpg123/gstmpg123audiodec.c
@@ -197,6 +197,9 @@ gst_mpg123_audio_dec_init (GstMpg123AudioDec * mpg123_decoder)
{
mpg123_decoder->handle = NULL;
gst_audio_decoder_set_needs_format (GST_AUDIO_DECODER (mpg123_decoder), TRUE);
+ gst_audio_decoder_set_use_default_pad_acceptcaps (GST_AUDIO_DECODER_CAST
+ (mpg123_decoder), TRUE);
+ GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_DECODER_SINK_PAD (mpg123_decoder));
}
diff --git a/ext/opus/gstopusdec.c b/ext/opus/gstopusdec.c
index 20eb44245..d8a7eb85f 100644
--- a/ext/opus/gstopusdec.c
+++ b/ext/opus/gstopusdec.c
@@ -167,6 +167,9 @@ gst_opus_dec_init (GstOpusDec * dec)
dec->apply_gain = DEFAULT_APPLY_GAIN;
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_opus_dec_reset (dec);
}
diff --git a/ext/sbc/gstsbcdec.c b/ext/sbc/gstsbcdec.c
index 9e2eb5b90..5031dd922 100644
--- a/ext/sbc/gstsbcdec.c
+++ b/ext/sbc/gstsbcdec.c
@@ -236,6 +236,9 @@ static void
gst_sbc_dec_init (GstSbcDec * 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->samples_per_frame = 0;
dec->frame_len = 0;
diff --git a/gst/adpcmdec/adpcmdec.c b/gst/adpcmdec/adpcmdec.c
index 9e735f333..83289ba1c 100644
--- a/gst/adpcmdec/adpcmdec.c
+++ b/gst/adpcmdec/adpcmdec.c
@@ -456,6 +456,9 @@ static void
adpcmdec_init (ADPCMDec * 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));
}
static void
diff --git a/gst/siren/gstsirendec.c b/gst/siren/gstsirendec.c
index 7a3ae4b28..ab0635a9c 100644
--- a/gst/siren/gstsirendec.c
+++ b/gst/siren/gstsirendec.c
@@ -96,6 +96,9 @@ static void
gst_siren_dec_init (GstSirenDec * 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));
}
static gboolean