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,
56 H265_RSV_VCL_N10 = 10,
57 H265_RSV_VCL_R15 = 15,
64 H265_RSV_IRAP_VCL22 = 22,
65 H265_RSV_IRAP_VCL23 = 23,
91 bool Initialize(CodecType type,
93 uint64_t size) WARN_UNUSED_RESULT;
95 const uint8_t* data()
const {
return data_; }
96 uint64_t header_size()
const {
return header_size_; }
97 uint64_t payload_size()
const {
return payload_size_; }
100 int ref_idc()
const {
return ref_idc_; }
103 int nuh_layer_id()
const {
return nuh_layer_id_; }
104 int nuh_temporal_id()
const {
return nuh_temporal_id_; }
106 int type()
const {
return type_; }
107 bool is_video_slice()
const {
return is_video_slice_; }
108 bool can_start_access_unit()
const {
return can_start_access_unit_; }
111 bool InitializeFromH264(
const uint8_t* data, uint64_t size);
112 bool InitializeFromH265(
const uint8_t* data, uint64_t size);
116 const uint8_t* data_;
119 uint64_t header_size_;
121 uint64_t payload_size_;
125 int nuh_temporal_id_;
127 bool is_video_slice_;
128 bool can_start_access_unit_;
149 uint8_t nal_length_size,
150 const uint8_t* stream,
151 uint64_t stream_size);
163 static bool FindStartCode(
const uint8_t* data,
166 uint8_t* start_code_size);
180 kAnnexbByteStreamFormat,
191 bool LocateNaluByStartCode(uint64_t* nalu_size, uint8_t* start_code_size);
194 const uint8_t* stream_;
196 uint64_t stream_size_;
198 Nalu::CodecType nalu_type_;
201 uint8_t nalu_length_size_;
211 #endif // MEDIA_FILTERS_NALU_READER_H_