455 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
0107b62f56
Fix avfiltergraph input output (#44)
* Port append_inout to rust

* impl Drop for filter::graph::Parser
2024-04-29 21:36:14 -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
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
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
9eab7820bb
Fix PadIter in FFmpeg pre-5.0 (#17) 2024-04-03 14:51:12 -04:00
FreezyLemon
f269020af8
Add missing enum variants for FFmpeg 6.1 (#16) 2024-04-03 12:27:13 -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
Josh Holmer
1af767b881 Silence clippy false positive 2023-11-08 08:34:32 -05:00
Nebojsa Sabovic
05bad6e9e0 Propagate errors in Input::packets(). 2023-04-28 09:05:12 -04:00
Josh Holmer
e3d3c4a11e Fix ffmpeg 4.x 2023-03-07 13:29:18 -05:00
Josh Holmer
c6dd54003e Support ffmpeg 6.0
Closes #6
2023-03-07 13:21:43 -05:00
Josh Holmer
ed9703b739 Fix an issue where compilation may fail on some non-x64 platforms 2023-02-02 13:29:08 -05:00
Josh Holmer
fe89e158c0 Add serialize support for enums 2023-01-24 02:38:11 -05:00
Josh Holmer
42448a8d45 Remove another remnant of that deprecated feature set 2023-01-23 14:39:58 -05:00
Josh Holmer
cff28ba207 Fix things from renaming and clippy 2023-01-23 10:22:10 -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
022eaa28cf Fix clippy 2022-09-07 23:49:28 +02:00
Polochon-street
b6b2311fcf Bump to 5.1.1 2022-08-08 18:37:14 +02:00
Josh Holmer
a0d7fdb30f Fix get best stream 2022-02-20 18:15:08 -05:00
Polochon-street
22ad8b9598 Bump version to use ffmpeg 5 2022-02-11 17:58:42 +01:00
Polochon-street
1955c3ddeb
Merge pull request #76 from zmwangx/fix-linting
Fix linting errors
2021-10-02 23:30:31 +02:00
Polochon-street
f559e13afc Fix linting errors 2021-10-02 22:51:32 +02:00
lifning
d5e9f34b6a fix build on platforms where std::os::raw::c_char is not i8
c_char may be i8 or u8, depending on target platform: https://doc.rust-lang.org/std/os/raw/type.c_char.html
2021-07-28 13:18:27 -07:00
Polochon-street
19ab5f67ad Fix linting errors 2021-07-07 16:52:30 +02:00
Zero
9c7ecb9b53 Initial ffmpeg 4.4 support 2021-05-06 17:08:45 -04: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
Zhiming Wang
b0722df007
Fix clippy::match_like_matches_macro 2020-10-11 10:10:08 +08:00
Zhiming Wang
6f0a14ee8b
codec: fix codec description potential null ptr issue
Codecs may not have .long_name initialized.

Issue raised by Pilyushkin in #34.
2020-10-04 11:37:59 +08:00
Maor Kleinberger
6a7a69e1e7
util::error: drop reserved errnos that are not available on Windows
Signed-off-by: Zhiming Wang <i@zhimingwang.org>
2020-08-12 10:30:11 +08:00
Zhiming Wang
545180cad0
format: context::{input,output}::dump: fix url/path printing
Previously the unwrapped CString did not have long enough lifetime to be
printed; not sure why there's no compiler warning.
2020-08-11 00:30:58 +08:00
Zhiming Wang
48b5751752
lib: export util::log 2020-08-10 21:57:55 +08:00
Zhiming Wang
d07530267e
format: mark Context::nb_streams as public 2020-08-09 13:58:48 +08:00
Zhiming Wang
1849a07aa6
lib: export util::error 2020-08-09 13:58:24 +08:00
Zhiming Wang
c9d223e8fe
util::error: correct comment regarding errno reexports 2020-08-09 13:57:43 +08:00
Zhiming Wang
81e142c6b7
util: introduce new Error variant Error:Other { errno }
Do not hide all the POSIX error codes behind a useless Error::Unknown.

Fixes #24.
2020-08-08 23:16:09 +08:00
Zhiming Wang
5affb85148
codec: fix signature of Packet::write_interleaved
av_interleaved_write_frame never returns 1, so bool makes no sense:
https://github.com/FFmpeg/FFmpeg/blob/n4.3.1/libavformat/avformat.h#L2592-L2635

Fixes #25.
2020-08-08 22:48:01 +08:00
Zhiming Wang
6f44fb79fd
codec: deprecate encoder's encode/flush and decoder's decode 2020-08-08 01:16:44 +08:00
Zhiming Wang
07fe207ac2
codec: implement DerefMut for encoder::Audio and encoder::Subtitle 2020-08-08 00:38:09 +08:00
Zhiming Wang
363001febe
codec: expose modern send/receive packet/frame APIs
avcodec_encode_video2()/avcodec_decode_video2/avcodec_encode_audio2()/avcodec_decode_audio4()
have been deprecated since FFmpeg 3.1, with modern
avcodec_send_packet()/avcodec_receive_frame()/avcodec_send_frame()/avcodec_receive_packet()
as replacements.

This commit adds send_packet(), send_eof() and receive_frame() to
decoder::Opened; send_frame(), send_eof() and receive_packet() to
encoder::Encoder to expose these modern APIs.
2020-08-08 00:37:54 +08:00
Kornel Lesiński
516f8069f6
Packet setters 2020-08-07 22:43:53 +08:00
Kornel Lesiński
50e1ccaca4
Don't panic on OOM 2020-08-07 22:43:53 +08:00
Kornel Lesiński
f0903fb69b
Allow null codec 2020-08-07 22:43:52 +08:00
Kornel Lesiński
f73dca70b4
Debug for Context 2020-08-07 22:43:52 +08:00
Kornel Lesiński
aa8df7d0d2
DRY nb_streams 2020-08-07 22:42:17 +08:00
Kornel Lesiński
53570d13d7
Add Debug for dictionary 2020-08-07 22:42:17 +08:00
Vasily Chekalkin
b31b5507fb
Add Send trait to resampling::Context 2020-08-07 22:31:11 +08:00
Zhiming Wang
f1ccd4e696
filter::Source: add close method
Expose av_buffersrc_close.
2020-08-03 18:49:14 +08:00
Zhiming Wang
d3270133be
Add log::util module 2020-08-03 18:46:49 +08:00