Commit 999e487e authored by Thomas Guillem's avatar Thomas Guillem

codec: hxxx_helper: add hxxx_helper_get_chroma_chroma

parent 733e8f7e
......@@ -930,6 +930,37 @@ hxxx_helper_get_current_profile_level(const struct hxxx_helper *hh,
return VLC_EGENERIC;
}
int
hxxx_helper_get_chroma_chroma(const struct hxxx_helper *hh, uint8_t *pi_chroma_format,
uint8_t *pi_depth_luma, uint8_t *pi_depth_chroma)
{
switch (hh->i_codec)
{
case VLC_CODEC_H264:
{
const struct hxxx_helper_nal *hsps = h264_helper_get_current_sps(hh);
if (hsps == NULL)
return VLC_EGENERIC;
return h264_get_chroma_luma(hsps->h264_sps, pi_chroma_format, pi_depth_luma,
pi_depth_chroma)
== true ? VLC_SUCCESS : VLC_EGENERIC;
}
case VLC_CODEC_HEVC:
{
const struct hxxx_helper_nal *hsps = &hh->hevc.sps_list[hh->hevc.i_current_sps];
if (hsps == NULL || hsps->hevc_sps == NULL)
return VLC_EGENERIC;
return hevc_get_chroma_luma(hsps->hevc_sps, pi_chroma_format, pi_depth_luma,
pi_depth_chroma)
== true ? VLC_SUCCESS : VLC_EGENERIC;
}
default:
vlc_assert_unreachable();
}
}
int
hxxx_helper_get_colorimetry(const struct hxxx_helper *hh,
video_color_primaries_t *p_primaries,
......
......@@ -106,6 +106,10 @@ int h264_helper_get_current_dpb_values(const struct hxxx_helper *hh,
int hxxx_helper_get_current_profile_level(const struct hxxx_helper *hh,
uint8_t *p_profile, uint8_t *p_level);
int
hxxx_helper_get_chroma_chroma(const struct hxxx_helper *hh, uint8_t *pi_chroma_format,
uint8_t *pi_depth_luma, uint8_t *pi_depth_chroma);
int hxxx_helper_get_colorimetry(const struct hxxx_helper *hh,
video_color_primaries_t *p_primaries,
video_transfer_func_t *p_transfer,
......
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