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

Side by Side Diff: media/cast/rtcp/test_rtcp_packet_builder.cc

Issue 145873006: ui/base/resource: Roll our own version of ReadBigEndian() function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 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 #include "media/cast/rtcp/test_rtcp_packet_builder.h" 5 #include "media/cast/rtcp/test_rtcp_packet_builder.h"
6 #include "base/logging.h" 6 #include "base/logging.h"
7 7
8 namespace media { 8 namespace media {
9 namespace cast { 9 namespace cast {
10 10
11 TestRtcpPacketBuilder::TestRtcpPacketBuilder() 11 TestRtcpPacketBuilder::TestRtcpPacketBuilder()
12 : ptr_of_length_(NULL), big_endian_writer_(buffer_, kMaxIpPacketSize) {} 12 : ptr_of_length_(NULL),
13 big_endian_writer_(reinterpret_cast<char*>(buffer_), kMaxIpPacketSize) {}
13 14
14 void TestRtcpPacketBuilder::AddSr(uint32 sender_ssrc, 15 void TestRtcpPacketBuilder::AddSr(uint32 sender_ssrc,
15 int number_of_report_blocks) { 16 int number_of_report_blocks) {
16 AddRtcpHeader(200, number_of_report_blocks); 17 AddRtcpHeader(200, number_of_report_blocks);
17 big_endian_writer_.WriteU32(sender_ssrc); 18 big_endian_writer_.WriteU32(sender_ssrc);
18 big_endian_writer_.WriteU32(kNtpHigh); // NTP timestamp. 19 big_endian_writer_.WriteU32(kNtpHigh); // NTP timestamp.
19 big_endian_writer_.WriteU32(kNtpLow); 20 big_endian_writer_.WriteU32(kNtpLow);
20 big_endian_writer_.WriteU32(kRtpTimestamp); 21 big_endian_writer_.WriteU32(kRtpTimestamp);
21 big_endian_writer_.WriteU32(kSendPacketCount); 22 big_endian_writer_.WriteU32(kSendPacketCount);
22 big_endian_writer_.WriteU32(kSendOctetCount); 23 big_endian_writer_.WriteU32(kSendOctetCount);
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 big_endian_writer_.WriteU8(0x80 | (format_or_count & 0x1F)); 284 big_endian_writer_.WriteU8(0x80 | (format_or_count & 0x1F));
284 big_endian_writer_.WriteU8(payload); 285 big_endian_writer_.WriteU8(payload);
285 ptr_of_length_ = big_endian_writer_.ptr(); 286 ptr_of_length_ = big_endian_writer_.ptr();
286 287
287 // Initialize length to "clearly illegal". 288 // Initialize length to "clearly illegal".
288 big_endian_writer_.WriteU16(0xDEAD); 289 big_endian_writer_.WriteU16(0xDEAD);
289 } 290 }
290 291
291 } // namespace cast 292 } // namespace cast
292 } // namespace media 293 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/rtcp/test_rtcp_packet_builder.h ('k') | media/cast/rtp_receiver/rtp_parser/rtp_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698