| OLD | NEW |
| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/memory_mapped_file.h" | 10 #include "base/files/memory_mapped_file.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 bool force_timing) { | 199 bool force_timing) { |
| 200 EsParserH264 es_parser( | 200 EsParserH264 es_parser( |
| 201 base::Bind(&EsParserH264Test::NewVideoConfig, base::Unretained(this)), | 201 base::Bind(&EsParserH264Test::NewVideoConfig, base::Unretained(this)), |
| 202 base::Bind(&EsParserH264Test::EmitBuffer, base::Unretained(this))); | 202 base::Bind(&EsParserH264Test::EmitBuffer, base::Unretained(this))); |
| 203 | 203 |
| 204 for (size_t k = 0; k < pes_packets.size(); k++) { | 204 for (size_t k = 0; k < pes_packets.size(); k++) { |
| 205 size_t cur_pes_offset = pes_packets[k].offset; | 205 size_t cur_pes_offset = pes_packets[k].offset; |
| 206 size_t cur_pes_size = pes_packets[k].size; | 206 size_t cur_pes_size = pes_packets[k].size; |
| 207 | 207 |
| 208 base::TimeDelta pts = kNoTimestamp(); | 208 base::TimeDelta pts = kNoTimestamp(); |
| 209 base::TimeDelta dts = kNoTimestamp(); | 209 DecodeTimestamp dts = kNoDecodeTimestamp(); |
| 210 if (pes_packets[k].pts >= base::TimeDelta() || force_timing) | 210 if (pes_packets[k].pts >= base::TimeDelta() || force_timing) |
| 211 pts = pes_packets[k].pts; | 211 pts = pes_packets[k].pts; |
| 212 | 212 |
| 213 ASSERT_TRUE( | 213 ASSERT_TRUE( |
| 214 es_parser.Parse(&stream_[cur_pes_offset], cur_pes_size, pts, dts)); | 214 es_parser.Parse(&stream_[cur_pes_offset], cur_pes_size, pts, dts)); |
| 215 } | 215 } |
| 216 es_parser.Flush(); | 216 es_parser.Flush(); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void EsParserH264Test::EmitBuffer(scoped_refptr<StreamParserBuffer> buffer) { | 219 void EsParserH264Test::EmitBuffer(scoped_refptr<StreamParserBuffer> buffer) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 EXPECT_EQ(buffer_count_, access_units_.size()); | 290 EXPECT_EQ(buffer_count_, access_units_.size()); |
| 291 | 291 |
| 292 // Process PES packets forcing timings for each PES packet. | 292 // Process PES packets forcing timings for each PES packet. |
| 293 buffer_count_ = 0; | 293 buffer_count_ = 0; |
| 294 ProcessPesPackets(pes_packets, true); | 294 ProcessPesPackets(pes_packets, true); |
| 295 EXPECT_EQ(buffer_count_, access_units_.size()); | 295 EXPECT_EQ(buffer_count_, access_units_.size()); |
| 296 } | 296 } |
| 297 | 297 |
| 298 } // namespace mp2t | 298 } // namespace mp2t |
| 299 } // namespace media | 299 } // namespace media |
| 300 | |
| OLD | NEW |