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

Unified Diff: media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h

Issue 112133002: Cast:Moving netwrok sender related code to a designated folder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moving const' to .cc Created 7 years 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
Index: media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h
diff --git a/media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h b/media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a41f3945b8192c158f34564a833b9243a91c018
--- /dev/null
+++ b/media/cast/net/rtp_sender/rtp_packetizer/test/rtp_header_parser.h
@@ -0,0 +1,60 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Utility parser for rtp packetizer unittests
+#ifndef MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_
+#define MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_
+
+#include "base/basictypes.h"
+#include "media/cast/net/cast_net_defines.h"
+
+namespace media {
+namespace cast {
+
+struct RtpCastTestHeader {
+ RtpCastTestHeader();
+ ~RtpCastTestHeader();
+ // Cast specific.
+ bool is_key_frame;
+ uint32 frame_id;
+ uint16 packet_id;
+ uint16 max_packet_id;
+ bool is_reference; // Set to true if the previous frame is not available,
+ // and the reference frame id is available.
+ uint32 reference_frame_id;
+
+ // Rtp Generic.
+ bool marker;
+ uint16 sequence_number;
+ uint32 rtp_timestamp;
+ uint32 ssrc;
+ int payload_type;
+ uint8 num_csrcs;
+ uint8 audio_num_energy;
+ int header_length;
+};
+
+class RtpHeaderParser {
+ public:
+ RtpHeaderParser(const uint8* rtpData, size_t rtpDataLength);
+ ~RtpHeaderParser();
+
+ bool Parse(RtpCastTestHeader* parsed_packet) const;
+
+ private:
+ bool ParseCommon(RtpCastTestHeader* parsed_packet) const;
+ bool ParseCast(RtpCastTestHeader* parsed_packet) const;
+ const uint8* const rtp_data_begin_;
+ size_t length_;
+
+ mutable FrameIdWrapHelper frame_id_wrap_helper_;
+ mutable FrameIdWrapHelper reference_frame_id_wrap_helper_;
+
+ DISALLOW_COPY_AND_ASSIGN(RtpHeaderParser);
+};
+
+} // namespace cast
+} // namespace media
+
+#endif // MEDIA_CAST_NET_RTP_SENDER_RTP_PACKETIZER_TEST_RTP_HEADER_PARSER_H_

Powered by Google App Engine
This is Rietveld 408576698