| OLD | NEW |
| 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; |
| 16 |
| 17 // RTP Header |
| 10 static const uint8 kRtpExtensionBitMask = 0x10; | 18 static const uint8 kRtpExtensionBitMask = 0x10; |
| 19 static const uint8 kRtpMarkerBitMask = 0x80; |
| 20 static const uint8 kRtpNumCsrcsMask = 0x0f; |
| 21 |
| 22 // Cast Header |
| 11 static const uint8 kCastKeyFrameBitMask = 0x80; | 23 static const uint8 kCastKeyFrameBitMask = 0x80; |
| 12 static const uint8 kCastReferenceFrameIdBitMask = 0x40; | 24 static const uint8 kCastReferenceFrameIdBitMask = 0x40; |
| 13 static const uint8 kRtpMarkerBitMask = 0x80; | |
| 14 static const uint8 kCastExtensionCountmask = 0x3f; | 25 static const uint8 kCastExtensionCountmask = 0x3f; |
| 15 | 26 |
| 16 // Cast RTP extensions. | 27 // Cast RTP extensions. |
| 17 static const uint8 kCastRtpExtensionAdaptiveLatency = 1; | 28 static const uint8 kCastRtpExtensionAdaptiveLatency = 1; |
| 18 | 29 |
| 30 struct RtpCastHeader { |
| 31 RtpCastHeader(); |
| 32 // Elements from RTP packet header. |
| 33 bool marker; |
| 34 uint8 payload_type; |
| 35 uint16 sequence_number; |
| 36 uint32 rtp_timestamp; |
| 37 uint32 sender_ssrc; |
| 38 uint8 num_csrcs; |
| 39 |
| 40 // Elements from Cast header (at beginning of RTP payload). |
| 41 bool is_key_frame; |
| 42 bool is_reference; |
| 43 uint32 frame_id; |
| 44 uint16 packet_id; |
| 45 uint16 max_packet_id; |
| 46 uint32 reference_frame_id; |
| 47 uint16 new_playout_delay_ms; |
| 48 }; |
| 49 |
| 50 class RtpPayloadFeedback { |
| 51 public: |
| 52 virtual void CastFeedback(const RtcpCastMessage& cast_feedback) = 0; |
| 53 |
| 54 protected: |
| 55 virtual ~RtpPayloadFeedback(); |
| 56 }; |
| 57 |
| 19 } // namespace cast | 58 } // namespace cast |
| 20 } // namespace media | 59 } // namespace media |
| 60 |
| 61 #endif // MEDIA_CAST_NET_RTP_RTP_DEFINES_H_ |
| OLD | NEW |