806 Commits

Author SHA1 Message Date
tilpner eba4efef0c fix: use explicit types for lifetime transmutation
This fixes an accidental transmute (found by @projectgus) from an &Input to a &Context,
which was only working accidentally by type layout coincidence.

Co-Authored-By: Angus Gratton <gus@projectgus.com>
2023-09-04 14:15:38 +02:00
Kornel 10545c00d4 Merge pull request #175 from tilpner/timebase-optionality
Timebase optionality
2023-08-29 18:26:37 +01:00
tilpner 49db1407b6 fix(examples): adjust for time_base changes 2023-08-29 16:09:37 +02:00
tilpner 825e0d4484 feat(codec/packet, util/frame): expose time_base fields 2023-08-29 16:09:37 +02:00
tilpner 3d6efeba5e fix(codec, format)!: detect unset time_bases, allow unsetting time_base
Instead of silently passing possibly unset `time_base`s back into ffmpeg,
force users to explicitly handle (even if just by early panic) their absence.

BREAKING CHANGE: `time_base` and `set_time_base` functions now
return/accept Option<Rational> (±Into). `unwrap`/`expect` is a valid way
to surface this unwanted state early in user code.

For symmetry, `set_time_base` also allows unsetting by passing a `None`,
so all existing calls (with non-zero timebases) need to wrap the
argument in `Some`.
2023-08-29 16:09:37 +02:00
tilpner df08039eeb refactor: use Rational::non_zero instead of manual comparisons 2023-08-29 16:09:33 +02:00
tilpner 23dde387b7 feat(util/rational): add Rational::non_zero for guarding against zero-valued Rationals 2023-08-29 15:53:09 +02:00
tilpner 56c3dd0f4a build: use local ffmpeg-sys crate 2023-05-24 21:49:22 +02:00
tilpner fefe6753e9 chore(sys): remove obsolete/broken nix/travis/git configuration 2023-05-24 21:49:22 +02:00
tilpner 5409593c3e Update for ffmpeg 6.0 2023-05-24 21:49:22 +02:00
pkubaj 9b03a362c3 Fix build on big-endian architectures
error[E0428]: the name `AV_PIX_FMT_YUV420P9` is defined multiple times
   --> /wrkdirs/usr/ports/multimedia/av1an/work/Av1an-0.2.0/cargo-crates/ffmpeg-sys-next-4.4.0/src/avutil/pixfmt.rs:155:1
    |
38  | pub const AV_PIX_FMT_YUV420P9: AVPixelFormat = AV_PIX_FMT_YUV420P9LE;
    | --------------------------------------------------------------------- previous definition of the value `AV_PIX_FMT_YUV420P9` here
...
155 | pub const AV_PIX_FMT_YUV420P9: AVPixelFormat = AV_PIX_FMT_YUV420P9BE;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `AV_PIX_FMT_YUV420P9` redefined here
    |
    = note: `AV_PIX_FMT_YUV420P9` must be defined only once in the value namespace of this module
2023-05-24 21:49:22 +02:00
chrox 0b7cf67577 Fix cross-compilation for Windows on Linux 2023-05-24 21:49:22 +02:00
Kornel 85a2f075d7 Bump bindgen 2023-05-24 21:49:22 +02:00
Kornel ce942c17d6 Set --target flag for Apple's clang when cross-compiling 2023-05-24 21:49:22 +02:00
Kornel 52edfd6010 Explicitly enable cross-compilation in ./configure 2023-05-24 21:49:22 +02:00
Kornel 9a877ab7e6 Use the os from the target triple, rather than Rust's nickname 2023-05-24 21:49:22 +02:00
Kornel cb893a04b9 Check for actual target OS 2023-05-24 21:49:22 +02:00
Kornel 530201f895 Fix unwrap on compiler names without - 2023-05-24 21:49:22 +02:00
meh aadcf3ba62 chore: bump version 2023-05-24 21:49:22 +02:00
meh 175a4bada4 feat: add optional serde support 2023-05-24 21:49:22 +02:00
Vivien Venuti ad4f638ad5 Fix type issue for compilation targeting windows 2023-05-24 21:49:22 +02:00
Kornel d12f0d1fb2 Travis picks ancient xcode for some reason 2023-05-24 21:49:22 +02:00
Kornel 1cf6267991 Fix use statements 2023-05-24 21:49:22 +02:00
Kornel 2da2612b27 Clippy lints 2023-05-24 21:49:22 +02:00
Christopher Brown fc89057e98 fix framework linking on macos 2023-05-24 21:49:22 +02:00