32 Commits

Author SHA1 Message Date
Josh Holmer
6b0e648959 Version 2.0.0 2024-05-06 02:20:01 -04:00
FreezyLemon
021c111ffb Use AVLibrary for pkg-config probing 2024-05-02 02:02:32 -04:00
FreezyLemon
40b7016177 sys: Fix clippy lints, run cargo fmt 2024-05-02 02:02:00 -04:00
FreezyLemon
a3837aeb2b
Update Cargo.toml (again) (#42)
* Move dependencies to top

* Add LICENSE symlink to sys crate, update Cargo.toml

* sys: Move features around a bit

* Move features around a bit

* Replace package `exclude` with `include` list

* Remove Cargo.lock.MSRV from crate package
2024-04-29 21:39:18 -04:00
FreezyLemon
fd2d71c92b
Support FFmpeg 7.0 (#48)
* sys: Run cargo fmt

* sys: Add new channel layout consts

* sys: Update build script for 7.0

- Add new FF_API flags
- Update version_check_info range
- Add ffmpeg_7_0 feature entry

* sys: Update non-exhaustive match statement

* Update enums

* Mark old APIs as removed with 7.0

* Make Audio frame work with 7.0

The .unwrap() in clone() is a bit wonky

* Add API for swr_alloc_set_opts2

* Use AVFrame::duration field in 7.0+

* Include 7.0 in CI runs

* Add fn ChanneLayoutIter::best

* Update examples for new API

* Add/update Context setter for ch layout
2024-04-29 21:38:37 -04:00
FreezyLemon
159e6f924d
Avoid using "static" functions in build script (#40)
* Move fetch & early return into fn build

* Pass ffmpeg_version as parameter

* Pass source_dir as parameter

* Create rustc_link_extralibs

* Use local variable instead of search()

* Pass OUT_DIR to the build function

* Return install_dir from build function

* Parametrize ffmpeg_major_version

* Remove duplicate import
2024-04-27 19:58:42 -04:00
FreezyLemon
22fda65cda
Add AVHeader type to build.rs (#39)
* Rename `is_feature` to `optional`

* Replace Library::new with two separate functions

* Add AVHeader abstraction

* Add Library::enabled helper function
2024-04-27 19:57:23 -04:00
FreezyLemon
3a9f4584a0 Update metadata in Cargo.toml 2024-04-14 13:52:11 -04:00
FreezyLemon
e7901750b4
ffmpeg-sys: Add basic impls for AVChannelLayout (#37) 2024-04-14 13:51:12 -04:00
FreezyLemon
ae70fa3f81
Use allowlist instead of blocklist in build script (#31) 2024-04-14 12:43:48 -04:00
FreezyLemon
684f758978
Replace avutil macros with const fns & clean up some code (#33)
* Replace tag/error macros with const fns

* Remove c_int -> c_int cast

These should always use the same type alias

* Remove duplicate av_strerror definition

* Document breaking change
2024-04-10 09:27:50 -04:00
FreezyLemon
1aa002a2b2 Add FF_API flags from 6.1 2024-04-10 09:26:03 -04:00
FreezyLemon
3cb87c9cae Add FF_API flags from 5.1 2024-04-10 09:26:03 -04:00
FreezyLemon
6231b4bc3a
Move channel_layout_fixed.h to rust (#28)
* Move channel layout definitions to Rust

* Add channel layouts new in 6.1

* Add new AVChannelLayout consts

* Add new channel layout values to ChannelLayout

* Realign ChannelLayout consts
2024-04-10 09:24:10 -04:00
FreezyLemon
d519d152b3
Specify MSRV & verify in CI (#23) 2024-04-08 13:44:49 -04:00
FreezyLemon
82336f4dbb
Refactor fn build in build script (#25)
* Introduce helper fn cargo_feature_enabled

* Move switch and enable! to trait

This allows a simpler `configure.` invocation

* Move external libraries into static list

* Fix incorrect feature name for libdrm
2024-04-07 09:22:37 -04:00
FreezyLemon
2d8dd6c0a5 Remove num_cpus dependency
available_parallelism is stable in Rust 1.59.0
2024-04-07 09:21:19 -04:00
FreezyLemon
52a07ed0c6
Add AVFeature type to build.rs (#22) 2024-04-06 21:35:08 -04:00
FreezyLemon
7a8643f2cc
Migrate crates to Rust edition 2021 (#24)
* Migrate ffmpeg-sys to Edition 2021

* Migrate ffmpeg to Edition 2021

* Remove now-redundant imports

* Reorder imports after edition migration
2024-04-06 21:31:36 -04:00
FreezyLemon
30aabf9033
Add FFmpeg 6.1 support (#14)
Co-authored-by: Rafie <simulping@protonmail.com>
2024-04-02 08:47:59 -04:00
Mikhail Katychev
fa2b8d13ad
Add macOS package manager search paths for pkg-config (#8) 2023-03-23 11:11:48 -04:00
Josh Holmer
0d11595259
Fix ffmpeg 6.0 support and have it verified in docker/CI properly (#7) 2023-03-08 15:09:08 -05:00
Josh Holmer
83a831befb Support ffmpeg 6.0 in sys 2023-03-07 13:08:58 -05:00
Josh Holmer
4c03911ac4 sys version 1.0.2 2023-02-10 17:30:28 -05:00
Mahmoud Al-Qudsi
d1fea08f3f Fix build against clang 16
This patch upgrades the `bindgen` dependency to version 0.64 which includes a
fix for an upstream issue broken builds when building w/ clang 16 or newer [0].

The use of a wildcard `*` was removed in bindgen 0.62 [1], code has been updated
to use the regex approach instead to continue working.

[0]: https://github.com/rust-lang/rust-bindgen/pull/2316
[1]: https://github.com/rust-lang/rust-bindgen/issues/2373
2023-02-10 17:29:37 -05:00
Josh Holmer
689a39d9eb Publish sys 1.0.1
Closes #4
2023-02-10 17:29:03 -05:00
Mahmoud Al-Qudsi
2cf12148f9 Fix ffmpeg git branch/tag release names
The ffmpeg project changed their branch/tag naming structure. There is now a
branch for the major.minor version using the old naming scheme
(release/major.minor) and a tag called n{major}.{minor}[.{patch}].

This change broke the static builds which checked out no-longer-existing ffmpeg
branches with their old name.
2023-02-03 17:05:20 -05:00
Josh Holmer
b23133e43c Update bindgen as far as we can without it breaking which they didn't document whatever caused enums to break in 0.62 2023-01-23 10:16:46 -05:00
Josh Holmer
e3d9480221 Fix build script and versioning 2023-01-23 10:11:43 -05:00
Josh Holmer
028bdb490c Update more links 2023-01-23 10:02:54 -05:00
Josh Holmer
170e3926ec Fix sys clippy lints 2023-01-23 10:01:15 -05:00
Josh Holmer
cbe6033984 Add sys crate and rename things 2023-01-23 09:59:27 -05:00