#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#[repr(C)]
pub struct OH_NativeBuffer {
_unused: [u8; 0],
}
impl OH_NativeBuffer_Usage {
pub const NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(1);
}
impl OH_NativeBuffer_Usage {
pub const NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(2);
}
impl OH_NativeBuffer_Usage {
pub const NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = OH_NativeBuffer_Usage(8);
}
impl ::core::ops::BitOr<OH_NativeBuffer_Usage> for OH_NativeBuffer_Usage {
type Output = Self;
#[inline]
fn bitor(self, other: Self) -> Self {
OH_NativeBuffer_Usage(self.0 | other.0)
}
}
impl ::core::ops::BitOrAssign for OH_NativeBuffer_Usage {
#[inline]
fn bitor_assign(&mut self, rhs: OH_NativeBuffer_Usage) {
self.0 |= rhs.0;
}
}
impl ::core::ops::BitAnd<OH_NativeBuffer_Usage> for OH_NativeBuffer_Usage {
type Output = Self;
#[inline]
fn bitand(self, other: Self) -> Self {
OH_NativeBuffer_Usage(self.0 & other.0)
}
}
impl ::core::ops::BitAndAssign for OH_NativeBuffer_Usage {
#[inline]
fn bitand_assign(&mut self, rhs: OH_NativeBuffer_Usage) {
self.0 &= rhs.0;
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct OH_NativeBuffer_Usage(pub ::core::ffi::c_uint);
pub mod OH_NativeBuffer_Format {
pub type Type = ::core::ffi::c_uint;
pub const NATIVEBUFFER_PIXEL_FMT_RGB_565: Type = 3;
pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5658: Type = 4;
pub const NATIVEBUFFER_PIXEL_FMT_RGBX_4444: Type = 5;
pub const NATIVEBUFFER_PIXEL_FMT_RGBA_4444: Type = 6;
pub const NATIVEBUFFER_PIXEL_FMT_RGB_444: Type = 7;
pub const NATIVEBUFFER_PIXEL_FMT_RGBX_5551: Type = 8;
pub const NATIVEBUFFER_PIXEL_FMT_RGBA_5551: Type = 9;
pub const NATIVEBUFFER_PIXEL_FMT_RGB_555: Type = 10;
pub const NATIVEBUFFER_PIXEL_FMT_RGBX_8888: Type = 11;
pub const NATIVEBUFFER_PIXEL_FMT_RGBA_8888: Type = 12;
pub const NATIVEBUFFER_PIXEL_FMT_RGB_888: Type = 13;
pub const NATIVEBUFFER_PIXEL_FMT_BGR_565: Type = 14;
pub const NATIVEBUFFER_PIXEL_FMT_BGRX_4444: Type = 15;
pub const NATIVEBUFFER_PIXEL_FMT_BGRA_4444: Type = 16;
pub const NATIVEBUFFER_PIXEL_FMT_BGRX_5551: Type = 17;
pub const NATIVEBUFFER_PIXEL_FMT_BGRA_5551: Type = 18;
pub const NATIVEBUFFER_PIXEL_FMT_BGRX_8888: Type = 19;
pub const NATIVEBUFFER_PIXEL_FMT_BGRA_8888: Type = 20;
pub const NATIVEBUFFER_PIXEL_FMT_BUTT: Type = 2147483647;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OH_NativeBuffer_Config {
pub width: i32,
pub height: i32,
pub format: i32,
pub usage: i32,
pub stride: i32,
}
extern "C" {
pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer;
}
extern "C" {
pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32;
}
extern "C" {
pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32;
}
extern "C" {
pub fn OH_NativeBuffer_GetConfig(
buffer: *mut OH_NativeBuffer,
config: *mut OH_NativeBuffer_Config,
);
}
extern "C" {
pub fn OH_NativeBuffer_Map(
buffer: *mut OH_NativeBuffer,
virAddr: *mut *mut ::core::ffi::c_void,
) -> i32;
}
extern "C" {
pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32;
}
extern "C" {
pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32;
}