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

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

Issue 493823002: Implement adaptive target delay extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: explicit masking Created 6 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 | « media/cast/net/rtp/rtp_packetizer.cc ('k') | media/cast/net/rtp/rtp_receiver_defines.h » ('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 bed1d7c8d8f6489a4a68772fcf8f852fd7bb7151..1d68cd15a1cf497dd20c30daf26a84178475676e 100644
--- a/media/cast/net/rtp/rtp_parser.cc
+++ b/media/cast/net/rtp/rtp_parser.cc
@@ -7,17 +7,11 @@
#include "base/big_endian.h"
#include "base/logging.h"
#include "media/cast/cast_defines.h"
+#include "media/cast/net/rtp/rtp_defines.h"
namespace media {
namespace cast {
-static const size_t kRtpHeaderLength = 12;
-static const size_t kCastHeaderLength = 7;
-static const uint8 kRtpExtensionBitMask = 0x10;
-static const uint8 kRtpMarkerBitMask = 0x80;
-static const uint8 kCastKeyFrameBitMask = 0x80;
-static const uint8 kCastReferenceFrameIdBitMask = 0x40;
-
RtpParser::RtpParser(uint32 expected_sender_ssrc, uint8 expected_payload_type)
: expected_sender_ssrc_(expected_sender_ssrc),
expected_payload_type_(expected_payload_type) {}
@@ -92,6 +86,22 @@ bool RtpParser::ParsePacket(const uint8* packet,
return false;
}
+ for (int i = 0; i < (bits & kCastExtensionCountmask); i++) {
+ uint16 type_and_size;
+ if (!reader.ReadU16(&type_and_size))
+ return false;
+ base::StringPiece tmp;
+ if (!reader.ReadPiece(&tmp, type_and_size & 0x3ff))
+ return false;
+ base::BigEndianReader chunk(tmp.data(), tmp.size());
+ switch (type_and_size >> 10) {
+ case kCastRtpExtensionAdaptiveLatency:
+ if (!chunk.ReadU16(&header->new_playout_delay_ms))
+ return false;
+
+ }
+ }
+
// 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_packetizer.cc ('k') | media/cast/net/rtp/rtp_receiver_defines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698