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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtp_utility.cc

Issue 2911193002: Implement timing frames. (Closed)
Patch Set: Fix uninitialized variables memcheck errors Created 3 years, 7 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_utility.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
index d003c0bdb0a511f2190b51e6b1b46e17297c518f..65ec689e88b082ee3204c7b87c2ef3fcc0f9f648 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtp_utility.cc
@@ -10,8 +10,6 @@
#include "webrtc/modules/rtp_rtcp/source/rtp_utility.h"
-#include <string.h>
-
#include "webrtc/base/logging.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h"
#include "webrtc/modules/rtp_rtcp/source/byte_io.h"
@@ -258,6 +256,9 @@ bool RtpHeaderParser::Parse(RTPHeader* header,
header->extension.hasVideoContentType = false;
header->extension.videoContentType = VideoContentType::UNSPECIFIED;
+ header->extension.hasVideoTiming = false;
+ header->extension.videoTiming = {0u, 0u, 0u, 0u, 0u, false};
+
if (X) {
/* RTP header extension, RFC 3550.
0 1 2 3
@@ -469,6 +470,33 @@ void RtpHeaderParser::ParseOneByteExtensionHeader(
}
break;
}
+ case kRtpExtensionVideoTiming: {
+ if (len != 9) {
+ LOG(LS_WARNING) << "Incorrect video timing len: " << len;
+ return;
+ }
+ // 0 1 2 3
+ // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | ID | len=9 | encode start ms delta | encode finish |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | ms delta | packetizer finish ms delta | pacer exit |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ // | ms delta | network timestamp ms delta | |
+ // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+ header->extension.hasVideoTiming = true;
+ header->extension.videoTiming.encode_start_ms_delta =
+ ByteReader<uint16_t, 2>::ReadBigEndian(ptr);
+ header->extension.videoTiming.encode_finish_ms_delta =
+ ByteReader<uint16_t, 2>::ReadBigEndian(ptr + 2);
+ header->extension.videoTiming.packetization_finish_ms_delta =
+ ByteReader<uint16_t, 2>::ReadBigEndian(ptr + 4);
+ header->extension.videoTiming.pacer_exit_ms_delta =
+ ByteReader<uint16_t, 2>::ReadBigEndian(ptr + 6);
+ header->extension.videoTiming.network_timstamp_ms_delta =
+ ByteReader<uint16_t, 2>::ReadBigEndian(ptr + 8);
+ break;
+ }
sprang_webrtc 2017/05/31 11:12:55 Wouldn't it be possible to wrap |ptr| in an ArrayV
ilnik 2017/05/31 15:17:45 Done.
case kRtpExtensionRtpStreamId: {
header->extension.stream_id.Set(rtc::MakeArrayView(ptr, len + 1));
break;

Powered by Google App Engine
This is Rietveld 408576698