summaryrefslogtreecommitdiff
path: root/chromium/media/mp2t/ts_section.h
blob: 1b7453f837db9d0e7978feb80df88b7a8a629857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 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_MP2T_TS_SECTION_H_
#define MEDIA_MP2T_TS_SECTION_H_

namespace media {
namespace mp2t {

class TsSection {
 public:
  // From ISO/IEC 13818-1 or ITU H.222 spec: Table 2-3 - PID table.
  enum SpecialPid {
    kPidPat = 0x0,
    kPidCat = 0x1,
    kPidTsdt = 0x2,
    kPidNullPacket = 0x1fff,
    kPidMax = 0x1fff,
  };

  virtual ~TsSection() {}

  // Parse the data bytes of the TS packet.
  // Return true if parsing is successful.
  virtual bool Parse(bool payload_unit_start_indicator,
                     const uint8* buf, int size) = 0;

  // Process bytes that have not been processed yet (pending buffers in the
  // pipe). Flush might thus results in frame emission, as an example.
  virtual void Flush() = 0;

  // Reset the state of the parser to its initial state.
  virtual void Reset() = 0;
};

}  // namespace mp2t
}  // namespace media

#endif