From 105edcaeaf85882b132ea49b38e26360af517305 Mon Sep 17 00:00:00 2001 From: Karl Wiberg Date: Tue, 13 Nov 2018 12:06:02 +0100 Subject: [PATCH] Remove some unused RentACodec static methods We want to get rid of the whole thing, really, but these two were easy. Bug: webrtc:8396 Change-Id: I9292bf077caca171c9f5fe63695b6333cf22547d Reviewed-on: https://webrtc-review.googlesource.com/c/104763 Commit-Queue: Karl Wiberg Reviewed-by: Ivo Creusen Cr-Commit-Position: refs/heads/master@{#25618} --- modules/audio_coding/acm2/acm_codec_database.cc | 4 ++-- modules/audio_coding/acm2/rent_a_codec.cc | 17 ++--------------- modules/audio_coding/acm2/rent_a_codec.h | 5 ----- 3 files changed, 4 insertions(+), 22 deletions(-) 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);