5 #ifndef PACKAGER_MEDIA_FORMATS_MP2T_MP2T_MEDIA_PARSER_H_
6 #define PACKAGER_MEDIA_FORMATS_MP2T_MP2T_MEDIA_PARSER_H_
13 #include "packager/media/base/byte_queue.h"
14 #include "packager/media/base/media_parser.h"
15 #include "packager/media/base/stream_info.h"
16 #include "packager/media/formats/mp2t/ts_stream_type.h"
39 KeySource* decryption_key_source)
override;
40 bool Flush()
override WARN_UNUSED_RESULT;
41 bool Parse(
const uint8_t* buf,
int size)
override WARN_UNUSED_RESULT;
47 void RegisterPmt(
int program_number,
int pmt_pid);
53 void RegisterPes(
int pmt_pid,
55 TsStreamType media_type,
56 const uint8_t* descriptor,
57 size_t descriptor_length);
61 void OnNewStreamInfo(uint32_t pes_pid,
62 std::shared_ptr<StreamInfo> new_stream_info);
66 void OnEmitMediaSample(uint32_t pes_pid,
67 std::shared_ptr<MediaSample> new_sample);
68 void OnEmitTextSample(uint32_t pes_pid,
69 std::shared_ptr<TextSample> new_sample);
72 bool FinishInitializationIfNeeded();
74 bool EmitRemainingSamples();
78 void set_sbr_in_mime_type(
bool sbr_in_mimetype) {
79 sbr_in_mimetype_ = sbr_in_mimetype;
87 bool sbr_in_mimetype_;
94 std::map<int, std::unique_ptr<PidState>> pids_;
101 std::bitset<256> stream_type_logged_once_;
All the methods that are virtual are virtual for mocking.