1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//! dynamic linking of Nvidia Encode

// regenerate ffi.rs with:
//     cd gen-nvenc-bindings
//     cargo run > ../src/ffi.rs

#![cfg_attr(feature = "backtrace", feature(error_generic_member_access))]

pub mod api;
mod error;
#[allow(clippy::all)]
mod ffi;
pub mod guids;
pub mod load;
mod queue;

pub use api::LibNvEncode;
pub use error::NvencError;
pub use guids::*;
pub use queue::Queue;

type NvInt = u32;

#[cfg(test)]
mod tests {
    use crate::*;

    #[test]
    fn test_version() {
        let shlib = load::load().expect("load");
        let lib_nv_encode = api::init(&shlib).expect("nvidia-encode init");
        let _functions =
            LibNvEncode::api_create_instance(lib_nv_encode).expect("api create instance");
    }
}