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

Unified Diff: webrtc/api/audio_codecs/audio_format.cc

Issue 2695243005: Injectable audio encoders: BuiltinAudioEncoderFactory (Closed)
Patch Set: Moved ANA frame length calculation into its own function. Improved "ptime" parsing in non-opus codeā€¦ Created 3 years, 9 months 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/api/audio_codecs/audio_format.cc
diff --git a/webrtc/api/audio_codecs/audio_format.cc b/webrtc/api/audio_codecs/audio_format.cc
index b0a86e25bd8a7c2ae225ed539666cbf879cf03a5..67fdf8d7ee7b43428df883719513aa469918d5de 100644
--- a/webrtc/api/audio_codecs/audio_format.cc
+++ b/webrtc/api/audio_codecs/audio_format.cc
@@ -77,9 +77,30 @@ std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) {
return os;
}
-AudioCodecSpec::AudioCodecSpec(const SdpAudioFormat& format) : format(format) {}
+AudioCodecInfo::AudioCodecInfo(int sample_rate_hz,
+ int num_channels,
+ int bitrate_bps)
+ : AudioCodecInfo(sample_rate_hz,
+ num_channels,
+ bitrate_bps,
+ bitrate_bps,
+ bitrate_bps) {}
-AudioCodecSpec::AudioCodecSpec(SdpAudioFormat&& format)
- : format(std::move(format)) {}
+AudioCodecInfo::AudioCodecInfo(int sample_rate_hz,
+ int num_channels,
+ int default_bitrate_bps,
+ int min_bitrate_bps,
+ int max_bitrate_bps)
+ : sample_rate_hz(sample_rate_hz),
+ num_channels(num_channels),
+ default_bitrate_bps(default_bitrate_bps),
+ min_bitrate_bps(min_bitrate_bps),
+ max_bitrate_bps(max_bitrate_bps) {
+ RTC_DCHECK_GT(sample_rate_hz, 0);
+ RTC_DCHECK_GT(num_channels, 0);
+ RTC_DCHECK_GE(min_bitrate_bps, 0);
+ RTC_DCHECK_LE(min_bitrate_bps, default_bitrate_bps);
+ RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps);
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698