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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h

Issue 2217383002: Use RtpPacketToSend in RtpSenderVideo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Ported PlayoutDelay extension support. 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 side-by-side diff with in-line comments
Download patch
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 4800a60c39d40c4ecc148d10cf27cde623aed7c0..0703c599c59d9d1edb08c4043fb3c13447bd98c1 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_header_extensions.h
@@ -23,12 +23,8 @@ 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_24bits);
+ static bool Parse(const uint8_t* data, uint32_t* time_ms);
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 {
@@ -75,5 +71,22 @@ class VideoOrientation {
static bool Write(uint8_t* data, uint8_t value);
};
+class PlayoutDelayLimits {
+ public:
+ static constexpr RTPExtensionType kId = kRtpExtensionPlayoutDelay;
+ static constexpr uint8_t kValueSizeBytes = 3;
+ static const char* kName;
+ static bool IsSupportedFor(MediaType type);
+ // Playout delay in milliseconds. A playout delay limit (min or max)
+ // has 12 bits allocated. This allows a range of 0-4095 values which
+ // translates to a range of 0-40950 in milliseconds.
+ static constexpr int kGranularityMs = 10;
+ // Maximum playout delay value in milliseconds.
+ static constexpr int kMaxMs = 0xfff * kGranularityMs; // 40950.
+
+ static bool Parse(const uint8_t* data, PlayoutDelay* playout_delay);
+ static bool Write(uint8_t* data, const PlayoutDelay& playout_delay);
+};
+
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSIONS_H_
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/producer_fec.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_header_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698