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

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

Issue 2695243005: Injectable audio encoders: BuiltinAudioEncoderFactory (Closed)
Patch Set: Cleaned up parameter parsing in AudioCodecOpus 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..5d9b10b10617dd6ef88c25a84cdf35e362b96b39 100644
--- a/webrtc/api/audio_codecs/audio_format.cc
+++ b/webrtc/api/audio_codecs/audio_format.cc
@@ -77,9 +77,31 @@ std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) {
return os;
}
-AudioCodecSpec::AudioCodecSpec(const SdpAudioFormat& format) : format(format) {}
+AudioFormatInfo::AudioFormatInfo()
+ : AudioFormatInfo(0, 0, 0) {}
kwiberg-webrtc 2017/03/15 13:33:17 Sorry if I've already asked about this, but why is
ossu 2017/03/16 18:03:56 It was necessary for one of the previous incarnati
-AudioCodecSpec::AudioCodecSpec(SdpAudioFormat&& format)
- : format(std::move(format)) {}
+AudioFormatInfo::AudioFormatInfo(int sample_rate_hz,
+ int num_channels,
+ int bitrate_bps)
+ : AudioFormatInfo(sample_rate_hz,
+ num_channels,
+ bitrate_bps,
+ bitrate_bps,
+ bitrate_bps) {}
+
+AudioFormatInfo::AudioFormatInfo(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_GE(min_bitrate_bps, 0);
+ RTC_DCHECK_LE(min_bitrate_bps, default_bitrate_bps);
+ RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps);
kwiberg-webrtc 2017/03/15 13:33:17 Also check that sample_rate_hz and num_channels ar
ossu 2017/03/16 18:03:56 Sure. I've just done the most basic of checks, tha
kwiberg-webrtc 2017/03/17 10:20:01 Excellent, that was exactly what I meant.
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698