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

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

Issue 2158923004: Convert media constants to constexpr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <sstream> 8 #include <sstream>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 stream_ = stream_with_aud; 132 stream_ = stream_with_aud;
133 access_units_ = access_units_with_aud; 133 access_units_ = access_units_with_aud;
134 } 134 }
135 135
136 void EsParserH264Test::GetPesTimestamps(std::vector<Packet>* pes_packets_ptr) { 136 void EsParserH264Test::GetPesTimestamps(std::vector<Packet>* pes_packets_ptr) {
137 DCHECK(pes_packets_ptr); 137 DCHECK(pes_packets_ptr);
138 const std::vector<Packet>& pes_packets = *pes_packets_ptr; 138 const std::vector<Packet>& pes_packets = *pes_packets_ptr;
139 139
140 // Default: set to a negative timestamp to be able to differentiate from 140 // Default: set to a negative timestamp to be able to differentiate from
141 // real timestamps. 141 // real timestamps.
142 // Note: we don't use kNoTimestamp() here since this one has already 142 // Note: we don't use kNoTimestamp here since this one has already
143 // a special meaning in EsParserH264. The negative timestamps should be 143 // a special meaning in EsParserH264. The negative timestamps should be
144 // ultimately discarded by the H264 parser since not relevant. 144 // ultimately discarded by the H264 parser since not relevant.
145 for (size_t k = 0; k < pes_packets.size(); k++) { 145 for (size_t k = 0; k < pes_packets.size(); k++) {
146 (*pes_packets_ptr)[k].pts = base::TimeDelta::FromMilliseconds(-1); 146 (*pes_packets_ptr)[k].pts = base::TimeDelta::FromMilliseconds(-1);
147 } 147 }
148 148
149 // Set a valid timestamp for PES packets which include the start 149 // Set a valid timestamp for PES packets which include the start
150 // of an H264 access unit. 150 // of an H264 access unit.
151 size_t pes_idx = 0; 151 size_t pes_idx = 0;
152 for (size_t k = 0; k < access_units_.size(); k++) { 152 for (size_t k = 0; k < access_units_.size(); k++) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 EXPECT_TRUE(Process(pes_packets, false)); 253 EXPECT_TRUE(Process(pes_packets, false));
254 CheckAccessUnits(); 254 CheckAccessUnits();
255 255
256 // Process PES packets forcing timings for each PES packet. 256 // Process PES packets forcing timings for each PES packet.
257 EXPECT_TRUE(Process(pes_packets, true)); 257 EXPECT_TRUE(Process(pes_packets, true));
258 CheckAccessUnits(); 258 CheckAccessUnits();
259 } 259 }
260 260
261 } // namespace mp2t 261 } // namespace mp2t
262 } // namespace media 262 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698