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