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,
78 bool InitializeFromH264(
const uint8_t* data,
79 uint64_t size) WARN_UNUSED_RESULT;
81 bool InitializeFromH265(
const uint8_t* data,
82 uint64_t size) WARN_UNUSED_RESULT;
84 const uint8_t* data()
const {
return data_; }
85 uint64_t header_size()
const {
return header_size_; }
86 uint64_t payload_size()
const {
return payload_size_; }
89 int ref_idc()
const {
return ref_idc_; }
92 int nuh_layer_id()
const {
return nuh_layer_id_; }
93 int nuh_temporal_id()
const {
return nuh_temporal_id_; }
95 int type()
const {
return type_; }
96 bool is_video_slice()
const {
return is_video_slice_; }
101 const uint8_t* data_;
104 uint64_t header_size_;
106 uint64_t payload_size_;
110 int nuh_temporal_id_;
112 bool is_video_slice_;
137 uint8_t nal_length_size,
138 const uint8_t* stream,
139 uint64_t stream_size);
151 static bool FindStartCode(
const uint8_t* data,
154 uint8_t* start_code_size);
168 kAnnexbByteStreamFormat,
179 bool LocateNaluByStartCode(uint64_t* nalu_size, uint8_t* start_code_size);
182 const uint8_t* stream_;
184 uint64_t stream_size_;
186 CodecType nalu_type_;
189 uint8_t nalu_length_size_;
199 #endif // MEDIA_FILTERS_NALU_READER_H_