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 AudioCodecToSdpAudioFormat(const AudioCodec& ac) { |
| 20 return webrtc::SdpAudioFormat(ac.name, ac.clockrate, ac.channels, ac.params); |
| 21 } |
| 22 |
18 PayloadTypeMapper::PayloadTypeMapper() | 23 PayloadTypeMapper::PayloadTypeMapper() |
19 // RFC 3551 reserves payload type numbers in the range 96-127 exclusively | 24 // 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 | 25 // 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 | 26 // 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 | 27 // mapping, before any static payload ids. At this point, we only support |
23 // mapping within the exclusive range. | 28 // mapping within the exclusive range. |
24 : next_unused_payload_type_(96), | 29 : next_unused_payload_type_(96), |
25 max_payload_type_(127), | 30 max_payload_type_(127), |
26 mappings_({ | 31 mappings_({ |
27 // Static payload type assignments according to RFC 3551. | 32 // 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) | 141 if (name_cmp == 0) |
137 return a.parameters < b.parameters; | 142 return a.parameters < b.parameters; |
138 return name_cmp < 0; | 143 return name_cmp < 0; |
139 } | 144 } |
140 return a.num_channels < b.num_channels; | 145 return a.num_channels < b.num_channels; |
141 } | 146 } |
142 return a.clockrate_hz < b.clockrate_hz; | 147 return a.clockrate_hz < b.clockrate_hz; |
143 } | 148 } |
144 | 149 |
145 } // namespace cricket | 150 } // namespace cricket |
OLD | NEW |