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

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

Issue 2695243005: Injectable audio encoders: BuiltinAudioEncoderFactory (Closed)
Patch Set: Removed stub versions of AudioEncoderFactory from peerconnectioninterface.h Created 3 years, 10 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..ab438e1e1d0a7bb27a1ac5c02a97169c7136cc53 100644
--- a/webrtc/api/audio_codecs/audio_format.cc
+++ b/webrtc/api/audio_codecs/audio_format.cc
@@ -77,9 +77,34 @@ std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) {
return os;
}
-AudioCodecSpec::AudioCodecSpec(const SdpAudioFormat& format) : format(format) {}
+AudioFormatInfo::AudioFormatInfo()
+ : sample_rate_hz(0),
+ num_channels(0),
+ min_bitrate_bps(0),
+ max_bitrate_bps(0) {}
-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);
+}
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698