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 <kwiberg@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25618}
This commit is contained in:
Karl Wiberg
2018-11-13 12:06:02 +01:00
committed by Commit Bot
parent a33c89510f
commit 105edcaeaf
3 changed files with 4 additions and 22 deletions

View File

@ -298,7 +298,7 @@ int ACMCodecDB::CodecId(const CodecInst& codec_inst) {
int ACMCodecDB::CodecId(const char* payload_name, int ACMCodecDB::CodecId(const char* payload_name,
int frequency, int frequency,
size_t channels) { size_t channels) {
for (const CodecInst& ci : RentACodec::Database()) { for (const CodecInst& ci : database_) {
bool name_match = false; bool name_match = false;
bool frequency_match = false; bool frequency_match = false;
bool channels_match = false; bool channels_match = false;
@ -318,7 +318,7 @@ int ACMCodecDB::CodecId(const char* payload_name,
if (name_match && frequency_match && channels_match) { if (name_match && frequency_match && channels_match) {
// We have found a matching codec in the list. // We have found a matching codec in the list.
return &ci - RentACodec::Database().data(); return &ci - database_;
} }
} }

View File

@ -29,7 +29,8 @@ absl::optional<RentACodec::CodecId> RentACodec::CodecIdByParams(
absl::optional<CodecInst> RentACodec::CodecInstById(CodecId codec_id) { absl::optional<CodecInst> RentACodec::CodecInstById(CodecId codec_id) {
absl::optional<int> mi = CodecIndexFromId(codec_id); absl::optional<int> mi = CodecIndexFromId(codec_id);
return mi ? absl::optional<CodecInst>(Database()[*mi]) : absl::nullopt; return mi ? absl::optional<CodecInst>(ACMCodecDB::database_[*mi])
: absl::nullopt;
} }
absl::optional<RentACodec::CodecId> RentACodec::CodecIdByInst( absl::optional<RentACodec::CodecId> RentACodec::CodecIdByInst(
@ -55,20 +56,6 @@ absl::optional<CodecInst> RentACodec::CodecInstByParams(
return ci; return ci;
} }
absl::optional<bool> RentACodec::IsSupportedNumChannels(CodecId codec_id,
size_t num_channels) {
auto i = CodecIndexFromId(codec_id);
return i ? absl::optional<bool>(
ACMCodecDB::codec_settings_[*i].channel_support >=
num_channels)
: absl::nullopt;
}
rtc::ArrayView<const CodecInst> RentACodec::Database() {
return rtc::ArrayView<const CodecInst>(ACMCodecDB::database_,
NumberOfCodecs());
}
absl::optional<NetEqDecoder> RentACodec::NetEqDecoderFromCodecId( absl::optional<NetEqDecoder> RentACodec::NetEqDecoderFromCodecId(
CodecId codec_id, CodecId codec_id,
size_t num_channels) { size_t num_channels) {

View File

@ -132,11 +132,6 @@ struct RentACodec {
return payload_type >= 0 && payload_type <= 127; return payload_type >= 0 && payload_type <= 127;
} }
static rtc::ArrayView<const CodecInst> Database();
static absl::optional<bool> IsSupportedNumChannels(CodecId codec_id,
size_t num_channels);
static absl::optional<NetEqDecoder> NetEqDecoderFromCodecId( static absl::optional<NetEqDecoder> NetEqDecoderFromCodecId(
CodecId codec_id, CodecId codec_id,
size_t num_channels); size_t num_channels);