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

Side by Side 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: Created 5 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
6 #define MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
7
8 #include "base/basictypes.h"
9 #include "media/cast/net/rtcp/rtcp_defines.h"
10
5 namespace media { 11 namespace media {
6 namespace cast { 12 namespace cast {
7 13
8 static const uint16 kRtpHeaderLength = 12; 14 static const uint16 kRtpHeaderLength = 12;
9 static const uint16 kCastHeaderLength = 7; 15 static const uint16 kCastHeaderLength = 7;
10 static const uint8 kRtpExtensionBitMask = 0x10; 16 static const uint8 kRtpExtensionBitMask = 0x10;
11 static const uint8 kCastKeyFrameBitMask = 0x80; 17 static const uint8 kCastKeyFrameBitMask = 0x80;
12 static const uint8 kCastReferenceFrameIdBitMask = 0x40; 18 static const uint8 kCastReferenceFrameIdBitMask = 0x40;
13 static const uint8 kRtpMarkerBitMask = 0x80; 19 static const uint8 kRtpMarkerBitMask = 0x80;
20 static const uint8 kRtpNumCsrcsMask = 0x0f;
14 static const uint8 kCastExtensionCountmask = 0x3f; 21 static const uint8 kCastExtensionCountmask = 0x3f;
15 22
16 // Cast RTP extensions. 23 // Cast RTP extensions.
17 static const uint8 kCastRtpExtensionAdaptiveLatency = 1; 24 static const uint8 kCastRtpExtensionAdaptiveLatency = 1;
18 25
26 const uint32 kCastRtpHeaderLength = 7;
27 const uint32 kGenericRtpHeaderLength = 12;
28
29 struct RtpCastHeader {
30 RtpCastHeader();
31 // Elements from RTP packet header.
32 bool marker;
33 uint8 payload_type;
34 uint16 sequence_number;
35 uint32 rtp_timestamp;
36 uint32 sender_ssrc;
37 uint8 num_csrcs;
38
39 // Elements from Cast header (at beginning of RTP payload).
40 bool is_key_frame;
41 bool is_reference;
42 uint32 frame_id;
43 uint16 packet_id;
44 uint16 max_packet_id;
45 uint32 reference_frame_id;
46 uint16 new_playout_delay_ms;
47 };
48
49 class RtpPayloadFeedback {
50 public:
51 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) = 0;
52
53 protected:
54 virtual ~RtpPayloadFeedback();
55 };
56
19 } // namespace cast 57 } // namespace cast
20 } // namespace media 58 } // namespace media
59
60 #endif // MEDIA_CAST_NET_RTP_RTP_DEFINES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698