Chromium Code Reviews| Index: media/mpeg2/mpeg2ts_pes.h |
| diff --git a/media/mpeg2/mpeg2ts_pes.h b/media/mpeg2/mpeg2ts_pes.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..670ad359098ee93c380be716f1a9d30827bccfe3 |
| --- /dev/null |
| +++ b/media/mpeg2/mpeg2ts_pes.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright (c) 2013 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_MPEG2_MPEG2TS_PES_PARSER_H_ |
| +#define MEDIA_MPEG2_MPEG2TS_PES_PARSER_H_ |
| + |
| +#include <vector> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/callback.h" |
| +#include "base/compiler_specific.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "media/base/byte_queue.h" |
| +#include "media/mpeg2/mpeg2ts_section_parser.h" |
| + |
| +namespace media { |
| +namespace mpeg2ts { |
| + |
| +class EsParser; |
| + |
| +class Mpeg2TsPesParser : public Mpeg2TsSectionParser { |
| + public: |
| + explicit Mpeg2TsPesParser(EsParser* es_parser); |
|
acolwell GONE FROM CHROMIUM
2013/09/05 18:29:10
nit: use scoped_ptr<EsParser> here
damienv1
2013/09/09 23:29:45
Done.
|
| + virtual ~Mpeg2TsPesParser(); |
| + |
| + // Mpeg2TsSectionParser implementation. |
| + virtual bool Parse(bool payload_unit_start_indicator, |
| + const uint8* buf, int size) OVERRIDE; |
| + virtual void Flush() OVERRIDE; |
| + |
| + private: |
| + bool Emit(bool emit_for_unknown_size); |
|
acolwell GONE FROM CHROMIUM
2013/09/05 18:29:10
docs
damienv1
2013/09/09 23:29:45
Done.
|
| + bool ParseInternal(); |
| + void ResetState(); |
| + |
| + // Bytes of the current PES. |
| + ByteQueue pes_byte_queue_; |
| + |
| + // ES parser. |
| + scoped_ptr<EsParser> es_parser_; |
| + |
| + // Do not start parsing before getting a unit start indicator. |
| + bool wait_for_pusi_; |
| + |
| + // Used to unroll PTS and DTS. |
| + bool previous_pts_valid_; |
| + int64 previous_pts_; |
| + bool previous_dts_valid_; |
| + int64 previous_dts_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPesParser); |
| +}; |
| + |
| +} // namespace mpeg2ts |
| +} // namespace media |
| + |
| +#endif |