38 Commits

Author SHA1 Message Date
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
3206eedcf0
Add ChannelLayout API (#38)
* Create channel_layout directory

* Rename ChannelLayout -> ChannelLayoutMask

* Add enum Channel (<-> AVChannel)

* Add struct ChannelCustom (<-> AVChannelCustom)

* Add enum ChannelOrder (<-> AVChannelOrder)

* Add struct ChannelLayout

- Smart copy-on-write pointer to AVChannelLayout
- idiomatic Rust API wrapping around FFmpeg APIs
- no Ambisonic support (yet)
- consts will need to be manually updated

* Add ChannelLayoutIter (iterator over all standard layouts)

* Add codec/Audio::ch_layouts

* Add ch_layout API to Audio-related structs
2024-04-23 08:59:15 -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
Josh Holmer
fe89e158c0 Add serialize support for enums 2023-01-24 02:38:11 -05:00
FreezyLemon
92a8c6a9d8 add feature non-exhaustive-enums 2023-01-23 09:53:56 -05:00
FreezyLemon
28c356dd98 add wildcard branches for matches on enums 2023-01-23 09:53:52 -05:00
Polochon-street
22ad8b9598 Bump version to use ffmpeg 5 2022-02-11 17:58:42 +01:00
Polochon-street
19ab5f67ad Fix linting errors 2021-07-07 16:52:30 +02:00
Bojan Šernek
dc2a82f890
software::resampling::Context: add get_with method (#41)
get_with allows setting additional options not covered by swr_alloc_set_opts.

Signed-off-by: Zhiming Wang <i@zhimingwang.org>
2020-12-13 10:39:04 +08:00
Vasily Chekalkin
b31b5507fb
Add Send trait to resampling::Context 2020-08-07 22:31:11 +08:00
Zhiming Wang
73b66ea438
Fix clippy::redundant_field_names 2020-07-26 01:01:13 +08:00
Zhiming Wang
ba2caf9d13
software::scaling::context::run: fix srcSliceH argument
Output height was erroneously used as the srcSliceH argument to
sws_scale, causing the output frame to be partially blank when scaling
down or outright erroring when scaling up. See documentation of sws_scale:

https://www.ffmpeg.org/doxygen/4.0/group__libsws.html#gae531c9754c9205d90ad6800015046d74

Fixes #18.
2020-07-23 10:01:19 +08:00
Zhiming Wang
307f52c002
Reformat code with latest cargo fmt 2020-06-02 17:54:31 +08:00
Zhiming Wang
6644a91da4
Update bitflags to 1.2 and fix namespacing 2020-06-01 13:06:34 +08:00
Zhiming Wang
3a8f366f60
software/scaling/context: fix mutability 2020-06-01 13:02:53 +08:00
Zhiming Wang
587ec66592
Fix libc::int64_t deprecation 2020-05-31 13:34:24 +08:00
Erin Moon
a7ea073619
scaling and resampling contexts: fix null checks
dc6ace91ec

Fixes #1.
2019-02-16 21:20:56 +08:00
Tadas Barzdžius
0bcd4550b8 *: format code with rustfmt and fix clippy suggestions
* Add avformat_close_input call to clean up AVFormantContext
* Format code with rustfmt
* Fix clippy lint double_parens
* Fix clippy lint deref_addrof
* Fix clippy lint identity_conversion
* Fix clippy lint match_ref_pats
* Fix clippy lint cast_lossless
* Fix clippy lint cmp_null
* Fix clippy lint clone_on_ref_ptr
* Fix clippy lint map_clone
* Fix clippy lint needless_borrow
* Fix clippy lint needless_pass_by_value
* Fix clippy lints for examples
* Fix clippy lint unused_io_amount
* Fix clippy lint new_without_default
* Ignore inline_always clippy lint
* Add vim temp files to .gitignore
2018-04-10 16:06:42 +02:00
Tadas Barzdžius
5afe774f40 crate: update bitflags 2017-07-10 11:35:49 +02:00
Tadas Barzdžius
5ac0527bdc *: use latest ffmpeg-sys using bindgen
* Update bindings to newest ffmpeg version for new ffmpeg-sys, which is mostly generated by bindgen
* Bring back removed feature flags
* Fix whitespace formating
* Remove prepended enum names to enum variants
* Remove unneeded allows
2017-07-08 17:00:27 +02:00
Ivan Molodetskikh
6ad3d42482 software: fix typo in #[cfg] 2017-06-14 13:00:49 +02:00
meh
b48521108e *: update dependencies 2017-02-19 01:45:05 +01:00
Tae-il Lim
2ed824aaac *: upgrade to 3.2
Fix errors when built with https://github.com/meh/rust-ffmpeg-sys/pull/35.
2016-11-27 23:16:47 +01:00
meh
0c2962c573 software/resampling: add some documentation 2016-05-24 18:01:55 +02:00
meh
9fb581884d software/resampling: rename next to flush 2016-05-24 18:01:46 +02:00
Euan Rochester
fafcf1d433 *: check unsafe slice creation 2016-05-01 02:01:00 +02:00
meh
5f76845334 software/scaling/extensions: add inline attributes 2015-10-14 17:49:35 +02:00
meh
838ace388c software/resampling/extensions: add inline attributes 2015-10-14 17:49:21 +02:00
meh
25c403fa07 software/scaling/context: add inline attributes 2015-10-14 17:43:15 +02:00
meh
a33d97640d software/scaling: add helpers to frame::Video 2015-09-29 01:17:32 +02:00
meh
572f0f2045 softare: add global helpers to create contexts 2015-09-29 00:14:27 +02:00
meh
c79e8751a9 softare/resampling: add extension helpers for frame::Audio 2015-09-29 00:13:40 +02:00
meh
6c7db403f2 software/resampling: add wrapper 2015-06-08 15:53:21 +02:00
meh
2439e67fd0 software/scaling/context: allocate the output if it's empty 2015-06-08 15:52:45 +02:00
meh
ff1b880be6 *: make internal pointer handling safer 2015-06-04 03:03:19 +02:00
meh
deb08c60a0 software/scaling/context: update definitions on cached call 2015-05-28 18:44:18 +02:00
meh
5ad6a3ce1d software/scaling/extensions: remove unused imports 2015-05-28 18:17:00 +02:00
meh
8ceac13065 software/scaling: add software scaling feature 2015-05-28 18:16:07 +02:00