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

Unified Diff: media/cast/net/rtp/rtp_parser.cc

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Speculative workaround fix for win8_chromium_ng compile error. Created 5 years 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 | « media/cast/net/rtp/rtp_parser.h ('k') | media/cast/net/rtp/rtp_parser_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/rtp/rtp_parser.cc
diff --git a/media/cast/net/rtp/rtp_parser.cc b/media/cast/net/rtp/rtp_parser.cc
index 9dc0243913db2215f4d172ad6bba2752f7ccce5f..6c8d861ab336b74a1459fb8a892a49c5ea2a535c 100644
--- a/media/cast/net/rtp/rtp_parser.cc
+++ b/media/cast/net/rtp/rtp_parser.cc
@@ -62,13 +62,15 @@ bool RtpParser::ParsePacket(const uint8_t* packet,
header->payload_type = bits & ~kRtpMarkerBitMask;
if (header->payload_type != expected_payload_type_)
return false; // Punt: Unexpected payload type.
+ uint32_t truncated_rtp_timestamp;
if (!reader.ReadU16(&header->sequence_number) ||
- !reader.ReadU32(&header->rtp_timestamp) ||
- !reader.ReadU32(&header->sender_ssrc)) {
+ !reader.ReadU32(&truncated_rtp_timestamp) ||
+ !reader.ReadU32(&header->sender_ssrc) ||
+ header->sender_ssrc != expected_sender_ssrc_) {
return false;
}
- if (header->sender_ssrc != expected_sender_ssrc_)
- return false; // Punt: Sender's SSRC does not match the expected one.
+ header->rtp_timestamp =
+ last_parsed_rtp_timestamp_.Expand(truncated_rtp_timestamp);
// Parse the Cast header. Note that, from the RTP protocol's perspective, the
// Cast header is part of the payload (and not meant to be an extension
@@ -113,6 +115,8 @@ bool RtpParser::ParsePacket(const uint8_t* packet,
}
}
+ last_parsed_rtp_timestamp_ = header->rtp_timestamp;
+
// Only the lower 8 bits of the |frame_id| were serialized, so do some magic
// to restore the upper 24 bits.
//
« no previous file with comments | « media/cast/net/rtp/rtp_parser.h ('k') | media/cast/net/rtp/rtp_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698