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

Side by Side Diff: webrtc/api/audio_codecs/audio_format.cc

Issue 2831333002: Allow a received audio codec's payload type to change. (Closed)
Patch Set: Updating a test. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698