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 virtual bool Parse(
const uint8_t* buf,
44 int64_t dts) OVERRIDE;
45 virtual void Flush() OVERRIDE;
46 virtual void Reset() OVERRIDE;
59 bool FindAUD(int64_t* stream_pos);
67 bool EmitFrame(int64_t access_unit_pos,
74 bool UpdateVideoDecoderConfig(
const H264SPS* sps);
77 NewStreamInfoCB new_stream_info_cb_;
78 EmitSampleCB emit_sample_cb_;
81 scoped_ptr<media::OffsetByteQueue> es_queue_;
82 std::list<std::pair<int64_t, TimingDesc> > timing_desc_list_;
87 scoped_ptr<H264Parser> h264_parser_;
88 int64_t current_access_unit_pos_;
89 int64_t next_access_unit_pos_;
92 scoped_ptr<H264ByteToUnitStreamConverter> stream_converter_;
95 scoped_refptr<StreamInfo> last_video_decoder_config_;
96 bool decoder_config_check_pending_;
99 scoped_refptr<MediaSample> pending_sample_;
100 uint64_t pending_sample_duration_;
103 bool waiting_for_key_frame_;