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;
37 H264_CodedSliceExtension = 20,
47 H265_RSV_IRAP_VCL23 = 23,
57 bool InitializeFromH264(
const uint8_t* data,
58 uint64_t size) WARN_UNUSED_RESULT;
60 bool InitializeFromH265(
const uint8_t* data,
61 uint64_t size) WARN_UNUSED_RESULT;
63 const uint8_t* data()
const {
return data_; }
64 uint64_t header_size()
const {
return header_size_; }
65 uint64_t payload_size()
const {
return payload_size_; }
68 int ref_idc()
const {
return ref_idc_; }
71 int nuh_layer_id()
const {
return nuh_layer_id_; }
72 int nuh_temporal_id()
const {
return nuh_temporal_id_; }
74 int type()
const {
return type_; }
75 bool is_video_slice()
const {
return is_video_slice_; }
83 uint64_t header_size_;
85 uint64_t payload_size_;
116 uint8_t nal_length_size,
117 const uint8_t* stream,
118 uint64_t stream_size);
130 static bool FindStartCode(
const uint8_t* data,
133 uint8_t* start_code_size);
147 kAnnexbByteStreamFormat,
158 bool LocateNaluByStartCode(uint64_t* nalu_size, uint8_t* start_code_size);
161 const uint8_t* stream_;
163 uint64_t stream_size_;
168 uint8_t nalu_length_size_;
178 #endif // MEDIA_FILTERS_NALU_READER_H_