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

Side by Side Diff: media/formats/mp2t/es_parser_h264_unittest.cc

Issue 1534273002: Switch to standard integer types in media/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more Created 5 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 unified diff | Download patch
OLDNEW
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 #include <sstream> 5 #include <sstream>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (nal_unit_type == H264NALU::kIDRSlice || 97 if (nal_unit_type == H264NALU::kIDRSlice ||
98 nal_unit_type == H264NALU::kNonIDRSlice) { 98 nal_unit_type == H264NALU::kNonIDRSlice) {
99 start_access_unit = true; 99 start_access_unit = true;
100 } 100 }
101 } 101 }
102 102
103 ComputePacketSize(&access_units_); 103 ComputePacketSize(&access_units_);
104 } 104 }
105 105
106 void EsParserH264Test::InsertAUD() { 106 void EsParserH264Test::InsertAUD() {
107 uint8 aud[] = { 0x00, 0x00, 0x01, 0x09 }; 107 uint8_t aud[] = {0x00, 0x00, 0x01, 0x09};
108 108
109 std::vector<uint8> stream_with_aud( 109 std::vector<uint8_t> stream_with_aud(stream_.size() +
110 stream_.size() + access_units_.size() * sizeof(aud)); 110 access_units_.size() * sizeof(aud));
111 std::vector<EsParserTestBase::Packet> access_units_with_aud( 111 std::vector<EsParserTestBase::Packet> access_units_with_aud(
112 access_units_.size()); 112 access_units_.size());
113 113
114 size_t offset = 0; 114 size_t offset = 0;
115 for (size_t k = 0; k < access_units_.size(); k++) { 115 for (size_t k = 0; k < access_units_.size(); k++) {
116 access_units_with_aud[k].offset = offset; 116 access_units_with_aud[k].offset = offset;
117 access_units_with_aud[k].size = access_units_[k].size + sizeof(aud); 117 access_units_with_aud[k].size = access_units_[k].size + sizeof(aud);
118 118
119 memcpy(&stream_with_aud[offset], aud, sizeof(aud)); 119 memcpy(&stream_with_aud[offset], aud, sizeof(aud));
120 offset += sizeof(aud); 120 offset += sizeof(aud);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 EXPECT_TRUE(Process(pes_packets, false)); 249 EXPECT_TRUE(Process(pes_packets, false));
250 CheckAccessUnits(); 250 CheckAccessUnits();
251 251
252 // Process PES packets forcing timings for each PES packet. 252 // Process PES packets forcing timings for each PES packet.
253 EXPECT_TRUE(Process(pes_packets, true)); 253 EXPECT_TRUE(Process(pes_packets, true));
254 CheckAccessUnits(); 254 CheckAccessUnits();
255 } 255 }
256 256
257 } // namespace mp2t 257 } // namespace mp2t
258 } // namespace media 258 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698