OLD | NEW |
---|---|
(Empty) | |
1 /* | |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | |
3 * | |
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 | |
6 * tree. An additional intellectual property rights grant can be found | |
7 * in the file PATENTS. All contributing project authors may | |
8 * be found in the AUTHORS file in the root of the source tree. | |
9 */ | |
10 | |
11 #include "webrtc/modules/audio_coding/codecs/audio_format.h" | |
12 | |
13 namespace webrtc { | |
14 | |
15 SdpAudioFormat::SdpAudioFormat() = default; | |
16 SdpAudioFormat::SdpAudioFormat(const SdpAudioFormat&) = default; | |
17 SdpAudioFormat::SdpAudioFormat(SdpAudioFormat&&) = default; | |
18 | |
19 SdpAudioFormat::SdpAudioFormat(const char* name, | |
20 int clockrate_hz, | |
21 int num_channels) | |
22 : name(name), clockrate_hz(clockrate_hz), num_channels(num_channels) {} | |
23 | |
24 SdpAudioFormat::~SdpAudioFormat() = default; | |
25 SdpAudioFormat& SdpAudioFormat::operator=(const SdpAudioFormat&) = default; | |
26 SdpAudioFormat& SdpAudioFormat::operator=(SdpAudioFormat&&) = default; | |
27 | |
28 void swap(SdpAudioFormat& a, SdpAudioFormat& b) { | |
29 using std::swap; | |
30 swap(a.name, b.name); | |
31 swap(a.clockrate_hz, b.clockrate_hz); | |
32 swap(a.num_channels, b.num_channels); | |
33 swap(a.parameters, b.parameters); | |
34 } | |
35 | |
36 std::ostream& operator<<(std::ostream& os, const SdpAudioFormat& saf) { | |
37 os << "{name: " << saf.name; | |
38 os << ", clockrate_hz: " << saf.clockrate_hz; | |
39 os << ", num_channels: " << saf.num_channels; | |
40 os << ", parameters: {"; | |
41 const char* sep = ""; | |
hlundin-webrtc
2016/04/27 14:35:56
I think the const qualifier is confusing here, sin
ossu
2016/04/28 08:35:53
Well, it's still correct - the char * can't point
hlundin-webrtc
2016/04/28 09:04:18
Oh. Yes. Well... eeh... [voice tapering off as Sha
| |
42 for (const auto& kv : saf.parameters) { | |
43 os << sep << kv.first << ": " << kv.second; | |
44 sep = ", "; | |
45 } | |
46 os << "}}"; | |
47 return os; | |
48 } | |
49 | |
50 } // namespace webrtc | |
OLD | NEW |