Commit d086f97d authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hevc: add get_profile_level

parent aa489cf0
......@@ -1173,3 +1173,23 @@ bool hevc_get_slice_type( const hevc_slice_segment_header_t *p_sli, enum hevc_sl
}
return false;
}
bool hevc_get_profile_level(const es_format_t *p_fmt, uint8_t *pi_profile,
uint8_t *pi_level, uint8_t *pi_nal_length_size)
{
const uint8_t *p = (const uint8_t*)p_fmt->p_extra;
if(p_fmt->i_extra < 23 || p[0] != 1)
return false;
/* HEVCDecoderConfigurationRecord */
if(pi_profile)
*pi_profile = p[1] & 0x1F;
if(pi_level)
*pi_level = p[12];
if (pi_nal_length_size)
*pi_nal_length_size = 1 + (p[21]&0x03);
return true;
}
......@@ -182,4 +182,8 @@ bool hevc_get_colorimetry( const hevc_sequence_parameter_set_t *p_sps,
bool *p_full_range );
bool hevc_get_slice_type( const hevc_slice_segment_header_t *, enum hevc_slice_type_e * );
/* Get level and Profile from DecoderConfigurationRecord */
bool hevc_get_profile_level(const es_format_t *p_fmt, uint8_t *pi_profile,
uint8_t *pi_level, uint8_t *pi_nal_length_size);
#endif /* HEVC_NAL_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment