| Index: media/mpeg2/mpeg2ts_psi.h
|
| diff --git a/media/mpeg2/mpeg2ts_psi.h b/media/mpeg2/mpeg2ts_psi.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..3c755ffb364669ecc78fb2fa2a2a4c1bbb90930f
|
| --- /dev/null
|
| +++ b/media/mpeg2/mpeg2ts_psi.h
|
| @@ -0,0 +1,53 @@
|
| +// 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_PSI_PARSER_H_
|
| +#define MEDIA_MPEG2_MPEG2TS_PSI_PARSER_H_
|
| +
|
| +#include <vector>
|
| +
|
| +#include "base/callback.h"
|
| +#include "base/compiler_specific.h"
|
| +#include "media/mpeg2/mpeg2ts_section_parser.h"
|
| +
|
| +namespace media {
|
| +
|
| +class BitReader;
|
| +
|
| +namespace mpeg2ts {
|
| +
|
| +class Mpeg2TsPsiParser : public Mpeg2TsSectionParser {
|
| + public:
|
| + Mpeg2TsPsiParser();
|
| + virtual ~Mpeg2TsPsiParser();
|
| +
|
| + // Mpeg2TsSectionParser implementation.
|
| + virtual bool Parse(bool payload_unit_start_indicator,
|
| + const uint8* buf, int size) OVERRIDE;
|
| + virtual void Flush() OVERRIDE;
|
| +
|
| + // Parse the content of the PSI section.
|
| + virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
|
| +
|
| + private:
|
| + bool ParseInternal(bool payload_unit_start_indicator,
|
| + const uint8* buf, int size);
|
| + void ResetState();
|
| +
|
| + // Bytes of the current PSI.
|
| + std::vector<uint8> raw_psi_;
|
| +
|
| + // Do not start parsing before getting a unit start indicator.
|
| + bool wait_for_pusi_;
|
| +
|
| + // Number of leading bytes to discard (pointer field).
|
| + int leading_bytes_to_discard_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(Mpeg2TsPsiParser);
|
| +};
|
| +
|
| +} // namespace mpeg2ts
|
| +} // namespace media
|
| +
|
| +#endif
|
|
|