Add FFmpeg 6.1 support (#14)
Co-authored-by: Rafie <simulping@protonmail.com>
This commit is contained in:
parent
1af767b881
commit
30aabf9033
35
.github/workflows/build.yml
vendored
35
.github/workflows/build.yml
vendored
@ -12,8 +12,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
ffmpeg_version:
|
ffmpeg_version:
|
||||||
# The windows build tests ffmpeg 6.0. There's no linux image for 6.0 at this time.
|
["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1"]
|
||||||
["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1"]
|
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -40,38 +39,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cargo fmt -- --check
|
cargo fmt -- --check
|
||||||
|
|
||||||
build-test-lint-linux-ffmpeg6:
|
|
||||||
# There is no docker image for ffmpeg 6.0, so we have to build it ourselves
|
|
||||||
name: Linux - FFmpeg 6.0 - build, test and lint
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
container: rust:latest
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
apt update
|
|
||||||
apt install -y --no-install-recommends clang curl pkg-config nasm
|
|
||||||
- name: Set up Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
- name: Build
|
|
||||||
run: |
|
|
||||||
cargo build --examples --features build
|
|
||||||
- name: Test
|
|
||||||
run: |
|
|
||||||
cargo test --examples --features build
|
|
||||||
- name: Lint
|
|
||||||
run: |
|
|
||||||
cargo clippy --examples --features build -- -D warnings
|
|
||||||
- name: Check format
|
|
||||||
run: |
|
|
||||||
cargo fmt -- --check
|
|
||||||
|
|
||||||
build-test-lint-macos:
|
build-test-lint-macos:
|
||||||
name: macOS - FFmpeg latest - build, test and lint
|
name: macOS - FFmpeg latest - build, test and lint
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ffmpeg-the-third"
|
name = "ffmpeg-the-third"
|
||||||
version = "1.2.2+ffmpeg-6.0"
|
version = "1.3.0+ffmpeg-6.1"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]
|
authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ffmpeg-sys-the-third"
|
name = "ffmpeg-sys-the-third"
|
||||||
version = "1.1.1+ffmpeg-6.0"
|
version = "1.2.0+ffmpeg-6.1"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
links = "ffmpeg"
|
links = "ffmpeg"
|
||||||
|
|
||||||
|
@ -608,6 +608,7 @@ fn check_features(
|
|||||||
("ffmpeg_5_0", 59, 18),
|
("ffmpeg_5_0", 59, 18),
|
||||||
("ffmpeg_5_1", 59, 37),
|
("ffmpeg_5_1", 59, 37),
|
||||||
("ffmpeg_6_0", 60, 3),
|
("ffmpeg_6_0", 60, 3),
|
||||||
|
("ffmpeg_6_1", 60, 31),
|
||||||
];
|
];
|
||||||
for &(ffmpeg_version_flag, lavc_version_major, lavc_version_minor) in
|
for &(ffmpeg_version_flag, lavc_version_major, lavc_version_minor) in
|
||||||
ffmpeg_lavc_versions.iter()
|
ffmpeg_lavc_versions.iter()
|
||||||
|
@ -647,6 +647,17 @@ pub enum Id {
|
|||||||
VNULL,
|
VNULL,
|
||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
ANULL,
|
ANULL,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
PDV,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
EVC,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
RTV1,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
VMIX,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
AC4,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Id {
|
impl Id {
|
||||||
@ -1944,6 +1955,16 @@ impl From<Id> for AVCodecID {
|
|||||||
Id::VNULL => AV_CODEC_ID_VNULL,
|
Id::VNULL => AV_CODEC_ID_VNULL,
|
||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
Id::ANULL => AV_CODEC_ID_ANULL,
|
Id::ANULL => AV_CODEC_ID_ANULL,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Id::PDV => AV_CODEC_ID_PDV,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Id::EVC => AV_CODEC_ID_EVC,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Id::RTV1 => AV_CODEC_ID_RTV1,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Id::VMIX => AV_CODEC_ID_VMIX,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Id::AC4 => AV_CODEC_ID_AC4,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,8 +3,6 @@ use std::mem::size_of;
|
|||||||
use std::ops::{Deref, DerefMut};
|
use std::ops::{Deref, DerefMut};
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
use libc;
|
|
||||||
|
|
||||||
use super::common::Context;
|
use super::common::Context;
|
||||||
use super::destructor;
|
use super::destructor;
|
||||||
use codec::traits;
|
use codec::traits;
|
||||||
|
@ -404,6 +404,17 @@ pub enum Pixel {
|
|||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
RGBAF32LE,
|
RGBAF32LE,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
P212BE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
P212LE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
P412BE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
P412LE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
GBRAP14BE,
|
||||||
|
|
||||||
#[cfg(feature = "rpi")]
|
#[cfg(feature = "rpi")]
|
||||||
RPI,
|
RPI,
|
||||||
#[cfg(feature = "rpi")]
|
#[cfg(feature = "rpi")]
|
||||||
@ -1215,6 +1226,17 @@ impl From<Pixel> for AVPixelFormat {
|
|||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
Pixel::RGBAF32LE => AV_PIX_FMT_RGBAF32LE,
|
Pixel::RGBAF32LE => AV_PIX_FMT_RGBAF32LE,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Pixel::P212BE => AV_PIX_FMT_P212BE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Pixel::P212LE => AV_PIX_FMT_P212LE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Pixel::P412BE => AV_PIX_FMT_P412BE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Pixel::P412LE => AV_PIX_FMT_P412LE,
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Pixel::GBRAP14BE => AV_PIX_FMT_GBRAP14BE,
|
||||||
|
|
||||||
#[cfg(feature = "rpi")]
|
#[cfg(feature = "rpi")]
|
||||||
Pixel::RPI => AV_PIX_FMT_RPI,
|
Pixel::RPI => AV_PIX_FMT_RPI,
|
||||||
#[cfg(feature = "rpi")]
|
#[cfg(feature = "rpi")]
|
||||||
|
@ -64,6 +64,9 @@ pub enum Type {
|
|||||||
|
|
||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
AMBIENT_VIEWING_ENVIRONMENT,
|
AMBIENT_VIEWING_ENVIRONMENT,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
VIDEO_HINT,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Type {
|
impl Type {
|
||||||
@ -130,6 +133,9 @@ impl From<AVFrameSideDataType> for Type {
|
|||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT => Type::AMBIENT_VIEWING_ENVIRONMENT,
|
AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT => Type::AMBIENT_VIEWING_ENVIRONMENT,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
AV_FRAME_DATA_VIDEO_HINT => Type::VIDEO_HINT,
|
||||||
|
|
||||||
#[cfg(feature = "non-exhaustive-enums")]
|
#[cfg(feature = "non-exhaustive-enums")]
|
||||||
_ => unimplemented!(),
|
_ => unimplemented!(),
|
||||||
}
|
}
|
||||||
@ -190,6 +196,9 @@ impl From<Type> for AVFrameSideDataType {
|
|||||||
|
|
||||||
#[cfg(feature = "ffmpeg_6_0")]
|
#[cfg(feature = "ffmpeg_6_0")]
|
||||||
Type::AMBIENT_VIEWING_ENVIRONMENT => AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT,
|
Type::AMBIENT_VIEWING_ENVIRONMENT => AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT,
|
||||||
|
|
||||||
|
#[cfg(feature = "ffmpeg_6_1")]
|
||||||
|
Type::VIDEO_HINT => AV_FRAME_DATA_VIDEO_HINT,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user