5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H264_H_
13 #include "packager/base/callback.h"
14 #include "packager/base/compiler_specific.h"
15 #include "packager/base/memory/scoped_ptr.h"
16 #include "packager/media/formats/mp2t/es_parser.h"
18 namespace edash_packager {
21 class H264ByteToUnitStreamConverter;
23 class OffsetByteQueue;
36 const NewStreamInfoCB& new_stream_info_cb,
37 const EmitSampleCB& emit_sample_cb);
41 bool Parse(
const uint8_t* buf,
int size, int64_t pts, int64_t dts)
override;
42 void Flush()
override;
43 void Reset()
override;
56 bool FindAUD(int64_t* stream_pos);
64 bool EmitFrame(int64_t access_unit_pos,
71 bool UpdateVideoDecoderConfig(
const H264Sps* sps);
74 NewStreamInfoCB new_stream_info_cb_;
75 EmitSampleCB emit_sample_cb_;
78 scoped_ptr<media::OffsetByteQueue> es_queue_;
79 std::list<std::pair<int64_t, TimingDesc> > timing_desc_list_;
84 scoped_ptr<H264Parser> h264_parser_;
85 int64_t current_access_unit_pos_;
86 int64_t next_access_unit_pos_;
89 scoped_ptr<H264ByteToUnitStreamConverter> stream_converter_;
92 scoped_refptr<StreamInfo> last_video_decoder_config_;
93 bool decoder_config_check_pending_;
96 scoped_refptr<MediaSample> pending_sample_;
97 uint64_t pending_sample_duration_;
100 bool waiting_for_key_frame_;