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..3a1d0a912dcf8f2a52fd2ec041607953d01bef45 100644 |
--- a/webrtc/api/audio_codecs/audio_format.cc |
+++ b/webrtc/api/audio_codecs/audio_format.cc |
@@ -19,17 +19,17 @@ SdpAudioFormat::SdpAudioFormat(SdpAudioFormat&&) = default; |
SdpAudioFormat::SdpAudioFormat(const char* name, |
int clockrate_hz, |
- int num_channels) |
+ size_t num_channels) |
: name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} |
SdpAudioFormat::SdpAudioFormat(const std::string& name, |
int clockrate_hz, |
- int num_channels) |
+ size_t num_channels) |
: name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} |
SdpAudioFormat::SdpAudioFormat(const char* name, |
int clockrate_hz, |
- int num_channels, |
+ size_t num_channels, |
const Parameters& param) |
: name(name), |
clockrate_hz(clockrate_hz), |
@@ -38,7 +38,7 @@ SdpAudioFormat::SdpAudioFormat(const char* name, |
SdpAudioFormat::SdpAudioFormat(const std::string& name, |
int clockrate_hz, |
- int num_channels, |
+ size_t num_channels, |
const Parameters& param) |
: name(name), |
clockrate_hz(clockrate_hz), |
@@ -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, |
+ size_t 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, |
+ size_t 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 |