OLD | NEW |
(Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Utility parser for rtp packetizer unittests |
| 6 #ifndef MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_ |
| 7 #define MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_ |
| 8 |
| 9 #include "base/basictypes.h" |
| 10 #include "media/cast/net/cast_net_defines.h" |
| 11 |
| 12 namespace media { |
| 13 namespace cast { |
| 14 |
| 15 struct RtpCastTestHeader { |
| 16 RtpCastTestHeader(); |
| 17 ~RtpCastTestHeader(); |
| 18 // Cast specific. |
| 19 bool is_key_frame; |
| 20 uint32 frame_id; |
| 21 uint16 packet_id; |
| 22 uint16 max_packet_id; |
| 23 bool is_reference; // Set to true if the previous frame is not available, |
| 24 // and the reference frame id is available. |
| 25 uint32 reference_frame_id; |
| 26 |
| 27 // Rtp Generic. |
| 28 bool marker; |
| 29 uint16 sequence_number; |
| 30 uint32 rtp_timestamp; |
| 31 uint32 ssrc; |
| 32 int payload_type; |
| 33 uint8 num_csrcs; |
| 34 uint8 audio_num_energy; |
| 35 int header_length; |
| 36 }; |
| 37 |
| 38 class RtpHeaderParser { |
| 39 public: |
| 40 RtpHeaderParser(const uint8* rtpData, size_t rtpDataLength); |
| 41 ~RtpHeaderParser(); |
| 42 |
| 43 bool Parse(RtpCastTestHeader* parsed_packet) const; |
| 44 |
| 45 private: |
| 46 bool ParseCommon(RtpCastTestHeader* parsed_packet) const; |
| 47 bool ParseCast(RtpCastTestHeader* parsed_packet) const; |
| 48 const uint8* const rtp_data_begin_; |
| 49 size_t length_; |
| 50 |
| 51 mutable FrameIdWrapHelper frame_id_wrap_helper_; |
| 52 mutable FrameIdWrapHelper reference_frame_id_wrap_helper_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(RtpHeaderParser); |
| 55 }; |
| 56 |
| 57 } // namespace cast |
| 58 } // namespace media |
| 59 |
| 60 #endif // MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_ |
OLD | NEW |