Raw FFI bindings to libyuv libraries.
This crate is meant to be used as a git submodule so you should add the following to your Cargo.toml:
libyuv = { path = "PATH_TO/libyuv-rs/" }
The original project automatically
downloads precompiled static libraries from the github repository. However, in
this project we include the static libraries in the binaries
folder.
The libyuv crate will automatically find the precompiled static library files in
the submodule (inside the binaries
folder), otherwise you can also specify the
path where you have your binaries:
YUV_LIBRARY_PATH
- libyuv static library path.
To build the static library first you need depot_tools
:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=/PATH/To/depot_tools:$PATH
Then, clone the libyuv
repo:
mkdir libyuv
cd libyuv
gclient config --name src https://chromium.googlesource.com/libyuv/libyuv
gclient sync
The following sections show you how to build the static library libyuv.a
. Once
that is built copy it to the binaries
folder with the proper name:
libyuv-{OS}-{ARCH}.a
.
The following assumes the host machine is x86_64
:
make V=1 -f linux.mk
To cross-compile to aarch64
you first need to install the
cross-compiler. Assuming you are in Debian (or Ubuntu):
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
Then, you can run:
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ make V=1 -f linux.mk
The following assumes the host machine is aarch64
(e.g. Apple M1):
make V=1 -f linux.mk
To cross-compile to x86_64
:
CC="clang -arch x86_64" CXX="clang++ -arch x86_64" make V=1 -f linux.mk
This is a fork of https://github.com/mycrl/libyuv-rs
MIT Copyright (c) 2022 Mr.Panda.