Shaka Packager SDK
Loading...
Searching...
No Matches
ts_section.h
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.
4
5#ifndef PACKAGER_MEDIA_FORMATS_MP2T_TS_SECTION_H_
6#define PACKAGER_MEDIA_FORMATS_MP2T_TS_SECTION_H_
7
8namespace shaka {
9namespace media {
10namespace mp2t {
11
12class TsSection {
13 public:
14 // From ISO/IEC 13818-1 or ITU H.222 spec: Table 2-3 - PID table.
15 enum SpecialPid {
16 kPidPat = 0x0,
17 kPidCat = 0x1,
18 kPidTsdt = 0x2,
19 kPidNullPacket = 0x1fff,
20 kPidMax = 0x1fff,
21 };
22
23 virtual ~TsSection() {}
24
25 // Parse the data bytes of the TS packet.
26 // Return true if parsing is successful.
27 virtual bool Parse(bool payload_unit_start_indicator,
28 const uint8_t* buf,
29 int size) = 0;
30
31 // Process bytes that have not been processed yet (pending buffers in the
32 // pipe). Flush might thus results in frame emission, as an example.
33 virtual bool Flush() = 0;
34
35 // Reset the state of the parser to its initial state.
36 virtual void Reset() = 0;
37};
38
39} // namespace mp2t
40} // namespace media
41} // namespace shaka
42
43#endif
All the methods that are virtual are virtual for mocking.