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

mux: mp4: encode spsext

parent a219013a
......@@ -839,6 +839,31 @@ static bo_t *GetAvcCTag(es_format_t *p_fmt)
bo_add_mem(avcC, i_pps_size, p_pps);
}
if( p_sps[1] == PROFILE_H264_HIGH ||
p_sps[1] == PROFILE_H264_HIGH_10 ||
p_sps[1] == PROFILE_H264_HIGH_422 ||
p_sps[1] == PROFILE_H264_HIGH_444 ||
p_sps[1] == PROFILE_H264_HIGH_444_PREDICTIVE )
{
h264_sequence_parameter_set_t *p_spsdata = h264_decode_sps( p_sps, i_sps_size, true );
if( p_spsdata )
{
uint8_t data[3];
if( h264_get_chroma_luma( p_spsdata, &data[0], &data[1], &data[2]) )
{
bo_add_8(avcC, 0xFC | data[0]);
bo_add_8(avcC, 0xF8 | (data[1] - 8));
bo_add_8(avcC, 0xF8 | (data[2] - 8));
bo_add_8(avcC, (i_ext_size > 0 ? 1 : 0));
if (i_ext_size > 0) {
bo_add_16be(avcC, i_ext_size);
bo_add_mem(avcC, i_ext_size, p_ext);
}
}
h264_release_sps( p_spsdata );
}
}
return avcC;
}
......
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