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
3 // found in the LICENSE file.
5 // Utility parser for rtp packetizer unittests
6 #ifndef MEDIA_CAST_NET_RTP_RTP_HEADER_PARSER_H_
7 #define MEDIA_CAST_NET_RTP_RTP_HEADER_PARSER_H_
9 #include "base/basictypes.h"
10 #include "media/cast/net/cast_transport_defines.h"
15 // TODO(miu): Kill this and use RtpCastHeader instead.
16 struct RtpCastTestHeader
{
24 bool is_reference
; // Set to true if the previous frame is not available,
25 // and the reference frame id is available.
26 uint32 reference_frame_id
;
30 uint16 sequence_number
;
35 uint8 audio_num_energy
;
39 // TODO(miu): Kill this and use RtpParser instead.
40 class RtpHeaderParser
{
42 RtpHeaderParser(const uint8
* rtpData
, size_t rtpDataLength
);
45 bool Parse(RtpCastTestHeader
* parsed_packet
) const;
48 bool ParseCommon(RtpCastTestHeader
* parsed_packet
) const;
49 bool ParseCast(RtpCastTestHeader
* parsed_packet
) const;
50 const uint8
* const rtp_data_begin_
;
53 mutable FrameIdWrapHelper frame_id_wrap_helper_
;
54 mutable FrameIdWrapHelper reference_frame_id_wrap_helper_
;
56 DISALLOW_COPY_AND_ASSIGN(RtpHeaderParser
);
62 #endif // MEDIA_CAST_NET_RTP_RTP_HEADER_PARSER_H_