Shaka Packager SDK
Loading...
Searching...
No Matches
ts_section_psi.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_PSI_H_
6#define PACKAGER_MEDIA_FORMATS_MP2T_TS_SECTION_PSI_H_
7
8#include <cstdint>
9
10#include <packager/macros/classes.h>
11#include <packager/media/base/byte_queue.h>
12#include <packager/media/formats/mp2t/ts_section.h>
13
14namespace shaka {
15namespace media {
16
17class BitReader;
18
19namespace mp2t {
20
21class TsSectionPsi : public TsSection {
22 public:
24 ~TsSectionPsi() override;
25
26 // TsSection implementation.
27 bool Parse(bool payload_unit_start_indicator,
28 const uint8_t* buf,
29 int size) override;
30 bool Flush() override;
31 void Reset() override;
32
33 // Parse the content of the PSI section.
34 virtual bool ParsePsiSection(BitReader* bit_reader) = 0;
35
36 // Reset the state of the PSI section.
37 virtual void ResetPsiSection() = 0;
38
39 private:
40 void ResetPsiState();
41
42 // Bytes of the current PSI.
43 ByteQueue psi_byte_queue_;
44
45 // Do not start parsing before getting a unit start indicator.
46 bool wait_for_pusi_;
47
48 // Number of leading bytes to discard (pointer field).
49 int leading_bytes_to_discard_;
50
51 DISALLOW_COPY_AND_ASSIGN(TsSectionPsi);
52};
53
54} // namespace mp2t
55} // namespace media
56} // namespace shaka
57
58#endif
59
A class to read bit streams.
Definition bit_reader.h:20
All the methods that are virtual are virtual for mocking.