OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ |
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 | 15 |
16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 const uint16_t kRtpOneByteHeaderExtensionId = 0xBEDE; | 21 const uint16_t kRtpOneByteHeaderExtensionId = 0xBEDE; |
22 | 22 |
23 const size_t kRtpOneByteHeaderLength = 4; | 23 const size_t kRtpOneByteHeaderLength = 4; |
24 const size_t kTransmissionTimeOffsetLength = 4; | 24 const size_t kTransmissionTimeOffsetLength = 4; |
25 const size_t kAudioLevelLength = 2; | 25 const size_t kAudioLevelLength = 2; |
26 const size_t kAbsoluteSendTimeLength = 4; | 26 const size_t kAbsoluteSendTimeLength = 4; |
27 const size_t kVideoRotationLength = 2; | 27 const size_t kVideoRotationLength = 2; |
28 const size_t kTransportSequenceNumberLength = 3; | 28 const size_t kTransportSequenceNumberLength = 3; |
| 29 const size_t kPlayoutDelayLength = 4; |
| 30 |
| 31 // Playout delay in milliseconds. A playout delay limit (min or max) |
| 32 // has 12 bits allocated. This allows a range of 0-4095 values which translates |
| 33 // to a range of 0-40950 in milliseconds. |
| 34 const int kPlayoutDelayGranularityMs = 10; |
| 35 // Maximum playout delay value in milliseconds. |
| 36 const int kPlayoutDelayMaxMs = 40950; |
29 | 37 |
30 struct HeaderExtension { | 38 struct HeaderExtension { |
31 explicit HeaderExtension(RTPExtensionType extension_type) | 39 explicit HeaderExtension(RTPExtensionType extension_type) |
32 : type(extension_type), length(0), active(true) { | 40 : type(extension_type), length(0), active(true) { |
33 Init(); | 41 Init(); |
34 } | 42 } |
35 | 43 |
36 HeaderExtension(RTPExtensionType extension_type, bool active) | 44 HeaderExtension(RTPExtensionType extension_type, bool active) |
37 : type(extension_type), length(0), active(active) { | 45 : type(extension_type), length(0), active(active) { |
38 Init(); | 46 Init(); |
(...skipping 12 matching lines...) Expand all Loading... |
51 break; | 59 break; |
52 case kRtpExtensionAbsoluteSendTime: | 60 case kRtpExtensionAbsoluteSendTime: |
53 length = kAbsoluteSendTimeLength; | 61 length = kAbsoluteSendTimeLength; |
54 break; | 62 break; |
55 case kRtpExtensionVideoRotation: | 63 case kRtpExtensionVideoRotation: |
56 length = kVideoRotationLength; | 64 length = kVideoRotationLength; |
57 break; | 65 break; |
58 case kRtpExtensionTransportSequenceNumber: | 66 case kRtpExtensionTransportSequenceNumber: |
59 length = kTransportSequenceNumberLength; | 67 length = kTransportSequenceNumberLength; |
60 break; | 68 break; |
| 69 case kRtpExtensionPlayoutDelay: |
| 70 length = kPlayoutDelayLength; |
| 71 break; |
61 default: | 72 default: |
62 assert(false); | 73 assert(false); |
63 } | 74 } |
64 } | 75 } |
65 | 76 |
66 const RTPExtensionType type; | 77 const RTPExtensionType type; |
67 uint8_t length; | 78 uint8_t length; |
68 bool active; | 79 bool active; |
69 }; | 80 }; |
70 | 81 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 RTPExtensionType Next(RTPExtensionType type) const; | 126 RTPExtensionType Next(RTPExtensionType type) const; |
116 | 127 |
117 private: | 128 private: |
118 int32_t Register(const RTPExtensionType type, const uint8_t id, bool active); | 129 int32_t Register(const RTPExtensionType type, const uint8_t id, bool active); |
119 std::map<uint8_t, HeaderExtension*> extensionMap_; | 130 std::map<uint8_t, HeaderExtension*> extensionMap_; |
120 }; | 131 }; |
121 } // namespace webrtc | 132 } // namespace webrtc |
122 | 133 |
123 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ | 134 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ |
124 | 135 |
OLD | NEW |