OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 | 38 |
39 SdpAudioFormat::SdpAudioFormat(const std::string& name, | 39 SdpAudioFormat::SdpAudioFormat(const std::string& name, |
40 int clockrate_hz, | 40 int clockrate_hz, |
41 size_t num_channels, | 41 size_t num_channels, |
42 const Parameters& param) | 42 const Parameters& param) |
43 : name(name), | 43 : name(name), |
44 clockrate_hz(clockrate_hz), | 44 clockrate_hz(clockrate_hz), |
45 num_channels(num_channels), | 45 num_channels(num_channels), |
46 parameters(param) {} | 46 parameters(param) {} |
47 | 47 |
| 48 bool SdpAudioFormat::Matches(const SdpAudioFormat& o) const { |
| 49 return STR_CASE_CMP(name.c_str(), o.name.c_str()) == 0 && |
| 50 clockrate_hz == o.clockrate_hz && num_channels == o.num_channels; |
| 51 } |
| 52 |
48 SdpAudioFormat::~SdpAudioFormat() = default; | 53 SdpAudioFormat::~SdpAudioFormat() = default; |
49 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; | 54 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; |
50 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; | 55 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; |
51 | 56 |
52 bool operator==(const SdpAudioFormat& a, const SdpAudioFormat& b) { | 57 bool operator==(const SdpAudioFormat& a, const SdpAudioFormat& b) { |
53 return STR_CASE_CMP(a.name.c_str(), b.name.c_str()) == 0 && | 58 return STR_CASE_CMP(a.name.c_str(), b.name.c_str()) == 0 && |
54 a.clockrate_hz == b.clockrate_hz && a.num_channels == b.num_channels && | 59 a.clockrate_hz == b.clockrate_hz && a.num_channels == b.num_channels && |
55 a.parameters == b.parameters; | 60 a.parameters == b.parameters; |
56 } | 61 } |
57 | 62 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 min_bitrate_bps(min_bitrate_bps), | 102 min_bitrate_bps(min_bitrate_bps), |
98 max_bitrate_bps(max_bitrate_bps) { | 103 max_bitrate_bps(max_bitrate_bps) { |
99 RTC_DCHECK_GT(sample_rate_hz, 0); | 104 RTC_DCHECK_GT(sample_rate_hz, 0); |
100 RTC_DCHECK_GT(num_channels, 0); | 105 RTC_DCHECK_GT(num_channels, 0); |
101 RTC_DCHECK_GE(min_bitrate_bps, 0); | 106 RTC_DCHECK_GE(min_bitrate_bps, 0); |
102 RTC_DCHECK_LE(min_bitrate_bps, default_bitrate_bps); | 107 RTC_DCHECK_LE(min_bitrate_bps, default_bitrate_bps); |
103 RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps); | 108 RTC_DCHECK_GE(max_bitrate_bps, default_bitrate_bps); |
104 } | 109 } |
105 | 110 |
106 } // namespace webrtc | 111 } // namespace webrtc |
OLD | NEW |