mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
audioencoders: use template subset check for accept-caps
It is faster than doing a query that propagates downstream and should be enough Elements: faac, gsmenc, opusenc, sbcenc, voamrwbenc, adpcmenc, sirenenc
This commit is contained in:
parent
6135ebebee
commit
6517282af7
8 changed files with 11 additions and 0 deletions
|
@ -243,6 +243,7 @@ gst_faac_class_init (GstFaacClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_faac_init (GstFaac * faac)
|
gst_faac_init (GstFaac * faac)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (faac));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -97,6 +97,7 @@ gst_gsmenc_class_init (GstGSMEncClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_gsmenc_init (GstGSMEnc * gsmenc)
|
gst_gsmenc_init (GstGSMEnc * gsmenc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (gsmenc));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
|
@ -376,6 +376,8 @@ gst_opus_enc_init (GstOpusEnc * enc)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (enc, "init");
|
GST_DEBUG_OBJECT (enc, "init");
|
||||||
|
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc));
|
||||||
|
|
||||||
g_mutex_init (&enc->property_lock);
|
g_mutex_init (&enc->property_lock);
|
||||||
|
|
||||||
enc->n_channels = -1;
|
enc->n_channels = -1;
|
||||||
|
|
|
@ -362,6 +362,7 @@ gst_sbc_enc_class_init (GstSbcEncClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_sbc_enc_init (GstSbcEnc * self)
|
gst_sbc_enc_init (GstSbcEnc * self)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (self));
|
||||||
self->subbands = 0;
|
self->subbands = 0;
|
||||||
self->blocks = 0;
|
self->blocks = 0;
|
||||||
self->rate = 0;
|
self->rate = 0;
|
||||||
|
|
|
@ -177,6 +177,7 @@ gst_voaacenc_class_init (GstVoAacEncClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_voaacenc_init (GstVoAacEnc * voaacenc)
|
gst_voaacenc_init (GstVoAacEnc * voaacenc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (voaacenc));
|
||||||
voaacenc->bitrate = VOAAC_ENC_DEFAULT_BITRATE;
|
voaacenc->bitrate = VOAAC_ENC_DEFAULT_BITRATE;
|
||||||
voaacenc->output_format = VOAAC_ENC_DEFAULT_OUTPUTFORMAT;
|
voaacenc->output_format = VOAAC_ENC_DEFAULT_OUTPUTFORMAT;
|
||||||
|
|
||||||
|
|
|
@ -190,6 +190,8 @@ gst_voamrwbenc_class_init (GstVoAmrWbEncClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_voamrwbenc_init (GstVoAmrWbEnc * amrwbenc)
|
gst_voamrwbenc_init (GstVoAmrWbEnc * amrwbenc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (amrwbenc));
|
||||||
|
|
||||||
/* init rest */
|
/* init rest */
|
||||||
amrwbenc->handle = NULL;
|
amrwbenc->handle = NULL;
|
||||||
amrwbenc->channels = 0;
|
amrwbenc->channels = 0;
|
||||||
|
|
|
@ -421,6 +421,8 @@ adpcmenc_stop (GstAudioEncoder * enc)
|
||||||
static void
|
static void
|
||||||
adpcmenc_init (ADPCMEnc * enc)
|
adpcmenc_init (ADPCMEnc * enc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc));
|
||||||
|
|
||||||
/* Set defaults. */
|
/* Set defaults. */
|
||||||
enc->blocksize = DEFAULT_ADPCM_BLOCK_SIZE;
|
enc->blocksize = DEFAULT_ADPCM_BLOCK_SIZE;
|
||||||
enc->layout = DEFAULT_ADPCM_LAYOUT;
|
enc->layout = DEFAULT_ADPCM_LAYOUT;
|
||||||
|
|
|
@ -92,6 +92,7 @@ gst_siren_enc_class_init (GstSirenEncClass * klass)
|
||||||
static void
|
static void
|
||||||
gst_siren_enc_init (GstSirenEnc * enc)
|
gst_siren_enc_init (GstSirenEnc * enc)
|
||||||
{
|
{
|
||||||
|
GST_PAD_SET_ACCEPT_TEMPLATE (GST_AUDIO_ENCODER_SINK_PAD (enc));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue