Only trigger ci-unix-static on push to main or PR

This avoids duplicate workflow entries in a Pull Request.
The alternative would be to trigger only on push of any branch,
because these are also displayed in Pull Requests, but maybe only if
they are part of the same repository.
1 file changed
tree: 97bb818ec43b8bdfc633c1ad2bc413fdcfa8d2cd
  1. .github/
  2. c_api_tests/
  3. examples/
  4. include/
  5. src/
  6. sys/
  7. tests/
  8. third_party/
  9. .gitignore
  10. .rustfmt.toml
  11. build.rs
  12. cargo-config.toml
  13. Cargo.toml
  14. cbindgen.toml
  15. compare.sh
  16. gen_test_case.sh
  17. README.md
  18. todos.txt
README.md

Crabby Avif 🦀

Avif parser/decoder implementation in Rust.

Features

  • Supports dav1d, libgav1 or android mediacodec as the underlying AV1 decoder.
  • C API compatible with libavif
  • ..and more

Build

git clone https://github.com/webmproject/CrabbyAvif.git
# If dav1d system library can be found with pkg-config, this step can be skipped.
cd CrabbyAvif/sys/dav1d-sys
./dav1d.cmd
# If libyuv system library can be found with pkg-config, this step can be skipped.
cd ../libyuv-sys
./libyuv.cmd
cd ../..
cargo build

Tests

cargo test -- --skip test_conformance

Conformance Tests

git clone https://github.com/AOMediaCodec/av1-avif.git third_party/av1-avif
git clone https://github.com/AOMediaCodec/libavif.git third_party/libavif
cd third_party/libavif/ext
./dav1d.cmd
cd ../../..
cmake -S third_party/libavif -B third_party/libavif/build -DAVIF_CODEC_DAV1D=LOCAL -DAVIF_BUILD_APPS=ON
cmake --build third_party/libavif/build --parallel -t avifdec
cargo test -- test_conformance

C API Tests

# Build google test
cd third_party
./googletest.cmd
cd ..
# Build the library with C API enabled
cargo build --features capi --release
# Build and run the C/C++ Tests
mkdir c_build
cd c_build
cmake ../c_api_tests/
make
make test

Android Tests

The decoder tests can be run on Android using dinghy.

# One time set up
cargo install cargo-dinghy
# Set path to NDK
export ANDROID_NDK_HOME=<path_to_ndk>
# Install rust toolchain for target
rustup target add aarch64-linux-android
# End of One time set up
# Make sure the device/emulator is available via adb.
cargo dinghy -d android test --no-default-features --features android_mediacodec,libyuv --target aarch64-linux-android --test decoder_tests