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,
42 H264_CodedSliceExtension = 20,
53 H265_RSV_VCL_N10 = 10,
54 H265_RSV_VCL_R15 = 15,
61 H265_RSV_IRAP_VCL22 = 22,
62 H265_RSV_IRAP_VCL23 = 23,
82 bool Initialize(CodecType type,
84 uint64_t size) WARN_UNUSED_RESULT;
86 const uint8_t* data()
const {
return data_; }
87 uint64_t header_size()
const {
return header_size_; }
88 uint64_t payload_size()
const {
return payload_size_; }
91 int ref_idc()
const {
return ref_idc_; }
94 int nuh_layer_id()
const {
return nuh_layer_id_; }
95 int nuh_temporal_id()
const {
return nuh_temporal_id_; }
97 int type()
const {
return type_; }
98 bool is_video_slice()
const {
return is_video_slice_; }
101 bool InitializeFromH264(
const uint8_t* data, uint64_t size);
102 bool InitializeFromH265(
const uint8_t* data, uint64_t size);
106 const uint8_t* data_;
109 uint64_t header_size_;
111 uint64_t payload_size_;
115 int nuh_temporal_id_;
117 bool is_video_slice_;
138 uint8_t nal_length_size,
139 const uint8_t* stream,
140 uint64_t stream_size);
152 static bool FindStartCode(
const uint8_t* data,
155 uint8_t* start_code_size);
169 kAnnexbByteStreamFormat,
180 bool LocateNaluByStartCode(uint64_t* nalu_size, uint8_t* start_code_size);
183 const uint8_t* stream_;
185 uint64_t stream_size_;
187 Nalu::CodecType nalu_type_;
190 uint8_t nalu_length_size_;
200 #endif // MEDIA_FILTERS_NALU_READER_H_