rkrga_sys/
lib.rs

1//! RKRGA 应用接口 FFI 绑定。
2//!
3//! 当前基于 Rockchip RGA v1.2.x 应用接口接口实现。
4//!
5#![allow(deref_nullptr)]
6#![allow(non_upper_case_globals)]
7#![allow(non_camel_case_types)]
8#![allow(non_snake_case)]
9#![allow(unaligned_references)]
10
11#[cfg(feature = "use-bindgen")]
12include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
13#[cfg(not(feature = "use-bindgen"))]
14include!("bindings.rs");
15
16#[cfg(test)]
17mod tests {
18    use super::*;
19
20    #[test]
21    fn test_init_deinit() {
22        unsafe {
23            assert_eq!(c_RkRgaInit(), 0);
24            c_RkRgaDeInit();
25        }
26    }
27
28    #[test]
29    fn test_blit() {
30        use std::ptr::{null, null_mut};
31
32        unsafe {
33            assert_ne!(0, c_RkRgaBlit(null_mut(), null_mut(), null_mut()));
34        }
35    }
36}