5 #ifndef MEDIA_FORMATS_MP2T_TS_PACKET_H_
6 #define MEDIA_FORMATS_MP2T_TS_PACKET_H_
10 #include "packager/base/macros.h"
21 static const int kPacketSize = 188;
25 static int Sync(
const uint8_t* buf,
int size);
30 static TsPacket* Parse(
const uint8_t* buf,
int size);
35 bool payload_unit_start_indicator()
const {
36 return payload_unit_start_indicator_;
38 int pid()
const {
return pid_; }
39 int continuity_counter()
const {
return continuity_counter_; }
40 bool discontinuity_indicator()
const {
return discontinuity_indicator_; }
41 bool random_access_indicator()
const {
return random_access_indicator_; }
44 const uint8_t* payload()
const {
return payload_; }
45 int payload_size()
const {
return payload_size_; }
52 bool ParseHeader(
const uint8_t* buf);
53 bool ParseAdaptationField(
BitReader* bit_reader,
54 int adaptation_field_length);
57 const uint8_t* payload_;
61 bool payload_unit_start_indicator_;
63 int continuity_counter_;
66 bool discontinuity_indicator_;
67 bool random_access_indicator_;