Add missing enum variants for FFmpeg 6.1 (#16)

This commit is contained in:
FreezyLemon
2024-04-03 18:27:13 +02:00
committed by GitHub
parent e294e14fe2
commit f269020af8
3 changed files with 41 additions and 1 deletions

View File

@ -41,7 +41,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
# Only save cache for one FFmpeg version
save-if: matrix.ffmpeg_version == "6.1"
save-if: ${{ matrix.ffmpeg_version == '6.1' }}
- name: Check format
run: cargo fmt -- --check

View File

@ -658,6 +658,10 @@ pub enum Id {
VMIX,
#[cfg(feature = "ffmpeg_6_1")]
AC4,
#[cfg(feature = "ffmpeg_6_1")]
OSQ,
#[cfg(feature = "ffmpeg_6_1")]
SMPTE_2038,
}
impl Id {
@ -1310,6 +1314,21 @@ impl From<AVCodecID> for Id {
#[cfg(feature = "ffmpeg_6_0")]
AV_CODEC_ID_ANULL => Id::ANULL,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_PDV => Id::PDV,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_EVC => Id::EVC,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_RTV1 => Id::RTV1,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_VMIX => Id::VMIX,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_AC4 => Id::AC4,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_OSQ => Id::OSQ,
#[cfg(feature = "ffmpeg_6_1")]
AV_CODEC_ID_SMPTE_2038 => Id::SMPTE_2038,
#[cfg(feature = "non-exhaustive-enums")]
_ => unimplemented!(),
}
@ -1965,6 +1984,10 @@ impl From<Id> for AVCodecID {
Id::VMIX => AV_CODEC_ID_VMIX,
#[cfg(feature = "ffmpeg_6_1")]
Id::AC4 => AV_CODEC_ID_AC4,
#[cfg(feature = "ffmpeg_6_1")]
Id::OSQ => AV_CODEC_ID_OSQ,
#[cfg(feature = "ffmpeg_6_1")]
Id::SMPTE_2038 => AV_CODEC_ID_SMPTE_2038,
}
}
}

View File

@ -414,6 +414,8 @@ pub enum Pixel {
P412LE,
#[cfg(feature = "ffmpeg_6_1")]
GBRAP14BE,
#[cfg(feature = "ffmpeg_6_1")]
GBRAP14LE,
#[cfg(feature = "rpi")]
RPI,
@ -810,6 +812,19 @@ impl From<AVPixelFormat> for Pixel {
#[cfg(feature = "ffmpeg_6_0")]
AV_PIX_FMT_RGBAF32LE => Pixel::RGBAF32LE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_P212BE => Pixel::P212BE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_P212LE => Pixel::P212LE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_P412BE => Pixel::P412BE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_P412LE => Pixel::P412LE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_GBRAP14BE => Pixel::GBRAP14BE,
#[cfg(feature = "ffmpeg_6_1")]
AV_PIX_FMT_GBRAP14LE => Pixel::GBRAP14LE,
#[cfg(feature = "rpi")]
AV_PIX_FMT_RPI => Pixel::RPI,
#[cfg(feature = "rpi")]
@ -1236,6 +1251,8 @@ impl From<Pixel> for AVPixelFormat {
Pixel::P412LE => AV_PIX_FMT_P412LE,
#[cfg(feature = "ffmpeg_6_1")]
Pixel::GBRAP14BE => AV_PIX_FMT_GBRAP14BE,
#[cfg(feature = "ffmpeg_6_1")]
Pixel::GBRAP14LE => AV_PIX_FMT_GBRAP14LE,
#[cfg(feature = "rpi")]
Pixel::RPI => AV_PIX_FMT_RPI,