Chromium Code Reviews| Index: media/formats/mp2t/es_parser_test_helper.h |
| diff --git a/media/formats/mp2t/es_parser_test_helper.h b/media/formats/mp2t/es_parser_test_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..df0f42be52a48023dd8ea56a918fa428a56dc65d |
| --- /dev/null |
| +++ b/media/formats/mp2t/es_parser_test_helper.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |
| +#define MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/time/time.h" |
| + |
| +namespace media { |
| +namespace mp2t { |
| +class EsParser; |
| + |
| +struct Packet { |
| + Packet(); |
| + |
| + // Offset in the stream. |
| + size_t offset; |
| + |
| + // Size of the packet. |
| + size_t size; |
| + |
| + // Timestamp of the packet. |
| + base::TimeDelta pts; |
| +}; |
| + |
| +// Compute the size of each packet assuming packets are given in stream order |
| +// and the last packet covers the end of the stream. |
| +void ComputePacketSize(std::vector<Packet>* packets, size_t stream_size); |
|
wolenetz
2014/07/16 00:21:04
Hmm. I'm not absolutely sure of convention here, b
wolenetz
2014/07/16 00:32:28
nit: s/* packets/* const packets/ ?
damienv1
2014/07/16 02:34:34
I reversed the 2 arguments.
wolenetz
2014/07/16 20:35:30
I don't see this reversal of arguments in PS10.
wolenetz
2014/07/16 20:35:30
never mind. I don't see * const for vectors anywhe
|
| + |
| +// Process the PES packets. |
| +// When |force_timing| is true, even the invalid negative timestamps will be |
| +// given to the ES parser. |
| +// Return true if successful, false otherwise. |
| +bool ProcessPesPackets( |
| + EsParser* es_parser, |
| + const std::vector<uint8>& stream, |
| + const std::vector<Packet>& pes_packets, |
| + bool force_timing); |
| + |
| +} // namespace mp2t |
| +} // namespace media |
| + |
| +#endif // MEDIA_FORMATS_MP2T_ES_PARSER_TEST_HELPER_H_ |