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/media/engine/payload_type_mapper.h" | 11 #include "webrtc/media/engine/payload_type_mapper.h" |
12 | 12 |
13 #include "webrtc/common_types.h" | 13 #include "webrtc/common_types.h" |
14 #include "webrtc/media/base/mediaconstants.h" | 14 #include "webrtc/media/base/mediaconstants.h" |
| 15 #include "webrtc/modules/audio_coding/codecs/audio_format.h" |
15 | 16 |
16 namespace cricket { | 17 namespace cricket { |
17 | 18 |
| 19 webrtc::SdpAudioFormat AudioCodecToSdp(const AudioCodec& ac) { |
| 20 auto params = ac.params; // Make a copy. |
| 21 return webrtc::SdpAudioFormat(ac.name, ac.clockrate, ac.channels, |
| 22 std::move(params)); |
| 23 } |
| 24 |
18 PayloadTypeMapper::PayloadTypeMapper() | 25 PayloadTypeMapper::PayloadTypeMapper() |
19 // RFC 3551 reserves payload type numbers in the range 96-127 exclusively | 26 // RFC 3551 reserves payload type numbers in the range 96-127 exclusively |
20 // for dynamic assignment. Once those are used up, it is recommended that | 27 // for dynamic assignment. Once those are used up, it is recommended that |
21 // payload types unassigned by the RFC are used for dynamic payload type | 28 // payload types unassigned by the RFC are used for dynamic payload type |
22 // mapping, before any static payload ids. At this point, we only support | 29 // mapping, before any static payload ids. At this point, we only support |
23 // mapping within the exclusive range. | 30 // mapping within the exclusive range. |
24 : next_unused_payload_type_(96), | 31 : next_unused_payload_type_(96), |
25 max_payload_type_(127), | 32 max_payload_type_(127), |
26 mappings_({ | 33 mappings_({ |
27 // Static payload type assignments according to RFC 3551. | 34 // Static payload type assignments according to RFC 3551. |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 if (name_cmp == 0) | 143 if (name_cmp == 0) |
137 return a.parameters < b.parameters; | 144 return a.parameters < b.parameters; |
138 return name_cmp < 0; | 145 return name_cmp < 0; |
139 } | 146 } |
140 return a.num_channels < b.num_channels; | 147 return a.num_channels < b.num_channels; |
141 } | 148 } |
142 return a.clockrate_hz < b.clockrate_hz; | 149 return a.clockrate_hz < b.clockrate_hz; |
143 } | 150 } |
144 | 151 |
145 } // namespace cricket | 152 } // namespace cricket |
OLD | NEW |