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

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: 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
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 a59aa993cc77742d77a53e35c04c1882143d543c..0da178f893e7bb909cf9bc1cc0026a3bb6963bb3 100644
--- a/media/cast/net/rtp/rtp_parser.cc
+++ b/media/cast/net/rtp/rtp_parser.cc
@@ -61,13 +61,15 @@ bool RtpParser::ParsePacket(const uint8* 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
@@ -112,6 +114,8 @@ bool RtpParser::ParsePacket(const uint8* 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.
//

Powered by Google App Engine
This is Rietveld 408576698