5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_ADTS_H_
6 #define MEDIA_FORMATS_MP2T_ES_PARSER_ADTS_H_
11 #include "packager/base/callback.h"
12 #include "packager/base/compiler_specific.h"
13 #include "packager/base/memory/scoped_ptr.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 scoped_ptr<AudioTimestampHelper> audio_timestamp_helper_;
70 scoped_refptr<StreamInfo> last_audio_decoder_config_;