Chromium Code Reviews| 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 15 matching lines...) Expand all Loading... | |
| 26 Parameters&& param) | 26 Parameters&& param) |
| 27 : name(name), | 27 : name(name), |
| 28 clockrate_hz(clockrate_hz), | 28 clockrate_hz(clockrate_hz), |
| 29 num_channels(num_channels), | 29 num_channels(num_channels), |
| 30 parameters(std::move(param)) {} | 30 parameters(std::move(param)) {} |
| 31 | 31 |
| 32 SdpAudioFormat::~SdpAudioFormat() = default; | 32 SdpAudioFormat::~SdpAudioFormat() = default; |
| 33 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; | 33 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; |
| 34 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; | 34 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; |
| 35 | 35 |
| 36 bool operator==(const SdpAudioFormat& a, const SdpAudioFormat& b) { | |
| 37 return a.name == b.name && a.clockrate_hz == b.clockrate_hz && | |
| 38 a.num_channels == b.num_channels && a.parameters == b.parameters; | |
|
kwiberg-webrtc
2016/09/20 15:21:00
Should the .name comparison be case-insensitive?
ossu
2016/09/20 15:30:55
I think it should. We're doing case-insensitive ma
kwiberg-webrtc
2016/09/20 16:30:29
Done.
| |
| 39 } | |
| 40 | |
| 36 void swap(SdpAudioFormat& a, SdpAudioFormat& b) { | 41 void swap(SdpAudioFormat& a, SdpAudioFormat& b) { |
| 37 using std::swap; | 42 using std::swap; |
| 38 swap(a.name, b.name); | 43 swap(a.name, b.name); |
| 39 swap(a.clockrate_hz, b.clockrate_hz); | 44 swap(a.clockrate_hz, b.clockrate_hz); |
| 40 swap(a.num_channels, b.num_channels); | 45 swap(a.num_channels, b.num_channels); |
| 41 swap(a.parameters, b.parameters); | 46 swap(a.parameters, b.parameters); |
| 42 } | 47 } |
| 43 | 48 |
| 44 std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) { | 49 std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) { |
| 45 os << "{name: " << saf.name; | 50 os << "{name: " << saf.name; |
| 46 os << ", clockrate_hz: " << saf.clockrate_hz; | 51 os << ", clockrate_hz: " << saf.clockrate_hz; |
| 47 os << ", num_channels: " << saf.num_channels; | 52 os << ", num_channels: " << saf.num_channels; |
| 48 os << ", parameters: {"; | 53 os << ", parameters: {"; |
| 49 const char* sep = ""; | 54 const char* sep = ""; |
| 50 for (const auto& kv : saf.parameters) { | 55 for (const auto& kv : saf.parameters) { |
| 51 os << sep << kv.first << ": " << kv.second; | 56 os << sep << kv.first << ": " << kv.second; |
| 52 sep = ", "; | 57 sep = ", "; |
| 53 } | 58 } |
| 54 os << "}}"; | 59 os << "}}"; |
| 55 return os; | 60 return os; |
| 56 } | 61 } |
| 57 | 62 |
| 58 } // namespace webrtc | 63 } // namespace webrtc |
| OLD | NEW |