xref: /aosp_15_r20/external/crosvm/media/libvda/README.md (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1# Libvda Rust wrapper
2
3Note: This crate is specific to ChromeOS and requires the native
4[libvda](https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/platform2/arc/vm/libvda)
5library at link time.
6
7Rust wrapper for libvda. This library is used to enable communication with Chrome's GPU process to
8perform hardware accelerated decoding and encoding. It is currently in development to be used by
9crosvm's virtio-video device.
10
11### Building for the host environment
12
13You can also execute `cargo` directly for faster build and tests. This would be useful when you are
14developing this crate. Since this crate depends on libvda.so, you need to install it to host
15environment first.
16
17```shell
18(chroot)$ sudo emerge chromeos-base/libvda        # Install libvda.so to host.
19# Build
20(chroot)$ cargo build
21# Unit tests
22(chroot)$ cargo test
23```
24
25## Updating generated bindings
26
27`src/bindings.rs` is automatically generated from `libvda_common.h`. `src/decode/bindings.rs` is
28automatically generated from `libvda_decode.h`. `src/encode/bindings.rs` is automatically generated
29from `libvda_encode.h`.
30
31See the header of the bindings file for the generation command.
32