diff --git a/modules/audio_coding/acm2/acm_codec_database.cc b/modules/audio_coding/acm2/acm_codec_database.cc index 879082cef0..cada80c061 100644 --- a/modules/audio_coding/acm2/acm_codec_database.cc +++ b/modules/audio_coding/acm2/acm_codec_database.cc @@ -298,7 +298,7 @@ int ACMCodecDB::CodecId(const CodecInst& codec_inst) { int ACMCodecDB::CodecId(const char* payload_name, int frequency, size_t channels) { - for (const CodecInst& ci : RentACodec::Database()) { + for (const CodecInst& ci : database_) { bool name_match = false; bool frequency_match = false; bool channels_match = false; @@ -318,7 +318,7 @@ int ACMCodecDB::CodecId(const char* payload_name, if (name_match && frequency_match && channels_match) { // We have found a matching codec in the list. - return &ci - RentACodec::Database().data(); + return &ci - database_; } } diff --git a/modules/audio_coding/acm2/rent_a_codec.cc b/modules/audio_coding/acm2/rent_a_codec.cc index d7457b8ad7..bfddc42bc9 100644 --- a/modules/audio_coding/acm2/rent_a_codec.cc +++ b/modules/audio_coding/acm2/rent_a_codec.cc @@ -29,7 +29,8 @@ absl::optional RentACodec::CodecIdByParams( absl::optional RentACodec::CodecInstById(CodecId codec_id) { absl::optional mi = CodecIndexFromId(codec_id); - return mi ? absl::optional(Database()[*mi]) : absl::nullopt; + return mi ? absl::optional(ACMCodecDB::database_[*mi]) + : absl::nullopt; } absl::optional RentACodec::CodecIdByInst( @@ -55,20 +56,6 @@ absl::optional RentACodec::CodecInstByParams( return ci; } -absl::optional RentACodec::IsSupportedNumChannels(CodecId codec_id, - size_t num_channels) { - auto i = CodecIndexFromId(codec_id); - return i ? absl::optional( - ACMCodecDB::codec_settings_[*i].channel_support >= - num_channels) - : absl::nullopt; -} - -rtc::ArrayView RentACodec::Database() { - return rtc::ArrayView(ACMCodecDB::database_, - NumberOfCodecs()); -} - absl::optional RentACodec::NetEqDecoderFromCodecId( CodecId codec_id, size_t num_channels) { diff --git a/modules/audio_coding/acm2/rent_a_codec.h b/modules/audio_coding/acm2/rent_a_codec.h index afac3b1774..2cf1c6e18c 100644 --- a/modules/audio_coding/acm2/rent_a_codec.h +++ b/modules/audio_coding/acm2/rent_a_codec.h @@ -132,11 +132,6 @@ struct RentACodec { return payload_type >= 0 && payload_type <= 127; } - static rtc::ArrayView Database(); - - static absl::optional IsSupportedNumChannels(CodecId codec_id, - size_t num_channels); - static absl::optional NetEqDecoderFromCodecId( CodecId codec_id, size_t num_channels);