crosvm/libvda
Alexandre Courbot 9bb22153ae libvda: ignore pkg_config errors if chromeos feature is not set
pkg_config has introduced a new error type, Error::ProbeFailure, with
version 0.3.23 and returns this new error for the pattern we were trying
to match using Error::Failure. This causes the build script to fail if
the host is using version 0.3.23 or later.

Chrome OS is still using an older version, but trying to build with
cargo is likely to pull a newer one. The pkg_config crate explicitly
advises against matching these errors anyway, so change the strategy by
ignoring the errors if the chromeos feature is not set. That way we
still get clippy coverage while making sure a missing libvda package is
caught during builds that actually use it (libvda is not used outside of
Chrome OS).

BUG=None
TEST=cargo build --features "video-decoder,libvda"
TEST=emerge-zork-arc-r chromeos-base/crosvm

Change-Id: Ib2aad9f41541d3f4fe3cfb89f8b0f857d8033dcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3347307
Reviewed-by: Chirantan Ekbote <chirantan@chromium.org>
Tested-by: kokoro <noreply+kokoro@google.com>
Commit-Queue: Alexandre Courbot <acourbot@chromium.org>
2021-12-22 05:47:05 +00:00
..
src virtio: video: Add support for libvda-vd decoder backend. 2021-12-20 08:24:20 +00:00
tests virtio: video: Add support for configuring the bitrate mode to encoder. 2021-07-29 03:52:27 +00:00
build.rs libvda: ignore pkg_config errors if chromeos feature is not set 2021-12-22 05:47:05 +00:00
Cargo.toml enumn: switch to upstream crates.io version 2021-11-15 21:03:25 +00:00
README.md Crosvm Externalization: Move libvda rust code into crosvm 2021-07-08 05:32:04 +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.