7 #ifndef MEDIA_FILTERS_NALU_READER_H_
8 #define MEDIA_FILTERS_NALU_READER_H_
13 #include "packager/base/compiler_specific.h"
14 #include "packager/base/macros.h"
16 namespace edash_packager {
22 const uint8_t kIsAnnexbByteStream = 0;
38 H264_SPSExtension = 13,
39 H264_PrefixNALUnit = 14,
41 H264_DepthParameterSet = 16,
44 H264_CodedSliceExtension = 20,
55 H265_RSV_VCL_N10 = 10,
56 H265_RSV_VCL_R15 = 15,
63 H265_RSV_IRAP_VCL22 = 22,
64 H265_RSV_IRAP_VCL23 = 23,
89 bool Initialize(CodecType type,
91 uint64_t size) WARN_UNUSED_RESULT;
93 const uint8_t* data()
const {
return data_; }
94 uint64_t header_size()
const {
return header_size_; }
95 uint64_t payload_size()
const {
return payload_size_; }
98 int ref_idc()
const {
return ref_idc_; }
101 int nuh_layer_id()
const {
return nuh_layer_id_; }
102 int nuh_temporal_id()
const {
return nuh_temporal_id_; }
104 int type()
const {
return type_; }
105 bool is_video_slice()
const {
return is_video_slice_; }
106 bool can_start_access_unit()
const {
return can_start_access_unit_; }
109 bool InitializeFromH264(
const uint8_t* data, uint64_t size);
110 bool InitializeFromH265(
const uint8_t* data, uint64_t size);
114 const uint8_t* data_;
117 uint64_t header_size_;
119 uint64_t payload_size_;
123 int nuh_temporal_id_;
125 bool is_video_slice_;
126 bool can_start_access_unit_;
147 uint8_t nal_length_size,
148 const uint8_t* stream,
149 uint64_t stream_size);
161 static bool FindStartCode(
const uint8_t* data,
164 uint8_t* start_code_size);
178 kAnnexbByteStreamFormat,
189 bool LocateNaluByStartCode(uint64_t* nalu_size, uint8_t* start_code_size);
192 const uint8_t* stream_;
194 uint64_t stream_size_;
196 Nalu::CodecType nalu_type_;
199 uint8_t nalu_length_size_;
209 #endif // MEDIA_FILTERS_NALU_READER_H_