Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Unified Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc

Issue 1419013005: Hide ACMCodecDB::codec_settings_ behind an accessor (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: ICanHasNumChannels? Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
diff --git a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
index bee0275efe53ac0461b0d2775007c4a568b16ddf..76dc7bbf47da462287408e03d61e0766e0ce71eb 100644
--- a/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
+++ b/webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc
@@ -50,6 +50,14 @@ bool RentACodec::IsCodecValid(const CodecInst& codec_inst) {
return ACMCodecDB::CodecNumber(codec_inst) >= 0;
}
+rtc::Maybe<bool> RentACodec::IsSupportedNumChannels(CodecId codec_id,
+ int num_channels) {
+ auto i = CodecIndexFromId(codec_id);
+ return i ? rtc::Maybe<bool>(ACMCodecDB::codec_settings_[*i].channel_support >=
+ num_channels)
+ : rtc::Maybe<bool>();
+}
+
rtc::ArrayView<const CodecInst> RentACodec::Database() {
return rtc::ArrayView<const CodecInst>(ACMCodecDB::database_,
NumberOfCodecs());

Powered by Google App Engine
This is Rietveld 408576698