feat: Add AV1 to WiVRn encoder configuration (fixes #125)

This commit is contained in:
Sapphire ­ 2024-10-16 05:36:45 +00:00 committed by Gabriele Musco
commit 6b2818f266
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE

View file

@ -53,6 +53,7 @@ impl From<&Encoder> for u32 {
pub enum Codec {
H264,
H265,
AV1,
}
impl Display for Codec {
@ -60,17 +61,18 @@ impl Display for Codec {
f.write_str(match self {
Self::H264 => "h264",
Self::H265 => "h265",
Self::AV1 => "av1",
})
}
}
impl Codec {
pub fn iter() -> Iter<'static, Self> {
[Self::H264, Self::H265].iter()
[Self::H264, Self::H265, Self::AV1].iter()
}
pub fn as_vec() -> Vec<Self> {
vec![Self::H264, Self::H265]
vec![Self::H264, Self::H265, Self::AV1]
}
}
@ -79,6 +81,7 @@ impl From<&Codec> for u32 {
match value {
Codec::H264 => 0,
Codec::H265 => 1,
Codec::AV1 => 2,
}
}
}