Skip to main content

ohos_native_buffer_sys/
lib.rs

1/* automatically generated by rust-bindgen 0.65.1 */
2
3#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6#![allow(clippy::missing_safety_doc)]
7
8#[link(name = "native_buffer")]
9unsafe extern "C" {}
10
11#[repr(C)]
12#[derive(Default)]
13pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
14impl<T> __IncompleteArrayField<T> {
15    #[inline]
16    pub const fn new() -> Self {
17        __IncompleteArrayField(::std::marker::PhantomData, [])
18    }
19    #[inline]
20    pub fn as_ptr(&self) -> *const T {
21        self as *const _ as *const T
22    }
23    #[inline]
24    pub fn as_mut_ptr(&mut self) -> *mut T {
25        self as *mut _ as *mut T
26    }
27    #[inline]
28    pub unsafe fn as_slice(&self, len: usize) -> &[T] {
29        ::std::slice::from_raw_parts(self.as_ptr(), len)
30    }
31    #[inline]
32    pub unsafe fn as_mut_slice(&mut self, len: usize) -> &mut [T] {
33        ::std::slice::from_raw_parts_mut(self.as_mut_ptr(), len)
34    }
35}
36impl<T> ::std::fmt::Debug for __IncompleteArrayField<T> {
37    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
38        fmt.write_str("__IncompleteArrayField")
39    }
40}
41#[doc = " None color space"]
42pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_NONE: OH_NativeBuffer_ColorSpace = 0;
43#[doc = " COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_FULL << 21)"]
44pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT601_EBU_FULL: OH_NativeBuffer_ColorSpace = 1;
45#[doc = " COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21)"]
46pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT601_SMPTE_C_FULL: OH_NativeBuffer_ColorSpace =
47    2;
48#[doc = " COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_FULL << 21)"]
49pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT709_FULL: OH_NativeBuffer_ColorSpace = 3;
50#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21)"]
51pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_HLG_FULL: OH_NativeBuffer_ColorSpace = 4;
52#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21)"]
53pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_PQ_FULL: OH_NativeBuffer_ColorSpace = 5;
54#[doc = " COLORPRIMARIES_BT601_P | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_P << 16) | (RANGE_LIMITED << 21)"]
55pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT601_EBU_LIMIT: OH_NativeBuffer_ColorSpace = 6;
56#[doc = " COLORPRIMARIES_BT601_N | (TRANSFUNC_BT709 << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21)"]
57pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT601_SMPTE_C_LIMIT: OH_NativeBuffer_ColorSpace =
58    7;
59#[doc = " COLORPRIMARIES_BT709 | (TRANSFUNC_BT709 << 8) | (MATRIX_BT709 << 16) | (RANGE_LIMITED << 21)"]
60pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT709_LIMIT: OH_NativeBuffer_ColorSpace = 8;
61#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_HLG << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21)"]
62pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_HLG_LIMIT: OH_NativeBuffer_ColorSpace = 9;
63#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_PQ << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21)"]
64pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_PQ_LIMIT: OH_NativeBuffer_ColorSpace = 10;
65#[doc = " COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_FULL << 21)"]
66pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_SRGB_FULL: OH_NativeBuffer_ColorSpace = 11;
67#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21)"]
68pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_FULL: OH_NativeBuffer_ColorSpace = 12;
69#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21)"]
70pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_HLG_FULL: OH_NativeBuffer_ColorSpace = 13;
71#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_FULL << 21)"]
72pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_PQ_FULL: OH_NativeBuffer_ColorSpace = 14;
73#[doc = " COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_FULL << 21)"]
74pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_ADOBERGB_FULL: OH_NativeBuffer_ColorSpace = 15;
75#[doc = " COLORPRIMARIES_SRGB | (TRANSFUNC_SRGB << 8) | (MATRIX_BT601_N << 16) | (RANGE_LIMITED << 21)"]
76pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_SRGB_LIMIT: OH_NativeBuffer_ColorSpace = 16;
77#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_SRGB << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21)"]
78pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_LIMIT: OH_NativeBuffer_ColorSpace = 17;
79#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_HLG << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21)"]
80pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_HLG_LIMIT: OH_NativeBuffer_ColorSpace = 18;
81#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_PQ << 8) | (MATRIX_P3 << 16) | (RANGE_LIMITED << 21)"]
82pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_P3_PQ_LIMIT: OH_NativeBuffer_ColorSpace = 19;
83#[doc = " COLORPRIMARIES_ADOBERGB | (TRANSFUNC_ADOBERGB << 8) | (MATRIX_ADOBERGB << 16) | (RANGE_LIMITED << 21)"]
84pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_ADOBERGB_LIMIT: OH_NativeBuffer_ColorSpace = 20;
85#[doc = " COLORPRIMARIES_SRGB | (TRANSFUNC_LINEAR << 8)"]
86pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_LINEAR_SRGB: OH_NativeBuffer_ColorSpace = 21;
87#[doc = " equal to OH_COLORSPACE_LINEAR_SRGB"]
88pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_LINEAR_BT709: OH_NativeBuffer_ColorSpace = 22;
89#[doc = " COLORPRIMARIES_P3_D65 | (TRANSFUNC_LINEAR << 8)"]
90pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_LINEAR_P3: OH_NativeBuffer_ColorSpace = 23;
91#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_LINEAR << 8)"]
92pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_LINEAR_BT2020: OH_NativeBuffer_ColorSpace = 24;
93#[doc = " equal to OH_COLORSPACE_SRGB_FULL"]
94pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_SRGB: OH_NativeBuffer_ColorSpace = 25;
95#[doc = " equal to OH_COLORSPACE_P3_FULL"]
96pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_P3_SRGB: OH_NativeBuffer_ColorSpace = 26;
97#[doc = " equal to OH_COLORSPACE_P3_HLG_FULL"]
98pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_P3_HLG: OH_NativeBuffer_ColorSpace = 27;
99#[doc = " equal to OH_COLORSPACE_P3_PQ_FULL"]
100pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_P3_PQ: OH_NativeBuffer_ColorSpace = 28;
101#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_SRGB << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21)"]
102pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_BT2020_SRGB: OH_NativeBuffer_ColorSpace =
103    29;
104#[doc = " equal to OH_COLORSPACE_BT2020_HLG_FULL"]
105pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_BT2020_HLG: OH_NativeBuffer_ColorSpace =
106    30;
107#[doc = " equal to OH_COLORSPACE_BT2020_PQ_FULL"]
108pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_DISPLAY_BT2020_PQ: OH_NativeBuffer_ColorSpace =
109    31;
110#[doc = " @brief Indicates the color space of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 11\n @version 1.0\n/\n/**\n @brief Indicates the color space of a native buffer.\n Move from native_buffer.h to native_common.h\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
111pub type OH_NativeBuffer_ColorSpace = u32;
112#[doc = " HLG"]
113pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_HLG: OH_NativeBuffer_MetadataType = 0;
114#[doc = " HDR10"]
115pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_HDR10: OH_NativeBuffer_MetadataType = 1;
116#[doc = " HDR VIVID"]
117pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_VIVID: OH_NativeBuffer_MetadataType = 2;
118#[doc = " HDR IMAGE DUAL.\n @since 22"]
119#[cfg(feature = "api-22")]
120pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_VIVID_DUAL: OH_NativeBuffer_MetadataType = 3;
121#[doc = " HDR IMAGE SINGLE.\n @since 22"]
122#[cfg(feature = "api-22")]
123pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_VIVID_SINGLE: OH_NativeBuffer_MetadataType = 4;
124#[doc = " HDR IMAGE ISO DUAL.\n @since 23"]
125#[cfg(feature = "api-23")]
126pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_ISO_DUAL: OH_NativeBuffer_MetadataType = 5;
127#[doc = " HDR IMAGE ISO SINGLE.\n @since 23"]
128#[cfg(feature = "api-23")]
129pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_ISO_SINGLE: OH_NativeBuffer_MetadataType = 6;
130#[doc = " NONE Metadata\n @since 13"]
131#[cfg(feature = "api-13")]
132pub const OH_NativeBuffer_MetadataType_OH_VIDEO_NONE: OH_NativeBuffer_MetadataType = -1;
133#[doc = " @brief Indicates the HDR metadata type of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
134pub type OH_NativeBuffer_MetadataType = i32;
135#[doc = " @brief Indicates the color x and y.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
136#[repr(C)]
137#[derive(Debug, Copy, Clone)]
138pub struct OH_NativeBuffer_ColorXY {
139    #[doc = " color X"]
140    pub x: f32,
141    #[doc = " color Y"]
142    pub y: f32,
143}
144#[doc = " @brief Indicates the smpte2086 metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
145#[repr(C)]
146#[derive(Debug, Copy, Clone)]
147pub struct OH_NativeBuffer_Smpte2086 {
148    #[doc = " primary red"]
149    pub displayPrimaryRed: OH_NativeBuffer_ColorXY,
150    #[doc = " primary green"]
151    pub displayPrimaryGreen: OH_NativeBuffer_ColorXY,
152    #[doc = " primary blue"]
153    pub displayPrimaryBlue: OH_NativeBuffer_ColorXY,
154    #[doc = " white point"]
155    pub whitePoint: OH_NativeBuffer_ColorXY,
156    #[doc = " max luminance"]
157    pub maxLuminance: f32,
158    #[doc = " min luminance"]
159    pub minLuminance: f32,
160}
161#[doc = " @brief Indicates the cta861.3 metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
162#[repr(C)]
163#[derive(Debug, Copy, Clone)]
164pub struct OH_NativeBuffer_Cta861 {
165    #[doc = " max content lightLevel"]
166    pub maxContentLightLevel: f32,
167    #[doc = " max frame average light level"]
168    pub maxFrameAverageLightLevel: f32,
169}
170#[doc = " @brief Indicates the HDR static metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
171#[repr(C)]
172#[derive(Debug, Copy, Clone)]
173pub struct OH_NativeBuffer_StaticMetadata {
174    #[doc = " smpte 2086 metadata"]
175    pub smpte2086: OH_NativeBuffer_Smpte2086,
176    #[doc = " CTA-861.3 metadata"]
177    pub cta861: OH_NativeBuffer_Cta861,
178}
179#[doc = " value: OH_NativeBuffer_MetadataType"]
180pub const OH_NativeBuffer_MetadataKey_OH_HDR_METADATA_TYPE: OH_NativeBuffer_MetadataKey = 0;
181#[doc = " value: OH_NativeBuffer_StaticMetadata"]
182pub const OH_NativeBuffer_MetadataKey_OH_HDR_STATIC_METADATA: OH_NativeBuffer_MetadataKey = 1;
183#[doc = " byte stream of SEI in video stream"]
184pub const OH_NativeBuffer_MetadataKey_OH_HDR_DYNAMIC_METADATA: OH_NativeBuffer_MetadataKey = 2;
185#[doc = " Region of interest(ROI) metadata is used to conifgure ROI feature in video encoding. Value type is string\n in the format \"Top1,Left1-Bottom1,Right1=QpOffset1;Top2,Left2-Bottom2,Right2=QpOffset2;\".\n Each \"Top,Left-Bottom,Right=QpOffset\" represents the coordinate information and quantization parameter\n offset of one ROI. Each \"=QpOffset\" in the string can be omitted,\n like \"Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=QpOffset2;\", the encoder will use the default\n quantization parameter offset to perform the ROI encoding on the first ROI and use QpOffset2 on the second ROI.\n Note that the number of ROIs that can be applied simultaneously does not exceed six, and the total area must\n not exceed one-fifth of the total image area.\n\n @since 22"]
186#[cfg(feature = "api-22")]
187pub const OH_NativeBuffer_MetadataKey_OH_REGION_OF_INTEREST_METADATA: OH_NativeBuffer_MetadataKey =
188    3;
189#[doc = " @brief Indicates the descriptive information of a native buffer,\n  such as HDR metadata, ROI metadata, etc.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
190pub type OH_NativeBuffer_MetadataKey = u32;
191#[doc = " CLUT8 format\n @since 12"]
192pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT8: OH_NativeBuffer_Format = 0;
193#[doc = " CLUT1 format\n @since 12"]
194pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT1: OH_NativeBuffer_Format = 1;
195#[doc = " CLUT4 format\n @since 12"]
196pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT4: OH_NativeBuffer_Format = 2;
197#[doc = " CLUT4 format\n @since 12"]
198pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = 3;
199#[doc = " < RGB565 format */"]
200pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = 4;
201#[doc = " < RGBA5658 format */"]
202pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = 5;
203#[doc = " < RGBX4444 format */"]
204pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = 6;
205#[doc = " < RGBA4444 format */"]
206pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = 7;
207#[doc = " < RGB444 format */"]
208pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = 8;
209#[doc = " < RGBX5551 format */"]
210pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = 9;
211#[doc = " < RGBA5551 format */"]
212pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = 10;
213#[doc = " < RGB555 format */"]
214pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = 11;
215#[doc = " < RGBX8888 format */"]
216pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = 12;
217#[doc = " < RGBA8888 format */"]
218pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = 13;
219#[doc = " < RGB888 format */"]
220pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = 14;
221#[doc = " < BGR565 format */"]
222pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = 15;
223#[doc = " < BGRX4444 format */"]
224pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = 16;
225#[doc = " < BGRA4444 format */"]
226pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = 17;
227#[doc = " < BGRX5551 format */"]
228pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = 18;
229#[doc = " < BGRA5551 format */"]
230pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = 19;
231#[doc = " < BGRX8888 format */"]
232pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = 20;
233#[doc = " < BGRA8888 format */\n**\n* YUV422 interleaved format\n* @since 12\n*/"]
234pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YUV_422_I: OH_NativeBuffer_Format = 21;
235#[doc = " YCBCR422 semi-plannar format\n @since 12"]
236pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SP: OH_NativeBuffer_Format = 22;
237#[doc = " YCRCB422 semi-plannar format\n @since 12"]
238pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SP: OH_NativeBuffer_Format = 23;
239#[doc = " YCBCR420 semi-plannar format\n @since 12"]
240pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP: OH_NativeBuffer_Format = 24;
241#[doc = " YCRCB420 semi-plannar format\n @since 12"]
242pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP: OH_NativeBuffer_Format = 25;
243#[doc = " YCBCR422 plannar format\n @since 12"]
244pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_422_P: OH_NativeBuffer_Format = 26;
245#[doc = " YCRCB422 plannar format\n @since 12"]
246pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_422_P: OH_NativeBuffer_Format = 27;
247#[doc = " YCBCR420 plannar format\n @since 12"]
248pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_420_P: OH_NativeBuffer_Format = 28;
249#[doc = " YCRCB420 plannar format\n @since 12"]
250pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_420_P: OH_NativeBuffer_Format = 29;
251#[doc = " YUYV422 packed format\n @since 12"]
252pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKG: OH_NativeBuffer_Format = 30;
253#[doc = " UYVY422 packed format\n @since 12"]
254pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKG: OH_NativeBuffer_Format = 31;
255#[doc = " YVYU422 packed format\n @since 12"]
256pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKG: OH_NativeBuffer_Format = 32;
257#[doc = " VYUY422 packed format\n @since 12"]
258pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKG: OH_NativeBuffer_Format = 33;
259#[doc = " RGBA_1010102 packed format\n @since 12"]
260pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_1010102: OH_NativeBuffer_Format = 34;
261#[doc = " YCBCR420 semi-planar 10bit packed format\n @since 12"]
262pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_P010: OH_NativeBuffer_Format = 35;
263#[doc = " YCRCB420 semi-planar 10bit packed format\n @since 12"]
264pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_P010: OH_NativeBuffer_Format = 36;
265#[doc = " Raw 10bit packed format\n @since 12"]
266pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RAW10: OH_NativeBuffer_Format = 37;
267#[doc = " BLOB format\n @since 15"]
268#[cfg(feature = "api-15")]
269pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BLOB: OH_NativeBuffer_Format = 38;
270#[doc = " RGBA16 float format\n @since 15"]
271#[cfg(feature = "api-15")]
272pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA16_FLOAT: OH_NativeBuffer_Format = 39;
273#[doc = " Y8 format\n @since 20"]
274#[cfg(feature = "api-20")]
275pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_Y8: OH_NativeBuffer_Format = 40;
276#[doc = " Y16 format\n @since 20"]
277#[cfg(feature = "api-20")]
278pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_Y16: OH_NativeBuffer_Format = 41;
279#[doc = " vender mask format\n @since 12"]
280pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_VENDER_MASK: OH_NativeBuffer_Format =
281    2147418112;
282#[doc = " vender mask format\n @since 12"]
283pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format = 2147483647;
284#[doc = " @brief Indicates the format of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 10\n @version 1.0"]
285pub type OH_NativeBuffer_Format = u32;
286#[doc = "< No rotation"]
287pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_NONE: OH_NativeBuffer_TransformType = 0;
288#[doc = "< Rotation by 90 degrees"]
289pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_90: OH_NativeBuffer_TransformType = 1;
290#[doc = "< Rotation by 180 degrees"]
291pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_180: OH_NativeBuffer_TransformType = 2;
292#[doc = "< Rotation by 270 degrees"]
293pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_270: OH_NativeBuffer_TransformType = 3;
294#[doc = "< Flip horizontally"]
295pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H: OH_NativeBuffer_TransformType = 4;
296#[doc = "< Flip vertically"]
297pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V: OH_NativeBuffer_TransformType = 5;
298#[doc = "< Flip horizontally and rotate 90 degrees"]
299pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT90: OH_NativeBuffer_TransformType =
300    6;
301#[doc = "< Flip vertically and rotate 90 degrees"]
302pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT90: OH_NativeBuffer_TransformType =
303    7;
304#[doc = "< Flip horizontally and rotate 180 degrees"]
305pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT180: OH_NativeBuffer_TransformType =
306    8;
307#[doc = "< Flip vertically and rotate 180 degrees"]
308pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT180: OH_NativeBuffer_TransformType =
309    9;
310#[doc = "< Flip horizontally and rotate 270 degrees"]
311pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT270: OH_NativeBuffer_TransformType =
312    10;
313#[doc = "< Flip vertically and rotate 270 degrees"]
314pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType =
315    11;
316#[doc = " @brief Indicates the transform type of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
317pub type OH_NativeBuffer_TransformType = u32;
318#[doc = " @brief Buffer handle used to transfer and obtain information about the buffer.\n @since 8"]
319#[repr(C)]
320#[derive(Debug)]
321pub struct BufferHandle {
322    #[doc = "< buffer fd, -1 if not supported"]
323    pub fd: i32,
324    #[doc = "< the width of memory"]
325    pub width: i32,
326    #[doc = "< the stride of memory"]
327    pub stride: i32,
328    #[doc = "< the height of memory"]
329    pub height: i32,
330    pub size: i32,
331    #[doc = "< the format of memory"]
332    pub format: i32,
333    #[doc = "< the usage of memory"]
334    pub usage: u64,
335    #[doc = "< Virtual address of memory"]
336    pub virAddr: *mut ::std::os::raw::c_void,
337    #[doc = "< Shared memory key"]
338    pub key: i32,
339    #[doc = "< Physical address"]
340    pub phyAddr: u64,
341    #[doc = "< the number of reserved fd value"]
342    pub reserveFds: u32,
343    #[doc = "< the number of reserved integer value"]
344    pub reserveInts: u32,
345    #[doc = "< the data"]
346    pub reserve: __IncompleteArrayField<i32>,
347}
348#[repr(C)]
349#[derive(Debug, Copy, Clone)]
350pub struct OH_NativeBuffer {
351    _unused: [u8; 0],
352}
353#[repr(C)]
354#[derive(Debug, Copy, Clone)]
355pub struct OHIPCParcel {
356    _unused: [u8; 0],
357}
358#[doc = " @brief native window buffer.\n @since 8"]
359#[repr(C)]
360#[derive(Debug, Copy, Clone)]
361pub struct NativeWindowBuffer {
362    _unused: [u8; 0],
363}
364#[doc = " @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer.\n @since 8"]
365pub type OHNativeWindowBuffer = NativeWindowBuffer;
366#[doc = " @brief indicates a dirty region where content is updated.\n @since 8"]
367#[repr(C)]
368#[derive(Debug, Copy, Clone)]
369pub struct Region {
370    pub rects: *mut Region_Rect,
371    #[doc = " if rectNumber is 0, fill the Buffer dirty size by default"]
372    pub rectNumber: i32,
373}
374#[doc = " if rects is nullptr, fill the Buffer dirty size by default"]
375#[repr(C)]
376#[derive(Debug, Copy, Clone)]
377pub struct Region_Rect {
378    pub x: i32,
379    pub y: i32,
380    pub w: u32,
381    pub h: u32,
382}
383#[doc = " the window content is not updated until a buffer of\n the window size is received"]
384pub const OHScalingMode_OH_SCALING_MODE_FREEZE: OHScalingMode = 0;
385#[doc = " the buffer is scaled in two dimensions to match the window size"]
386pub const OHScalingMode_OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = 1;
387#[doc = " the buffer is uniformly scaled so that the smaller size of\n the buffer matches the window size"]
388pub const OHScalingMode_OH_SCALING_MODE_SCALE_CROP: OHScalingMode = 2;
389#[doc = " the window is clipped to the size of the buffer's clipping rectangle\n pixels outside the clipping rectangle are considered fully transparent."]
390pub const OHScalingMode_OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = 3;
391#[doc = " @brief Indicates Scaling Mode.\n @since 9\n @deprecated since 10\n @useinstead OHScalingModeV2"]
392pub type OHScalingMode = u32;
393#[doc = " the window content is not updated until a buffer of\n the window size is received"]
394pub const OHScalingModeV2_OH_SCALING_MODE_FREEZE_V2: OHScalingModeV2 = 0;
395#[doc = " the buffer is scaled in two dimensions to match the window size"]
396pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_TO_WINDOW_V2: OHScalingModeV2 = 1;
397#[doc = " the buffer is uniformly scaled so that the smaller size of\n the buffer matches the window size"]
398pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_CROP_V2: OHScalingModeV2 = 2;
399#[doc = " the window is clipped to the size of the buffer's clipping rectangle\n pixels outside the clipping rectangle are considered fully transparent."]
400pub const OHScalingModeV2_OH_SCALING_MODE_NO_SCALE_CROP_V2: OHScalingModeV2 = 3;
401#[doc = " Adapt to the buffer and scale proportionally to the buffer size. Prioritize displaying all buffer content.\n If the size is not the same as the window size, fill the unfilled area of the window with a background color."]
402pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_FIT_V2: OHScalingModeV2 = 4;
403#[doc = " @brief Indicates Scaling Mode.\n @since 12"]
404pub type OHScalingModeV2 = u32;
405pub const OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = 0;
406pub const OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = 1;
407pub const OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = 2;
408pub const OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = 3;
409pub const OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = 4;
410pub const OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = 5;
411pub const OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = 6;
412pub const OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = 7;
413pub const OHHDRMetadataKey_OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = 8;
414pub const OHHDRMetadataKey_OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = 9;
415pub const OHHDRMetadataKey_OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = 10;
416pub const OHHDRMetadataKey_OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = 11;
417pub const OHHDRMetadataKey_OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = 12;
418pub const OHHDRMetadataKey_OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = 13;
419#[doc = " @brief Enumerates the HDR metadata keys.\n @since 9\n @deprecated since 10"]
420pub type OHHDRMetadataKey = u32;
421#[doc = " @brief Defines the HDR metadata.\n @since 9\n @deprecated since 10"]
422#[repr(C)]
423#[derive(Debug, Copy, Clone)]
424pub struct OHHDRMetaData {
425    pub key: OHHDRMetadataKey,
426    pub value: f32,
427}
428#[doc = " @brief Defines the ExtData Handle\n @since 9\n @deprecated since 10"]
429#[repr(C)]
430#[derive(Debug)]
431pub struct OHExtDataHandle {
432    pub fd: i32,
433    pub reserveInts: u32,
434    pub reserve: __IncompleteArrayField<i32>,
435}
436pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = 1;
437#[doc = " < CPU read buffer */"]
438pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = 2;
439#[doc = " < CPU write memory */"]
440pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = 8;
441#[doc = " < Direct memory access (DMA) buffer */\n**\n* MMZ with cache\n* @since 20\n*/"]
442#[cfg(feature = "api-20")]
443pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_MEM_MMZ_CACHE: OH_NativeBuffer_Usage = 32;
444#[doc = " @since 12"]
445pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_HW_RENDER: OH_NativeBuffer_Usage = 256;
446#[doc = " < For GPU write case */\n**\n* @since 12\n*/"]
447pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_HW_TEXTURE: OH_NativeBuffer_Usage = 512;
448#[doc = " < For GPU read case */\n**\n* @since 12\n*/"]
449pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_READ_OFTEN: OH_NativeBuffer_Usage = 65536;
450#[doc = " < Often be mapped for direct CPU reads */\n**\n* @since 12\n*/"]
451pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_ALIGNMENT_512: OH_NativeBuffer_Usage = 262144;
452#[doc = " @brief Indicates the usage of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 10\n @version 1.0"]
453pub type OH_NativeBuffer_Usage = u32;
454#[doc = "< Native or default"]
455pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_NATIVE: OH_NativeBuffer_ColorGamut =
456    0;
457#[doc = "< Standard BT601"]
458pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT601:
459    OH_NativeBuffer_ColorGamut = 1;
460#[doc = "< Standard BT709"]
461pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT709:
462    OH_NativeBuffer_ColorGamut = 2;
463#[doc = "< DCI P3"]
464pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DCI_P3: OH_NativeBuffer_ColorGamut =
465    3;
466#[doc = "< SRGB"]
467pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_SRGB: OH_NativeBuffer_ColorGamut = 4;
468#[doc = "< Adobe RGB"]
469pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_ADOBE_RGB:
470    OH_NativeBuffer_ColorGamut = 5;
471#[doc = "< Display P3"]
472pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DISPLAY_P3:
473    OH_NativeBuffer_ColorGamut = 6;
474#[doc = "< BT2020"]
475pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2020: OH_NativeBuffer_ColorGamut =
476    7;
477#[doc = "< BT2100 PQ"]
478pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2100_PQ:
479    OH_NativeBuffer_ColorGamut = 8;
480#[doc = "< BT2100 HLG"]
481pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2100_HLG:
482    OH_NativeBuffer_ColorGamut = 9;
483#[doc = "< Display BT2020"]
484pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020:
485    OH_NativeBuffer_ColorGamut = 10;
486#[doc = " @brief Indicates the color gamut of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
487pub type OH_NativeBuffer_ColorGamut = u32;
488#[doc = " @brief <b>OH_NativeBuffer</b> config. \\n\n Used to allocating new <b>OH_NativeBuffer</b> and query parameters if existing ones.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 9\n @version 1.0"]
489#[repr(C)]
490#[derive(Debug, Copy, Clone)]
491pub struct OH_NativeBuffer_Config {
492    #[doc = "< Width in pixels"]
493    pub width: i32,
494    #[doc = "< Height in pixels"]
495    pub height: i32,
496    #[doc = "< One of PixelFormat"]
497    pub format: i32,
498    #[doc = "< Combination of buffer usage"]
499    pub usage: i32,
500    #[doc = "< the stride of memory in bytes"]
501    pub stride: i32,
502}
503#[doc = " @brief Holds info for a single image plane. \\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
504#[repr(C)]
505#[derive(Debug, Copy, Clone)]
506pub struct OH_NativeBuffer_Plane {
507    #[doc = "< Offset in bytes of plane."]
508    pub offset: u64,
509    #[doc = "< Distance in bytes from the first value of one row of the image to the first value of the next row."]
510    pub rowStride: u32,
511    #[doc = "< Distance in bytes from the first value of one column of the image to the first value of the next column."]
512    pub columnStride: u32,
513}
514#[doc = " @brief Holds all image planes. \\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
515#[repr(C)]
516#[derive(Debug, Copy, Clone)]
517pub struct OH_NativeBuffer_Planes {
518    #[doc = "< Number of distinct planes."]
519    pub planeCount: u32,
520    #[doc = "< Array of image planes."]
521    pub planes: [OH_NativeBuffer_Plane; 4usize],
522}
523extern "C" {
524    #[doc = " @brief Alloc a <b>OH_NativeBuffer</b> that matches the passed BufferRequestConfig. \\n\n A new <b>OH_NativeBuffer</b> instance is created each time this function is called.\\n\n This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unreference</b>,\n otherwise memory leaks will occur.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param config Indicates the pointer to a <b>BufferRequestConfig</b> instance.\n @return Returns the pointer to the <b>OH_NativeBuffer</b> instance created if the operation is successful, \\n\n returns <b>NULL</b> otherwise.\n @since 9\n @version 1.0"]
525    pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer;
526}
527extern "C" {
528    #[doc = " @brief Adds the reference count of a OH_NativeBuffer.\\n\n This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unreference</b>,\n otherwise memory leaks will occur.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 9\n @version 1.0"]
529    pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32;
530}
531extern "C" {
532    #[doc = " @brief Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0,\n destroys this OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 9\n @version 1.0"]
533    pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32;
534}
535extern "C" {
536    #[doc = " @brief Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param config Indicates the pointer to the <b>NativeBufferConfig</b> of the buffer.\n @return <b>void</b>\n @since 9\n @version 1.0"]
537    pub fn OH_NativeBuffer_GetConfig(
538        buffer: *mut OH_NativeBuffer,
539        config: *mut OH_NativeBuffer_Config,
540    );
541}
542extern "C" {
543    #[doc = " @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space.\\n\n This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unmap</b>.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param virAddr Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 9\n @version 1.0"]
544    pub fn OH_NativeBuffer_Map(
545        buffer: *mut OH_NativeBuffer,
546        virAddr: *mut *mut ::std::os::raw::c_void,
547    ) -> i32;
548}
549extern "C" {
550    #[doc = " @brief Remove direct cpu access ability of the OH_NativeBuffer in the process's address space.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 9\n @version 1.0"]
551    pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32;
552}
553extern "C" {
554    #[doc = " @brief Get the system wide unique sequence number of the OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @return Returns the sequence number, which is unique for each OH_NativeBuffer.\n @since 9\n @version 1.0"]
555    pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32;
556}
557extern "C" {
558    #[doc = " @brief Provide direct cpu access to the potentially multi-planar OH_NativeBuffer in the process's address space.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param virAddr Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.\n @param outPlanes Indicates all image planes that contain the pixel data.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 12\n @version 1.0"]
559    pub fn OH_NativeBuffer_MapPlanes(
560        buffer: *mut OH_NativeBuffer,
561        virAddr: *mut *mut ::std::os::raw::c_void,
562        outPlanes: *mut OH_NativeBuffer_Planes,
563    ) -> i32;
564}
565extern "C" {
566    #[doc = " @brief Converts an <b>OHNativeWindowBuffer</b> instance to an <b>OH_NativeBuffer</b>.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param nativeWindowBuffer Indicates the pointer to a <b>OHNativeWindowBuffer</b> instance.\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> pointer.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 12\n @version 1.0"]
567    pub fn OH_NativeBuffer_FromNativeWindowBuffer(
568        nativeWindowBuffer: *mut OHNativeWindowBuffer,
569        buffer: *mut *mut OH_NativeBuffer,
570    ) -> i32;
571}
572extern "C" {
573    #[doc = " @brief Set the color space of the OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param colorSpace Indicates the color space of native buffer, see <b>OH_NativeBuffer_ColorSpace</b>.\n @return Returns an error code, 0 is success, otherwise, failed.\n @since 11\n @version 1.0"]
574    pub fn OH_NativeBuffer_SetColorSpace(
575        buffer: *mut OH_NativeBuffer,
576        colorSpace: OH_NativeBuffer_ColorSpace,
577    ) -> i32;
578}
579extern "C" {
580    #[doc = " @brief Get the color space of the OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param colorSpace Indicates the color space of native buffer, see <b>OH_NativeBuffer_ColorSpace</b>.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n     {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer is NULL.\n     {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect colorSpace state.\n @since 12\n @version 1.0"]
581    pub fn OH_NativeBuffer_GetColorSpace(
582        buffer: *mut OH_NativeBuffer,
583        colorSpace: *mut OH_NativeBuffer_ColorSpace,
584    ) -> i32;
585}
586extern "C" {
587    #[doc = " @brief Set the metadata type of the OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param metadataKey Indicates the metadata type of native buffer, see <b>OH_NativeBuffer_MetadataKey</b>.\n @param size Indicates the size of a uint8_t vector.\n @param metadata Indicates the pointer to a uint8_t vector.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n     {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer or metadata is NULL.\n     {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state.\n     {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key.\n @since 12\n @version 1.0"]
588    pub fn OH_NativeBuffer_SetMetadataValue(
589        buffer: *mut OH_NativeBuffer,
590        metadataKey: OH_NativeBuffer_MetadataKey,
591        size: i32,
592        metadata: *mut u8,
593    ) -> i32;
594}
595extern "C" {
596    #[doc = " @brief Set the metadata type of the OH_NativeBuffer.\\n\n This interface is a non-thread-safe type interface.\\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param metadataKey Indicates the metadata type of native buffer, see <b>OH_NativeBuffer_MetadataKey</b>.\n @param size Indicates the size of a uint8_t vector.\n @param metadata Indicates the pointer to a uint8_t vector.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n     {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer, metadata, or size is NULL.\n     {@link NATIVE_ERROR_BUFFER_STATE_INVALID} 41207000 - Incorrect metadata state.\n     {@link NATIVE_ERROR_UNSUPPORTED} 50102000 - Unsupported metadata key.\n @since 12\n @version 1.0"]
597    pub fn OH_NativeBuffer_GetMetadataValue(
598        buffer: *mut OH_NativeBuffer,
599        metadataKey: OH_NativeBuffer_MetadataKey,
600        size: *mut i32,
601        metadata: *mut *mut u8,
602    ) -> i32;
603}
604extern "C" {
605    #[doc = " @brief Provide direct cpu access to the OH_NativeBuffer in the process's address space and wait fence.\\n\n If the interface returns OK, fenceFd does not need to be closed by the developer,\n Otherwise, the developer needs to close the fenceFd.\\n\n This interface is a non-thread-safe type interface.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param fenceFd Indicates the pointer to a file descriptor handle.\n @param virAddr Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer or virAddr is NULL or invalid fenceFd.\n {@link NATIVE_ERROR_UNKNOWN} 50002000 - map failed.\n @since 23\n @version 1.0"]
606    #[cfg(feature = "api-23")]
607    pub fn OH_NativeBuffer_MapWaitFence(
608        buffer: *mut OH_NativeBuffer,
609        fenceFd: i32,
610        virAddr: *mut *mut ::std::os::raw::c_void,
611    ) -> i32;
612}
613extern "C" {
614    #[doc = " @brief Serialize <b>OH_NativeBuffer</b> object to the serialized <b>OHIPCParcel</b> object.\\n\n This interface is a non-thread-safe type interface.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param parcel Indicates the serialized <b>OHIPCParcel</b> object.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer or parcel is NULL.\n {@link SURFACE_ERROR_BINDER_ERROR} 50401000 - ipc send failed.\n @since 23\n @version 1.0"]
615    #[cfg(feature = "api-23")]
616    pub fn OH_NativeBuffer_WriteToParcel(
617        buffer: *mut OH_NativeBuffer,
618        parcel: *mut OHIPCParcel,
619    ) -> i32;
620}
621extern "C" {
622    #[doc = " @brief Deserialize data from the serialized <b>OHIPCParcel</b> object and rebuild <b>OH_NativeBuffer</b> object.\n This interface will cause an increase in the reference count of the <b>OH_NativeBuffer</b> instance.\n This interface needs to be used in conjunction with <b>OH_NativeBuffer_Unreference</b>,\\n\n otherwise memory leaks will occur.\n This interface is a non-thread-safe type interface.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param parcel Indicates the serialized <b>OHIPCParcel</b> object.\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> pointer.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - parcel or buffer is NULL.\n {@link NATIVE_ERROR_UNKNOWN} 50002000 - deserialize failed.\n @since 23\n @version 1.0"]
623    #[cfg(feature = "api-23")]
624    pub fn OH_NativeBuffer_ReadFromParcel(
625        parcel: *mut OHIPCParcel,
626        buffer: *mut *mut OH_NativeBuffer,
627    ) -> i32;
628}
629extern "C" {
630    #[doc = " @brief Check whether the system supports the <b>NativeBufferConfig</b>.\\n\n This interface is a non-thread-safe type interface.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param config Indicates the config of the <b>OH_NativeBuffer</b>.\n @param isSupported Indicates whether the system supports the <b>NativeBufferConfig</b>.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - isSupported is NULL.\n @since 23\n @version 1.0"]
631    #[cfg(feature = "api-23")]
632    pub fn OH_NativeBuffer_IsSupported(
633        config: OH_NativeBuffer_Config,
634        isSupported: *mut bool,
635    ) -> i32;
636}
637extern "C" {
638    #[doc = " @brief Provide direct cpu access to the <b>OH_NativeBuffer</b> in the process's address space,\\n\n and return a <b>NativeBufferConfig<b> of the <b>OH_NativeBuffer</b>.\n This interface is a non-thread-safe type interface.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @param buffer Indicates the pointer to a <b>OH_NativeBuffer</b> instance.\n @param virAddr Indicates the address of the <b>OH_NativeBuffer</b> in virtual memory.\n @param config Indicates the pointer to the <b>NativeBufferConfig</b> of the buffer.\n @return {@link NATIVE_ERROR_OK} 0 - Success.\n {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer or virAddr or config is NULL or invalid fenceFd.\n {@link NATIVE_ERROR_UNKNOWN} 50002000 - map failed.\n @since 23\n @version 1.0"]
639    #[cfg(feature = "api-23")]
640    pub fn OH_NativeBuffer_MapAndGetConfig(
641        buffer: *mut OH_NativeBuffer,
642        virAddr: *mut *mut ::std::os::raw::c_void,
643        config: *mut OH_NativeBuffer_Config,
644    ) -> i32;
645}