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

Unified 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, 4 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
index 116aaa6b931eaf86c4ef25ee6a39323ab5233299..4800a60c39d40c4ecc148d10cf27cde623aed7c0 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
@@ -23,8 +23,12 @@ class AbsoluteSendTime {
static constexpr uint8_t kValueSizeBytes = 3;
static const char* kName;
static bool IsSupportedFor(MediaType type);
- static bool Parse(const uint8_t* data, uint32_t* time_ms);
+ static bool Parse(const uint8_t* data, uint32_t* time_24bits);
static bool Write(uint8_t* data, int64_t time_ms);
+
+ static constexpr uint32_t MsTo24Bits(int64_t time_ms) {
+ return static_cast<uint32_t>(((time_ms << 18) + 500) / 1000) & 0x00FFFFFF;
+ }
};
class AudioLevel {
« 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