Roll ANGLE e754fb8..6ffeb74
[chromium-blink-merge.git] / media / formats / mp2t / ts_section_psi.h
blob063310c081dc990ff991bc2ae1f84746401d3062
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.
5 #ifndef MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_
6 #define MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_
8 #include "base/compiler_specific.h"
9 #include "media/base/byte_queue.h"
10 #include "media/formats/mp2t/ts_section.h"
12 namespace media {
14 class BitReader;
16 namespace mp2t {
18 class TsSectionPsi : public TsSection {
19 public:
20 TsSectionPsi();
21 ~TsSectionPsi() override;
23 // TsSection implementation.
24 bool Parse(bool payload_unit_start_indicator,
25 const uint8* buf, int size) override;
26 void Flush() override;
27 void Reset() override;
29 // Parse the content of the PSI section.
30 virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
32 // Reset the state of the PSI section.
33 virtual void ResetPsiSection() = 0;
35 private:
36 void ResetPsiState();
38 // Bytes of the current PSI.
39 ByteQueue psi_byte_queue_;
41 // Do not start parsing before getting a unit start indicator.
42 bool wait_for_pusi_;
44 // Number of leading bytes to discard (pointer field).
45 int leading_bytes_to_discard_;
47 DISALLOW_COPY_AND_ASSIGN(TsSectionPsi);
50 } // namespace mp2t
51 } // namespace media
53 #endif