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