- add sources.
[platform/framework/web/crosswalk.git] / src / media / mp2t / ts_section_psi.h
1 // Copyright 2013 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_MP2T_TS_SECTION_PSI_H_
6 #define MEDIA_MP2T_TS_SECTION_PSI_H_
7
8 #include "base/compiler_specific.h"
9 #include "media/base/byte_queue.h"
10 #include "media/mp2t/ts_section.h"
11
12 namespace media {
13
14 class BitReader;
15
16 namespace mp2t {
17
18 class TsSectionPsi : public TsSection {
19  public:
20   TsSectionPsi();
21   virtual ~TsSectionPsi();
22
23   // TsSection implementation.
24   virtual bool Parse(bool payload_unit_start_indicator,
25                      const uint8* buf, int size) OVERRIDE;
26   virtual void Flush() OVERRIDE;
27   virtual void Reset() OVERRIDE;
28
29   // Parse the content of the PSI section.
30   virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
31
32   // Reset the state of the PSI section.
33   virtual void ResetPsiSection() = 0;
34
35  private:
36   void ResetPsiState();
37
38   // Bytes of the current PSI.
39   ByteQueue psi_byte_queue_;
40
41   // Do not start parsing before getting a unit start indicator.
42   bool wait_for_pusi_;
43
44   // Number of leading bytes to discard (pointer field).
45   int leading_bytes_to_discard_;
46
47   DISALLOW_COPY_AND_ASSIGN(TsSectionPsi);
48 };
49
50 }  // namespace mp2t
51 }  // namespace media
52
53 #endif
54