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

Unified Diff: media/cast/net/rtp/rtp_defines.h

Issue 1377273003: cast: cleanup rtp header and parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased the commits Created 5 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
« no previous file with comments | « media/cast/net/rtp/receiver_stats_unittest.cc ('k') | media/cast/net/rtp/rtp_defines.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/net/rtp/rtp_defines.h
diff --git a/media/cast/net/rtp/rtp_defines.h b/media/cast/net/rtp/rtp_defines.h
index 56df66d4d21ce88f68e8579a6c66b6f874b65dd2..fd716385f2ad1c8986bafbf2e1755458cd63db7c 100644
--- a/media/cast/net/rtp/rtp_defines.h
+++ b/media/cast/net/rtp/rtp_defines.h
@@ -2,19 +2,60 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#ifndef MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
+#define MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
+
+#include "base/basictypes.h"
+#include "media/cast/net/rtcp/rtcp_defines.h"
+
namespace media {
namespace cast {
static const uint16 kRtpHeaderLength = 12;
static const uint16 kCastHeaderLength = 7;
miu 2015/10/02 19:13:45 If any of these constants are only used in one .cc
Irfan 2015/10/06 21:33:03 These constants do get used on multiple .cc files
+
+// RTP Header
static const uint8 kRtpExtensionBitMask = 0x10;
+static const uint8 kRtpMarkerBitMask = 0x80;
+static const uint8 kRtpNumCsrcsMask = 0x0f;
+
+// Cast Header
static const uint8 kCastKeyFrameBitMask = 0x80;
static const uint8 kCastReferenceFrameIdBitMask = 0x40;
-static const uint8 kRtpMarkerBitMask = 0x80;
static const uint8 kCastExtensionCountmask = 0x3f;
// Cast RTP extensions.
static const uint8 kCastRtpExtensionAdaptiveLatency = 1;
+struct RtpCastHeader {
+ RtpCastHeader();
+ // Elements from RTP packet header.
+ bool marker;
+ uint8 payload_type;
+ uint16 sequence_number;
+ uint32 rtp_timestamp;
+ uint32 sender_ssrc;
+ uint8 num_csrcs;
+
+ // Elements from Cast header (at beginning of RTP payload).
+ bool is_key_frame;
+ bool is_reference;
+ uint32 frame_id;
+ uint16 packet_id;
+ uint16 max_packet_id;
+ uint32 reference_frame_id;
+ uint16 new_playout_delay_ms;
+};
+
+class RtpPayloadFeedback {
+ public:
+ virtual void CastFeedback(const RtcpCastMessage& cast_feedback) = 0;
+
+ protected:
+ virtual ~RtpPayloadFeedback();
+};
+
} // namespace cast
} // namespace media
+
+#endif // MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
« no previous file with comments | « media/cast/net/rtp/receiver_stats_unittest.cc ('k') | media/cast/net/rtp/rtp_defines.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698