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

packetizer: hevc: add profile and level

parent 833de4e6
......@@ -487,6 +487,16 @@ static block_t * ParseAUHead(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_na
&p_dec->fmt_out.video.space,
&p_dec->fmt_out.video.b_color_range_full);
}
if(p_dec->fmt_out.i_profile == -1)
{
uint8_t i_profile, i_level;
if( hevc_get_sps_profile_tier_level( p_sps, &i_profile, &i_level ) )
{
p_dec->fmt_out.i_profile = i_profile;
p_dec->fmt_out.i_level = i_level;
}
}
}
}
}
......
......@@ -1003,6 +1003,18 @@ uint8_t hevc_get_pps_sps_id( const hevc_picture_parameter_set_t *p_pps )
return p_pps->pps_seq_parameter_set_id;
}
bool hevc_get_sps_profile_tier_level( const hevc_sequence_parameter_set_t *p_sps,
uint8_t *pi_profile, uint8_t *pi_level)
{
if(p_sps->profile_tier_level.general.profile_idc)
{
*pi_profile = p_sps->profile_tier_level.general.profile_idc;
*pi_level = p_sps->profile_tier_level.general_level_idc;
return true;
}
return false;
}
bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *p_sps,
unsigned *p_w, unsigned *p_h, unsigned *p_vw, unsigned *p_vh )
{
......
......@@ -174,6 +174,8 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
size_t *pi_res, uint8_t *pi_nal_length_size );
bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id);
bool hevc_get_sps_profile_tier_level( const hevc_sequence_parameter_set_t *,
uint8_t *pi_profile, uint8_t *pi_level );
bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w, unsigned *p_h,
unsigned *p_vw, unsigned *p_vh );
bool hevc_get_frame_rate( const hevc_sequence_parameter_set_t *,
......
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