Skip to content

Commit a7b50dd

Browse files
authored
Update to FFmpeg 7.1 (#213)
* Prepare for ffmpeg 7.1 * Add LCEVC * Add LCEVC * Update for 7.1 * Update versions
1 parent 5c7bb71 commit a7b50dd

File tree

8 files changed

+87
-9
lines changed

8 files changed

+87
-9
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
1212
strategy:
1313
matrix:
14-
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1"]
14+
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1", "7.0"]
1515
fail-fast: false
1616
steps:
1717
- uses: actions/checkout@v2
@@ -106,22 +106,22 @@ jobs:
106106
- name: Check format
107107
run: |
108108
cargo fmt -- --check
109-
# Added only because there is no ffmpeg7.0 docker image here yet
109+
# Added only because there is no ffmpeg7.1 docker image here yet
110110
# https://github.com/jrottenberg/ffmpeg
111-
build-test-lint-7-0:
112-
name: FFmpeg 7.0 - build, test and lint
111+
build-test-lint-7-1:
112+
name: FFmpeg 7.1 - build, test and lint
113113
runs-on: ubuntu-latest
114114
strategy:
115115
fail-fast: false
116116
env:
117-
FFMPEG_DIR: /home/runner/work/rust-ffmpeg/rust-ffmpeg/ffmpeg-7.0-linux-clang-default
117+
FFMPEG_DIR: /home/runner/work/rust-ffmpeg/rust-ffmpeg/ffmpeg-7.1-linux-clang-default
118118
steps:
119119
- uses: actions/checkout@v2
120120
- name: Install dependencies
121121
run: |
122122
sudo apt update
123123
sudo apt install -y --no-install-recommends clang curl pkg-config xz-utils libxv-dev
124-
curl -L https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-7.0-linux-clang-default.tar.xz/download -o ffmpeg.tar.xz
124+
curl -L https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-7.1-linux-clang-default.tar.xz/download -o ffmpeg.tar.xz
125125
tar -xf ffmpeg.tar.xz
126126
- name: Set up Rust
127127
uses: actions-rs/toolchain@v1

Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ffmpeg-next"
3-
version = "7.0.4"
3+
version = "7.1.0"
44
build = "build.rs"
55

66
authors = ["meh. <[email protected]>", "Zhiming Wang <[email protected]>"]
@@ -27,6 +27,7 @@ ffmpeg41 = []
2727
ffmpeg4 = []
2828

2929
static = ["ffmpeg-sys-next/static"]
30+
non-exhaustive-enums = ["ffmpeg-sys-next/non-exhaustive-enums"]
3031
build = ["static", "ffmpeg-sys-next/build"]
3132

3233
# licensing
@@ -106,12 +107,12 @@ rpi = []
106107

107108
[dependencies]
108109
libc = "0.2"
109-
bitflags = "2.5"
110+
bitflags = "2.6"
110111

111112
[dependencies.image]
112113
version = "0.25"
113114
optional = true
114115

115116
[dependencies.ffmpeg-sys-next]
116-
version = "7.0.2"
117+
version = "7.1.0"
117118
default-features = false

src/codec/id.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,11 @@ pub enum Id {
665665
QOA,
666666
#[cfg(feature = "ffmpeg_7_0")]
667667
LEAD,
668+
669+
#[cfg(feature = "ffmpeg_7_1")]
670+
LC3,
671+
#[cfg(feature = "ffmpeg_7_1")]
672+
LCEVC,
668673
}
669674

670675
impl Id {
@@ -1337,6 +1342,11 @@ impl From<AVCodecID> for Id {
13371342
AV_CODEC_ID_QOA => Id::QOA,
13381343
#[cfg(feature = "ffmpeg_7_0")]
13391344
AV_CODEC_ID_LEAD => Id::LEAD,
1345+
1346+
#[cfg(feature = "ffmpeg_7_1")]
1347+
AV_CODEC_ID_LC3 => Id::LC3,
1348+
#[cfg(feature = "ffmpeg_7_1")]
1349+
AV_CODEC_ID_LCEVC => Id::LCEVC,
13401350
}
13411351
}
13421352
}
@@ -2001,6 +2011,11 @@ impl From<Id> for AVCodecID {
20012011
Id::QOA => AV_CODEC_ID_QOA,
20022012
#[cfg(feature = "ffmpeg_7_0")]
20032013
Id::LEAD => AV_CODEC_ID_LEAD,
2014+
2015+
#[cfg(feature = "ffmpeg_7_1")]
2016+
Id::LC3 => AV_CODEC_ID_LC3,
2017+
#[cfg(feature = "ffmpeg_7_1")]
2018+
Id::LCEVC => AV_CODEC_ID_LCEVC,
20042019
}
20052020
}
20062021
}

src/codec/packet/side_data.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ pub enum Type {
6363
IAMF_RECON_GAIN_INFO_PARAM,
6464
#[cfg(feature = "ffmpeg_7_0")]
6565
AMBIENT_VIEWING_ENVIRONMENT,
66+
67+
#[cfg(feature = "ffmpeg_7_1")]
68+
FRAME_CROPPING,
69+
#[cfg(feature = "ffmpeg_7_1")]
70+
LCEVC,
6671
}
6772

6873
impl From<AVPacketSideDataType> for Type {
@@ -124,6 +129,11 @@ impl From<AVPacketSideDataType> for Type {
124129
AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM => Type::IAMF_RECON_GAIN_INFO_PARAM,
125130
#[cfg(feature = "ffmpeg_7_0")]
126131
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT => Type::AMBIENT_VIEWING_ENVIRONMENT,
132+
133+
#[cfg(feature = "ffmpeg_7_1")]
134+
AV_PKT_DATA_FRAME_CROPPING => Type::FRAME_CROPPING,
135+
#[cfg(feature = "ffmpeg_7_1")]
136+
AV_PKT_DATA_LCEVC => Type::LCEVC,
127137
}
128138
}
129139
}
@@ -187,6 +197,11 @@ impl From<Type> for AVPacketSideDataType {
187197
Type::IAMF_RECON_GAIN_INFO_PARAM => AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM,
188198
#[cfg(feature = "ffmpeg_7_0")]
189199
Type::AMBIENT_VIEWING_ENVIRONMENT => AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
200+
201+
#[cfg(feature = "ffmpeg_7_1")]
202+
Type::FRAME_CROPPING => AV_PKT_DATA_FRAME_CROPPING,
203+
#[cfg(feature = "ffmpeg_7_1")]
204+
Type::LCEVC => AV_PKT_DATA_LCEVC,
190205
}
191206
}
192207
}

src/format/stream/disposition.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,7 @@ bitflags! {
1818
const CAPTIONS = AV_DISPOSITION_CAPTIONS;
1919
const DESCRIPTIONS = AV_DISPOSITION_DESCRIPTIONS;
2020
const METADATA = AV_DISPOSITION_METADATA;
21+
#[cfg(feature = "ffmpeg_7_1")]
22+
const MULTILAYER = AV_DISPOSITION_MULTILAYER;
2123
}
2224
}

src/util/color/space.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ pub enum Space {
2222
ChromaDerivedNCL,
2323
ChromaDerivedCL,
2424
ICTCP,
25+
26+
#[cfg(feature = "ffmpeg_7_1")]
27+
IPT_C2,
28+
#[cfg(feature = "ffmpeg_7_1")]
29+
YCGCO_RE,
30+
#[cfg(feature = "ffmpeg_7_1")]
31+
YCGCO_RO,
2532
}
2633

2734
impl Space {
@@ -59,6 +66,13 @@ impl From<AVColorSpace> for Space {
5966
AVCOL_SPC_CHROMA_DERIVED_NCL => Space::ChromaDerivedNCL,
6067
AVCOL_SPC_CHROMA_DERIVED_CL => Space::ChromaDerivedCL,
6168
AVCOL_SPC_ICTCP => Space::ICTCP,
69+
70+
#[cfg(feature = "ffmpeg_7_1")]
71+
AVCOL_SPC_IPT_C2 => Space::IPT_C2,
72+
#[cfg(feature = "ffmpeg_7_1")]
73+
AVCOL_SPC_YCGCO_RE => Space::YCGCO_RE,
74+
#[cfg(feature = "ffmpeg_7_1")]
75+
AVCOL_SPC_YCGCO_RO => Space::YCGCO_RO,
6276
}
6377
}
6478
}
@@ -82,6 +96,13 @@ impl From<Space> for AVColorSpace {
8296
Space::ChromaDerivedNCL => AVCOL_SPC_CHROMA_DERIVED_NCL,
8397
Space::ChromaDerivedCL => AVCOL_SPC_CHROMA_DERIVED_CL,
8498
Space::ICTCP => AVCOL_SPC_ICTCP,
99+
100+
#[cfg(feature = "ffmpeg_7_1")]
101+
Space::IPT_C2 => AVCOL_SPC_IPT_C2,
102+
#[cfg(feature = "ffmpeg_7_1")]
103+
Space::YCGCO_RE => AVCOL_SPC_YCGCO_RE,
104+
#[cfg(feature = "ffmpeg_7_1")]
105+
Space::YCGCO_RO => AVCOL_SPC_YCGCO_RO,
85106
}
86107
}
87108
}

src/util/frame/side_data.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ pub enum Type {
6464

6565
#[cfg(feature = "ffmpeg_6_1")]
6666
VIDEO_HINT,
67+
68+
#[cfg(feature = "ffmpeg_7_1")]
69+
LCEVC,
70+
#[cfg(feature = "ffmpeg_7_1")]
71+
VIEW_ID,
6772
}
6873

6974
impl Type {
@@ -132,6 +137,11 @@ impl From<AVFrameSideDataType> for Type {
132137

133138
#[cfg(feature = "ffmpeg_6_1")]
134139
AV_FRAME_DATA_VIDEO_HINT => Type::VIDEO_HINT,
140+
141+
#[cfg(feature = "ffmpeg_7_1")]
142+
AV_FRAME_DATA_LCEVC => Type::LCEVC,
143+
#[cfg(feature = "ffmpeg_7_1")]
144+
AV_FRAME_DATA_VIEW_ID => Type::VIEW_ID,
135145
}
136146
}
137147
}
@@ -193,6 +203,11 @@ impl From<Type> for AVFrameSideDataType {
193203

194204
#[cfg(feature = "ffmpeg_6_1")]
195205
Type::VIDEO_HINT => AV_FRAME_DATA_VIDEO_HINT,
206+
207+
#[cfg(feature = "ffmpeg_7_1")]
208+
Type::LCEVC => AV_FRAME_DATA_LCEVC,
209+
#[cfg(feature = "ffmpeg_7_1")]
210+
Type::VIEW_ID => AV_FRAME_DATA_VIEW_ID,
196211
}
197212
}
198213
}

src/util/option/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ pub enum Type {
2828
FlagArray,
2929
c_ulong,
3030
bool,
31+
32+
#[cfg(feature = "ffmpeg_7_1")]
33+
UInt,
3134
}
3235

3336
impl From<AVOptionType> for Type {
@@ -58,6 +61,9 @@ impl From<AVOptionType> for Type {
5861
AV_OPT_TYPE_CHLAYOUT => Type::ChannelLayout,
5962
#[cfg(feature = "ffmpeg_7_0")]
6063
AV_OPT_TYPE_FLAG_ARRAY => Type::FlagArray,
64+
65+
#[cfg(feature = "ffmpeg_7_1")]
66+
AV_OPT_TYPE_UINT => Type::UInt,
6167
}
6268
}
6369
}
@@ -90,6 +96,9 @@ impl From<Type> for AVOptionType {
9096
Type::ChannelLayout => AV_OPT_TYPE_CHLAYOUT,
9197
#[cfg(feature = "ffmpeg_7_0")]
9298
Type::FlagArray => AV_OPT_TYPE_FLAG_ARRAY,
99+
100+
#[cfg(feature = "ffmpeg_7_1")]
101+
Type::UInt => AV_OPT_TYPE_UINT,
93102
}
94103
}
95104
}

0 commit comments

Comments
 (0)