diff --git a/modules/audio_coding/acm2/audio_coding_module.cc b/modules/audio_coding/acm2/audio_coding_module.cc index 2c96fc45bb..f0b35ca0ae 100644 --- a/modules/audio_coding/acm2/audio_coding_module.cc +++ b/modules/audio_coding/acm2/audio_coding_module.cc @@ -50,15 +50,9 @@ class AudioCodingModuleImpl final : public AudioCodingModule { void ModifyEncoder(rtc::FunctionView*)> modifier) override; - void QueryEncoder( - rtc::FunctionView query) override; - // Get current send codec. absl::optional SendCodec() const override; - // Get current send frequency. - int SendFrequency() const override; - // Sets the bitrate to the specified value in bits/sec. In case the codec does // not support the requested value it will choose an appropriate value // instead. @@ -592,12 +586,6 @@ void AudioCodingModuleImpl::ModifyEncoder( modifier(&encoder_stack_); } -void AudioCodingModuleImpl::QueryEncoder( - rtc::FunctionView query) { - rtc::CritScope lock(&acm_crit_sect_); - query(encoder_stack_.get()); -} - // Get current send codec. absl::optional AudioCodingModuleImpl::SendCodec() const { rtc::CritScope lock(&acm_crit_sect_); @@ -621,18 +609,6 @@ absl::optional AudioCodingModuleImpl::SendCodec() const { } } -// Get current send frequency. -int AudioCodingModuleImpl::SendFrequency() const { - rtc::CritScope lock(&acm_crit_sect_); - - if (!encoder_stack_) { - RTC_LOG(LS_ERROR) << "SendFrequency Failed, no codec is registered"; - return -1; - } - - return encoder_stack_->SampleRateHz(); -} - void AudioCodingModuleImpl::SetBitRate(int bitrate_bps) { rtc::CritScope lock(&acm_crit_sect_); if (encoder_stack_) { @@ -1284,12 +1260,4 @@ int AudioCodingModule::Codec(const char* payload_name, return i ? *i : -1; } -// Checks the validity of the parameters of the given codec -bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { - bool valid = acm2::RentACodec::IsCodecValid(codec); - if (!valid) - RTC_LOG(LS_ERROR) << "Invalid codec setting"; - return valid; -} - } // namespace webrtc diff --git a/modules/audio_coding/acm2/rent_a_codec.cc b/modules/audio_coding/acm2/rent_a_codec.cc index 818e17f3b5..264c2a8cf5 100644 --- a/modules/audio_coding/acm2/rent_a_codec.cc +++ b/modules/audio_coding/acm2/rent_a_codec.cc @@ -80,10 +80,6 @@ absl::optional RentACodec::CodecInstByParams( return ci; } -bool RentACodec::IsCodecValid(const CodecInst& codec_inst) { - return ACMCodecDB::CodecNumber(codec_inst) >= 0; -} - absl::optional RentACodec::IsSupportedNumChannels(CodecId codec_id, size_t num_channels) { auto i = CodecIndexFromId(codec_id); diff --git a/modules/audio_coding/acm2/rent_a_codec.h b/modules/audio_coding/acm2/rent_a_codec.h index 5de7815682..b0ad382d8a 100644 --- a/modules/audio_coding/acm2/rent_a_codec.h +++ b/modules/audio_coding/acm2/rent_a_codec.h @@ -128,7 +128,6 @@ class RentACodec { static absl::optional CodecInstByParams(const char* payload_name, int sampling_freq_hz, size_t channels); - static bool IsCodecValid(const CodecInst& codec_inst); static inline bool IsPayloadTypeValid(int payload_type) { return payload_type >= 0 && payload_type <= 127; diff --git a/modules/audio_coding/include/audio_coding_module.h b/modules/audio_coding/include/audio_coding_module.h index 454e0e42b7..840a719fa1 100644 --- a/modules/audio_coding/include/audio_coding_module.h +++ b/modules/audio_coding/include/audio_coding_module.h @@ -150,20 +150,6 @@ class AudioCodingModule { int sampling_freq_hz, size_t channels); - /////////////////////////////////////////////////////////////////////////// - // bool IsCodecValid() - // Checks the validity of the parameters of the given codec. - // - // Input: - // -codec : the structure which keeps the parameters of the - // codec. - // - // Return value: - // true if the parameters are valid, - // false if any parameter is not valid. - // - static bool IsCodecValid(const CodecInst& codec); - /////////////////////////////////////////////////////////////////////////// // Sender // @@ -210,11 +196,6 @@ class AudioCodingModule { virtual void ModifyEncoder( rtc::FunctionView*)> modifier) = 0; - // |modifier| is called exactly once with one argument: a const pointer to the - // current encoder (which is null if there is no current encoder). - virtual void QueryEncoder( - rtc::FunctionView query) = 0; - // Utility method for simply replacing the existing encoder with a new one. void SetEncoder(std::unique_ptr new_encoder) { ModifyEncoder([&](std::unique_ptr* encoder) { @@ -231,16 +212,6 @@ class AudioCodingModule { // virtual absl::optional SendCodec() const = 0; - /////////////////////////////////////////////////////////////////////////// - // int32_t SendFrequency() - // Get the sampling frequency of the current encoder in Hertz. - // - // Return value: - // positive; sampling frequency [Hz] of the current encoder. - // -1 if an error has happened. - // - virtual int32_t SendFrequency() const = 0; - /////////////////////////////////////////////////////////////////////////// // Sets the bitrate to the specified value in bits/sec. If the value is not // supported by the codec, it will choose another appropriate value.