use crate::DecodeError;
use mediaway_common::CodecKind;
pub(super) fn h264_profile_candidates(
profile_idc: u8,
) -> Result<Vec<cros_libva::VAProfile::Type>, DecodeError> {
match profile_idc {
66 => Ok(vec![
cros_libva::VAProfile::VAProfileH264ConstrainedBaseline,
]),
77 => Ok(vec![
cros_libva::VAProfile::VAProfileH264Main,
cros_libva::VAProfile::VAProfileH264ConstrainedBaseline,
]),
_ => Err(DecodeError::Unsupported),
}
}
#[must_use]
pub(super) const fn is_supported_video_codec(codec: CodecKind) -> bool {
matches!(codec, CodecKind::H264)
}
#[cfg(test)]
#[path = "codec_tests.rs"]
mod tests;