5 #ifndef PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_AUDIO_H_
6 #define PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_AUDIO_H_
13 #include <packager/macros/classes.h>
14 #include <packager/media/base/audio_stream_info.h>
15 #include <packager/media/base/byte_queue.h>
16 #include <packager/media/formats/mp2t/es_parser.h>
17 #include <packager/media/formats/mp2t/ts_stream_type.h>
22 class AudioTimestampHelper;
32 TsStreamType stream_type,
33 const NewStreamInfoCB& new_stream_info_cb,
34 const EmitSampleCB& emit_sample_cb,
35 bool sbr_in_mimetype);
39 bool Parse(
const uint8_t* buf,
int size, int64_t pts, int64_t dts)
override;
40 bool Flush()
override;
41 void Reset()
override;
48 typedef std::pair<int, int64_t> EsPts;
49 typedef std::list<EsPts> EsPtsList;
53 bool UpdateAudioConfiguration(
const AudioHeader& audio_header);
56 void DiscardEs(
int nbytes);
58 const TsStreamType stream_type_;
59 std::unique_ptr<AudioHeader> audio_header_;
64 NewStreamInfoCB new_stream_info_cb_;
65 EmitSampleCB emit_sample_cb_;
69 bool sbr_in_mimetype_;
78 std::unique_ptr<AudioTimestampHelper> audio_timestamp_helper_;
80 std::shared_ptr<StreamInfo> last_audio_decoder_config_;
All the methods that are virtual are virtual for mocking.