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

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

Issue 2272563010: AbsoluteSendTime rtp header extension publish MsTo24Bit conversion (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "webrtc/base/basictypes.h" 13 #include "webrtc/base/basictypes.h"
14 #include "webrtc/call.h" 14 #include "webrtc/call.h"
15 #include "webrtc/common_video/rotation.h" 15 #include "webrtc/common_video/rotation.h"
16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
17 17
18 namespace webrtc { 18 namespace webrtc {
19 19
20 class AbsoluteSendTime { 20 class AbsoluteSendTime {
21 public: 21 public:
22 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime; 22 static constexpr RTPExtensionType kId = kRtpExtensionAbsoluteSendTime;
23 static constexpr uint8_t kValueSizeBytes = 3; 23 static constexpr uint8_t kValueSizeBytes = 3;
24 static const char* kName; 24 static const char* kName;
25 static bool IsSupportedFor(MediaType type); 25 static bool IsSupportedFor(MediaType type);
26 static bool Parse(const uint8_t* data, uint32_t* time_ms); 26 static bool Parse(const uint8_t* data, uint32_t* time_24bits);
27 static bool Write(uint8_t* data, int64_t time_ms); 27 static bool Write(uint8_t* data, int64_t time_ms);
28
29 static constexpr uint32_t MsTo24Bits(int64_t time_ms) {
30 return static_cast<uint32_t>(((time_ms << 18) + 500) / 1000) & 0x00FFFFFF;
31 }
28 }; 32 };
29 33
30 class AudioLevel { 34 class AudioLevel {
31 public: 35 public:
32 static constexpr RTPExtensionType kId = kRtpExtensionAudioLevel; 36 static constexpr RTPExtensionType kId = kRtpExtensionAudioLevel;
33 static constexpr uint8_t kValueSizeBytes = 1; 37 static constexpr uint8_t kValueSizeBytes = 1;
34 static const char* kName; 38 static const char* kName;
35 static bool IsSupportedFor(MediaType type); 39 static bool IsSupportedFor(MediaType type);
36 static bool Parse(const uint8_t* data, 40 static bool Parse(const uint8_t* data,
37 bool* voice_activity, 41 bool* voice_activity,
(...skipping 28 matching lines...) Expand all
66 static const char* kName; 70 static const char* kName;
67 static bool IsSupportedFor(MediaType type); 71 static bool IsSupportedFor(MediaType type);
68 static bool Parse(const uint8_t* data, VideoRotation* value); 72 static bool Parse(const uint8_t* data, VideoRotation* value);
69 static bool Write(uint8_t* data, VideoRotation value); 73 static bool Write(uint8_t* data, VideoRotation value);
70 static bool Parse(const uint8_t* data, uint8_t* value); 74 static bool Parse(const uint8_t* data, uint8_t* value);
71 static bool Write(uint8_t* data, uint8_t value); 75 static bool Write(uint8_t* data, uint8_t value);
72 }; 76 };
73 77
74 } // namespace webrtc 78 } // namespace webrtc
75 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_ 79 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698