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 |
11 #include "webrtc/modules/audio_coding/codecs/audio_format.h" | 11 #include "webrtc/modules/audio_coding/codecs/audio_format.h" |
12 | 12 |
13 #include "webrtc/common_types.h" | 13 #include "webrtc/common_types.h" |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 SdpAudioFormat::SdpAudioFormat(const SdpAudioFormat&) = default; | 17 SdpAudioFormat::SdpAudioFormat(const SdpAudioFormat&) = default; |
18 SdpAudioFormat::SdpAudioFormat(SdpAudioFormat&&) = default; | 18 SdpAudioFormat::SdpAudioFormat(SdpAudioFormat&&) = default; |
19 | 19 |
20 SdpAudioFormat::SdpAudioFormat(const char* name, | 20 SdpAudioFormat::SdpAudioFormat(const char* name, |
21 int clockrate_hz, | 21 int clockrate_hz, |
22 int num_channels) | 22 int num_channels) |
23 : name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} | 23 : name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} |
24 | 24 |
| 25 SdpAudioFormat::SdpAudioFormat(const std::string& name, |
| 26 int clockrate_hz, |
| 27 int num_channels) |
| 28 : name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} |
| 29 |
25 SdpAudioFormat::SdpAudioFormat(const char* name, | 30 SdpAudioFormat::SdpAudioFormat(const char* name, |
26 int clockrate_hz, | 31 int clockrate_hz, |
27 int num_channels, | 32 int num_channels, |
28 Parameters&& param) | 33 const Parameters& param) |
29 : name(name), | 34 : name(name), |
30 clockrate_hz(clockrate_hz), | 35 clockrate_hz(clockrate_hz), |
31 num_channels(num_channels), | 36 num_channels(num_channels), |
32 parameters(std::move(param)) {} | 37 parameters(param) {} |
| 38 |
| 39 SdpAudioFormat::SdpAudioFormat(const std::string& name, |
| 40 int clockrate_hz, |
| 41 int num_channels, |
| 42 const Parameters& param) |
| 43 : name(name), |
| 44 clockrate_hz(clockrate_hz), |
| 45 num_channels(num_channels), |
| 46 parameters(param) {} |
33 | 47 |
34 SdpAudioFormat::~SdpAudioFormat() = default; | 48 SdpAudioFormat::~SdpAudioFormat() = default; |
35 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; | 49 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; |
36 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; | 50 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; |
37 | 51 |
38 bool operator==(const SdpAudioFormat& a, const SdpAudioFormat& b) { | 52 bool operator==(const SdpAudioFormat& a, const SdpAudioFormat& b) { |
39 return STR_CASE_CMP(a.name.c_str(), b.name.c_str()) == 0 && | 53 return STR_CASE_CMP(a.name.c_str(), b.name.c_str()) == 0 && |
40 a.clockrate_hz == b.clockrate_hz && a.num_channels == b.num_channels && | 54 a.clockrate_hz == b.clockrate_hz && a.num_channels == b.num_channels && |
41 a.parameters == b.parameters; | 55 a.parameters == b.parameters; |
42 } | 56 } |
(...skipping 14 matching lines...) Expand all Loading... |
57 const char* sep = ""; | 71 const char* sep = ""; |
58 for (const auto& kv : saf.parameters) { | 72 for (const auto& kv : saf.parameters) { |
59 os << sep << kv.first << ": " << kv.second; | 73 os << sep << kv.first << ": " << kv.second; |
60 sep = ", "; | 74 sep = ", "; |
61 } | 75 } |
62 os << "}}"; | 76 os << "}}"; |
63 return os; | 77 return os; |
64 } | 78 } |
65 | 79 |
66 } // namespace webrtc | 80 } // namespace webrtc |
OLD | NEW |