5 #ifndef MEDIA_FORMATS_MP2T_ES_PARSER_H26x_H_
6 #define MEDIA_FORMATS_MP2T_ES_PARSER_H26x_H_
12 #include "packager/base/callback.h"
13 #include "packager/base/compiler_specific.h"
14 #include "packager/base/memory/scoped_ptr.h"
15 #include "packager/media/filters/nalu_reader.h"
16 #include "packager/media/formats/mp2t/es_parser.h"
18 namespace edash_packager {
21 class H26xByteToUnitStreamConverter;
22 class OffsetByteQueue;
31 const EmitSampleCB& emit_sample_cb);
35 bool Parse(
const uint8_t* buf,
int size, int64_t pts, int64_t dts)
override;
36 void Flush()
override;
37 void Reset()
override;
41 return stream_converter_.get();
52 virtual bool ProcessNalu(
const Nalu& nalu,
54 int* pps_id_for_access_unit) = 0;
58 virtual bool UpdateVideoDecoderConfig(
int pps_id) = 0;
64 bool FindNextAccessUnit(int64_t stream_pos, int64_t* next_unit_start);
72 bool EmitFrame(int64_t access_unit_pos,
78 EmitSampleCB emit_sample_cb_;
81 Nalu::CodecType type_;
84 scoped_ptr<media::OffsetByteQueue> es_queue_;
85 std::list<std::pair<int64_t, TimingDesc>> timing_desc_list_;
90 int64_t current_access_unit_pos_;
91 bool found_access_unit_;
94 scoped_ptr<H26xByteToUnitStreamConverter> stream_converter_;
97 scoped_refptr<MediaSample> pending_sample_;
98 uint64_t pending_sample_duration_;
101 bool waiting_for_key_frame_;