Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h

Issue 2805023002: Add read support of RtpStreamId/RepairedRtpStreamId header extensions. (Closed)
Patch Set: . Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
12 12
13 #include <stdint.h> 13 #include <stdint.h>
14 #include <string>
14 15
15 #include "webrtc/api/video/video_rotation.h" 16 #include "webrtc/api/video/video_rotation.h"
16 #include "webrtc/base/array_view.h" 17 #include "webrtc/base/array_view.h"
17 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 18 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
18 19
19 namespace webrtc { 20 namespace webrtc {
20 21
21 class AbsoluteSendTime { 22 class AbsoluteSendTime {
22 public: 23 public:
23 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime; 24 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // translates to a range of 0-40950 in milliseconds. 92 // translates to a range of 0-40950 in milliseconds.
92 static constexpr int kGranularityMs = 10; 93 static constexpr int kGranularityMs = 10;
93 // Maximum playout delay value in milliseconds. 94 // Maximum playout delay value in milliseconds.
94 static constexpr int kMaxMs = 0xfff * kGranularityMs; // 40950. 95 static constexpr int kMaxMs = 0xfff * kGranularityMs; // 40950.
95 96
96 static bool Parse(rtc::ArrayView<const uint8_t> data, 97 static bool Parse(rtc::ArrayView<const uint8_t> data,
97 PlayoutDelay* playout_delay); 98 PlayoutDelay* playout_delay);
98 static bool Write(uint8_t* data, const PlayoutDelay& playout_delay); 99 static bool Write(uint8_t* data, const PlayoutDelay& playout_delay);
99 }; 100 };
100 101
102 class RtpStreamId {
103 public:
104 static constexpr RTPExtensionType kId = kRtpExtensionRtpStreamId;
105 // TODO(danilchap): Avoid using full 16 bytes when webrtc will set the
106 // extension.
107 static constexpr uint8_t kValueSizeBytes = 16;
108 static constexpr const char* kUri =
109 "urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id";
110
111 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rid);
112 };
113
114 class RepairRtpStreamId {
115 public:
116 static constexpr RTPExtensionType kId = kRtpExtensionRepairRtpStreamId;
117 // TODO(danilchap): Avoid using full 16 bytes when webrtc will set the
118 // extension.
pthatcher1 2017/04/06 21:17:34 I don't understand this TODO. Only the WebRTC API
danilchap 2017/04/07 07:07:49 Rewritten TODO from note to self to (hopefully) mo
119 static constexpr uint8_t kValueSizeBytes = 16;
120 static constexpr const char* kUri =
121 "urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id";
122
123 static bool Parse(rtc::ArrayView<const uint8_t> data, std::string* rid);
124 };
125
101 } // namespace webrtc 126 } // namespace webrtc
102 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ 127 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698