From a1aa942acf4a14b4538994cb0735486542a979cd Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Sat, 15 Aug 2015 22:32:21 -0300 Subject: [PATCH] audioencoders: use template subset check for accept-caps It is faster than doing a query that propagates downstream and should be enough Elements: speexenc, wavpackenc, mulawenc, alawenc --- ext/speex/gstspeexenc.c | 1 + ext/wavpack/gstwavpackenc.c | 2 ++ gst/law/alaw-encode.c | 1 + gst/law/mulaw-encode.c | 2 +- 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 79b3cb3ac7..31712b6878 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -242,6 +242,7 @@ gst_speex_enc_init (GstSpeexEnc * enc) /* arrange granulepos marking (and required perfect ts) */ gst_audio_encoder_set_mark_granule (benc, TRUE); gst_audio_encoder_set_perfect_timestamp (benc, TRUE); + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc)); } static gboolean diff --git a/ext/wavpack/gstwavpackenc.c b/ext/wavpack/gstwavpackenc.c index 386524b406..95a8e8f569 100644 --- a/ext/wavpack/gstwavpackenc.c +++ b/ext/wavpack/gstwavpackenc.c @@ -345,6 +345,8 @@ gst_wavpack_enc_init (GstWavpackEnc * enc) /* require perfect ts */ gst_audio_encoder_set_perfect_timestamp (benc, TRUE); + + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc)); } diff --git a/gst/law/alaw-encode.c b/gst/law/alaw-encode.c index f1e033271f..ebee1920fe 100644 --- a/gst/law/alaw-encode.c +++ b/gst/law/alaw-encode.c @@ -423,4 +423,5 @@ gst_alaw_enc_class_init (GstALawEncClass * klass) static void gst_alaw_enc_init (GstALawEnc * alawenc) { + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (alawenc)); } diff --git a/gst/law/mulaw-encode.c b/gst/law/mulaw-encode.c index e92e5e6d17..2e0b14b967 100644 --- a/gst/law/mulaw-encode.c +++ b/gst/law/mulaw-encode.c @@ -207,5 +207,5 @@ gst_mulawenc_class_init (GstMuLawEncClass * klass) static void gst_mulawenc_init (GstMuLawEnc * mulawenc) { - + GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (mulawenc)); }