OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |
| 6 #define MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/time/time.h" |
| 11 |
| 12 namespace media { |
| 13 namespace mp2t { |
| 14 class EsParser; |
| 15 |
| 16 struct Packet { |
| 17 Packet(); |
| 18 |
| 19 // Offset in the stream. |
| 20 size_t offset; |
| 21 |
| 22 // Size of the packet. |
| 23 size_t size; |
| 24 |
| 25 // Timestamp of the packet. |
| 26 base::TimeDelta pts; |
| 27 }; |
| 28 |
| 29 // Compute the size of each packet assuming packets are given in stream order |
| 30 // and the last packet covers the end of the stream. |
| 31 void ComputePacketSize(std::vector<Packet>* packets, size_t stream_size); |
| 32 |
| 33 // Process the PES packets. |
| 34 // When |force_timing| is true, even the invalid negative timestamps will be |
| 35 // given to the ES parser. |
| 36 // Return true if successful, false otherwise. |
| 37 bool ProcessPesPackets( |
| 38 EsParser* es_parser, |
| 39 const std::vector<uint8>& stream, |
| 40 const std::vector<Packet>& pes_packets, |
| 41 bool force_timing); |
| 42 |
| 43 } // namespace mp2t |
| 44 } // namespace media |
| 45 |
| 46 #endif // MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |
OLD | NEW |