5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_ADTS_H_
6 #define MEDIA_FORMATS_MP2T_ES_PARSER_ADTS_H_
12 #include "packager/base/callback.h"
13 #include "packager/base/compiler_specific.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"
20 class AudioTimestampHelper;
28 const NewStreamInfoCB& new_stream_info_cb,
29 const EmitSampleCB& emit_sample_cb,
30 bool sbr_in_mimetype);
34 bool Parse(
const uint8_t* buf,
int size, int64_t pts, int64_t dts)
override;
35 void Flush()
override;
36 void Reset()
override;
40 typedef std::pair<int, int64_t> EsPts;
41 typedef std::list<EsPts> EsPtsList;
46 bool UpdateAudioConfiguration(
const uint8_t* adts_frame,
size_t frame_size);
49 void DiscardEs(
int nbytes);
54 NewStreamInfoCB new_stream_info_cb_;
55 EmitSampleCB emit_sample_cb_;
59 bool sbr_in_mimetype_;
68 std::unique_ptr<AudioTimestampHelper> audio_timestamp_helper_;
70 std::shared_ptr<StreamInfo> last_audio_decoder_config_;