crosvm/media/libvda
Dennis Kempin a2ecd1eb50 Modify builds via CROSVM_BUILD_VARIANT env var
We currently use cargo features to modify the build process, which
makes them non-additive and prevents us from moving towards
using --all-features in the future.

To change build.rs behavior to integrate with downstream build
systems (e.g. use pkg_config only on chromeos) we will use the newly
added CROSVM_BUILD_VARIANT env variable. Currently only
used by ChromeOS, but not limited to it.

For now, CROSVM_BUILD_VARIANT=chromeos will prevent the
embedding of seccomp policies.

BUG=b:244618505
TEST=Test in combination with https://crrev.com/c/3923813

Change-Id: I2bfe999b5252740d57c73c4a85d73bd343c8259e
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3926325
Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
2022-10-04 21:23:00 +00:00
..
src Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
tests Update all copyright headers to match new style 2022-09-13 18:41:29 +00:00
bindgen.sh health-check: enforce blank line after copyright 2022-09-13 22:24:35 +00:00
build.rs Modify builds via CROSVM_BUILD_VARIANT env var 2022-10-04 21:23:00 +00:00
Cargo.toml Move libvda to media/libvda 2022-04-06 01:19:07 +00:00
README.md Move libvda to media/libvda 2022-04-06 01:19:07 +00:00

Libvda Rust wrapper

Note: This crate is specific to ChromeOS and requires the native (libvda)[https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform2/arc/vm/libvda] library at link time.

Rust wrapper for libvda. This library is used to enable communication with Chrome's GPU process to perform hardware accelerated decoding and encoding. It is currently in development to be used by crosvm's virtio-video device.

Building for the host environment

You can also execute cargo directly for faster build and tests. This would be useful when you are developing this crate. Since this crate depends on libvda.so, you need to install it to host environment first.

(chroot)$ sudo emerge chromeos-base/libvda        # Install libvda.so to host.
# Build
(chroot)$ cargo build
# Unit tests
(chroot)$ cargo test

Updating generated bindings

src/bindings.rs is automatically generated from libvda_common.h. src/decode/bindings.rs is automatically generated from libvda_decode.h. src/encode/bindings.rs is automatically generated from libvda_encode.h.

See the header of the bindings file for the generation command.