Skip to main content

dynlink_nvidia_encode/
lib.rs

1// Copyright (C) The Strand-Braid Authors
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! dynamic linking of Nvidia Encode
5
6// regenerate ffi.rs with:
7//     cd gen-nvenc-bindings
8//     cargo run > ../src/ffi.rs
9
10pub mod api;
11pub mod error;
12#[expect(clippy::all)]
13mod ffi;
14pub mod guids;
15pub mod load;
16mod queue;
17
18pub use api::LibNvEncode;
19pub use error::NvencError;
20pub use guids::*;
21pub use queue::Queue;
22
23type NvInt = u32;
24
25#[cfg(test)]
26mod tests {
27    use crate::*;
28
29    #[ignore = "requires nv encode shared library to be present at runtime"]
30    #[test]
31    fn test_version() {
32        let shlib = load::load().expect("load");
33        let lib_nv_encode = api::init(&shlib).expect("nvidia-encode init");
34        let _functions =
35            LibNvEncode::api_create_instance(lib_nv_encode).expect("api create instance");
36    }
37}