5 #ifndef PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_AUDIO_H_ 6 #define PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_AUDIO_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" 17 #include "packager/media/formats/mp2t/ts_stream_type.h" 21 class AudioTimestampHelper;
31 TsStreamType stream_type,
32 const NewStreamInfoCB& new_stream_info_cb,
33 const EmitSampleCB& emit_sample_cb,
34 bool sbr_in_mimetype);
38 bool Parse(
const uint8_t* buf,
int size, int64_t pts, int64_t dts)
override;
39 void Flush()
override;
40 void Reset()
override;
47 typedef std::pair<int, int64_t> EsPts;
48 typedef std::list<EsPts> EsPtsList;
52 bool UpdateAudioConfiguration(
const AudioHeader& audio_header);
55 void DiscardEs(
int nbytes);
57 const TsStreamType stream_type_;
58 std::unique_ptr<AudioHeader> audio_header_;
63 NewStreamInfoCB new_stream_info_cb_;
64 EmitSampleCB emit_sample_cb_;
68 bool sbr_in_mimetype_;
77 std::unique_ptr<AudioTimestampHelper> audio_timestamp_helper_;
79 std::shared_ptr<StreamInfo> last_audio_decoder_config_;
86 #endif // PACKAGER_MEDIA_FORMATS_MP2T_ES_PARSER_AUDIO_H_ All the methods that are virtual are virtual for mocking.