1#![allow(non_snake_case)]
4#![allow(non_upper_case_globals)]
5#![allow(non_camel_case_types)]
6#![allow(clippy::missing_safety_doc)]
7#![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 = " COLORPRIMARIES_BT2020 | (TRANSFUNC_PRIV_LOG << 8) | (MATRIX_BT2020 << 16) | (RANGE_FULL << 21)\n @since 26.0.0"]
114#[cfg(feature = "api-26")]
115pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_LOG_FULL: OH_NativeBuffer_ColorSpace = 32;
116#[doc = " COLORPRIMARIES_BT2020 | (TRANSFUNC_PRIV_LOG << 8) | (MATRIX_BT2020 << 16) | (RANGE_LIMITED << 21)\n @since 26.0.0"]
117#[cfg(feature = "api-26")]
118pub const OH_NativeBuffer_ColorSpace_OH_COLORSPACE_BT2020_LOG_LIMIT: OH_NativeBuffer_ColorSpace =
119 33;
120#[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"]
121pub type OH_NativeBuffer_ColorSpace = u32;
122#[doc = " HLG"]
123pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_HLG: OH_NativeBuffer_MetadataType = 0;
124#[doc = " HDR10"]
125pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_HDR10: OH_NativeBuffer_MetadataType = 1;
126#[doc = " HDR VIVID"]
127pub const OH_NativeBuffer_MetadataType_OH_VIDEO_HDR_VIVID: OH_NativeBuffer_MetadataType = 2;
128#[doc = " HDR IMAGE DUAL.\n @since 22"]
129#[cfg(feature = "api-22")]
130pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_VIVID_DUAL: OH_NativeBuffer_MetadataType = 3;
131#[doc = " HDR IMAGE SINGLE.\n @since 22"]
132#[cfg(feature = "api-22")]
133pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_VIVID_SINGLE: OH_NativeBuffer_MetadataType = 4;
134#[doc = " HDR IMAGE ISO DUAL.\n @since 23"]
135#[cfg(feature = "api-23")]
136pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_ISO_DUAL: OH_NativeBuffer_MetadataType = 5;
137#[doc = " HDR IMAGE ISO SINGLE.\n @since 23"]
138#[cfg(feature = "api-23")]
139pub const OH_NativeBuffer_MetadataType_OH_IMAGE_HDR_ISO_SINGLE: OH_NativeBuffer_MetadataType = 6;
140#[doc = " NONE Metadata\n @since 13"]
141#[cfg(feature = "api-13")]
142pub const OH_NativeBuffer_MetadataType_OH_VIDEO_NONE: OH_NativeBuffer_MetadataType = -1;
143#[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"]
144pub type OH_NativeBuffer_MetadataType = i32;
145#[doc = " @brief Indicates the color x and y.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
146#[repr(C)]
147#[derive(Debug, Copy, Clone)]
148pub struct OH_NativeBuffer_ColorXY {
149 #[doc = " color X"]
150 pub x: f32,
151 #[doc = " color Y"]
152 pub y: f32,
153}
154#[doc = " @brief Indicates the smpte2086 metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
155#[repr(C)]
156#[derive(Debug, Copy, Clone)]
157pub struct OH_NativeBuffer_Smpte2086 {
158 #[doc = " primary red"]
159 pub displayPrimaryRed: OH_NativeBuffer_ColorXY,
160 #[doc = " primary green"]
161 pub displayPrimaryGreen: OH_NativeBuffer_ColorXY,
162 #[doc = " primary blue"]
163 pub displayPrimaryBlue: OH_NativeBuffer_ColorXY,
164 #[doc = " white point"]
165 pub whitePoint: OH_NativeBuffer_ColorXY,
166 #[doc = " max luminance"]
167 pub maxLuminance: f32,
168 #[doc = " min luminance"]
169 pub minLuminance: f32,
170}
171#[doc = " @brief Indicates the cta861.3 metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
172#[repr(C)]
173#[derive(Debug, Copy, Clone)]
174pub struct OH_NativeBuffer_Cta861 {
175 #[doc = " max content lightLevel"]
176 pub maxContentLightLevel: f32,
177 #[doc = " max frame average light level"]
178 pub maxFrameAverageLightLevel: f32,
179}
180#[doc = " @brief Indicates the HDR static metadata.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
181#[repr(C)]
182#[derive(Debug, Copy, Clone)]
183pub struct OH_NativeBuffer_StaticMetadata {
184 #[doc = " smpte 2086 metadata"]
185 pub smpte2086: OH_NativeBuffer_Smpte2086,
186 #[doc = " CTA-861.3 metadata"]
187 pub cta861: OH_NativeBuffer_Cta861,
188}
189#[doc = " value: OH_NativeBuffer_MetadataType"]
190pub const OH_NativeBuffer_MetadataKey_OH_HDR_METADATA_TYPE: OH_NativeBuffer_MetadataKey = 0;
191#[doc = " value: OH_NativeBuffer_StaticMetadata"]
192pub const OH_NativeBuffer_MetadataKey_OH_HDR_STATIC_METADATA: OH_NativeBuffer_MetadataKey = 1;
193#[doc = " byte stream of SEI in video stream"]
194pub const OH_NativeBuffer_MetadataKey_OH_HDR_DYNAMIC_METADATA: OH_NativeBuffer_MetadataKey = 2;
195#[doc = " Region of interest(ROI) metadata is used to configure ROI feature in video encoding. Value type is string\n in the format \"Top1,Left1-Bottom1,Right1[=Params1];Top2,Left2-Bottom2,Right2[=Params2];\".\n Each \"Top,Left-Bottom,Right\" represents the coordinate information of one ROI.\n The \"[=Params]\" is optional.\n The format of \"[=Params]\" varies by version:\n 1. Prior to version 26.0.0: Only a single int32_t value representing the\n quantization parameter offset is supported (e.g., \"=QpOffset\").\n 2. Since version 26.0.0: A Key-Value format is additionally supported and recommended.\n It uses comma-separated key-value pairs (e.g., \"=dqp:-6,slb:1\").\n Supported keys:\n - \"dqp\": Quantization parameter offset.\n - \"slb\": Semantic label. The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}.\n\n If \"=Params\" is omitted entirely, like \"Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=dqp:-6;\",\n the encoder will use the default parameters to perform the ROI encoding on the first ROI and\n use the specified parameters 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 @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoMetadata_AppendRoiString} to format\n and append ROI configurations safely instead of concatenating the string manually.\n\n @since 22"]
196#[cfg(feature = "api-22")]
197pub const OH_NativeBuffer_MetadataKey_OH_REGION_OF_INTEREST_METADATA: OH_NativeBuffer_MetadataKey =
198 3;
199#[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"]
200pub type OH_NativeBuffer_MetadataKey = u32;
201#[doc = " CLUT8 format\n @since 12"]
202pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT8: OH_NativeBuffer_Format = 0;
203#[doc = " CLUT1 format\n @since 12"]
204pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT1: OH_NativeBuffer_Format = 1;
205#[doc = " CLUT4 format\n @since 12"]
206pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_CLUT4: OH_NativeBuffer_Format = 2;
207#[doc = " CLUT4 format\n @since 12"]
208pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_565: OH_NativeBuffer_Format = 3;
209#[doc = " < RGB565 format */"]
210pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_5658: OH_NativeBuffer_Format = 4;
211#[doc = " < RGBA5658 format */"]
212pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_4444: OH_NativeBuffer_Format = 5;
213#[doc = " < RGBX4444 format */"]
214pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_4444: OH_NativeBuffer_Format = 6;
215#[doc = " < RGBA4444 format */"]
216pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_444: OH_NativeBuffer_Format = 7;
217#[doc = " < RGB444 format */"]
218pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_5551: OH_NativeBuffer_Format = 8;
219#[doc = " < RGBX5551 format */"]
220pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_5551: OH_NativeBuffer_Format = 9;
221#[doc = " < RGBA5551 format */"]
222pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_555: OH_NativeBuffer_Format = 10;
223#[doc = " < RGB555 format */"]
224pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBX_8888: OH_NativeBuffer_Format = 11;
225#[doc = " < RGBX8888 format */"]
226pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_8888: OH_NativeBuffer_Format = 12;
227#[doc = " < RGBA8888 format */"]
228pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGB_888: OH_NativeBuffer_Format = 13;
229#[doc = " < RGB888 format */"]
230pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGR_565: OH_NativeBuffer_Format = 14;
231#[doc = " < BGR565 format */"]
232pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_4444: OH_NativeBuffer_Format = 15;
233#[doc = " < BGRX4444 format */"]
234pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_4444: OH_NativeBuffer_Format = 16;
235#[doc = " < BGRA4444 format */"]
236pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_5551: OH_NativeBuffer_Format = 17;
237#[doc = " < BGRX5551 format */"]
238pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_5551: OH_NativeBuffer_Format = 18;
239#[doc = " < BGRA5551 format */"]
240pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRX_8888: OH_NativeBuffer_Format = 19;
241#[doc = " < BGRX8888 format */"]
242pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BGRA_8888: OH_NativeBuffer_Format = 20;
243#[doc = " < BGRA8888 format */\n**\n* YUV422 interleaved format\n* @since 12\n*/"]
244pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YUV_422_I: OH_NativeBuffer_Format = 21;
245#[doc = " YCBCR422 semi-plannar format\n @since 12"]
246pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_422_SP: OH_NativeBuffer_Format = 22;
247#[doc = " YCRCB422 semi-plannar format\n @since 12"]
248pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_422_SP: OH_NativeBuffer_Format = 23;
249#[doc = " YCBCR420 semi-plannar format\n @since 12"]
250pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_420_SP: OH_NativeBuffer_Format = 24;
251#[doc = " YCRCB420 semi-plannar format\n @since 12"]
252pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_420_SP: OH_NativeBuffer_Format = 25;
253#[doc = " YCBCR422 plannar format\n @since 12"]
254pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_422_P: OH_NativeBuffer_Format = 26;
255#[doc = " YCRCB422 plannar format\n @since 12"]
256pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_422_P: OH_NativeBuffer_Format = 27;
257#[doc = " YCBCR420 plannar format\n @since 12"]
258pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_420_P: OH_NativeBuffer_Format = 28;
259#[doc = " YCRCB420 plannar format\n @since 12"]
260pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_420_P: OH_NativeBuffer_Format = 29;
261#[doc = " YUYV422 packed format\n @since 12"]
262pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YUYV_422_PKG: OH_NativeBuffer_Format = 30;
263#[doc = " UYVY422 packed format\n @since 12"]
264pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_UYVY_422_PKG: OH_NativeBuffer_Format = 31;
265#[doc = " YVYU422 packed format\n @since 12"]
266pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YVYU_422_PKG: OH_NativeBuffer_Format = 32;
267#[doc = " VYUY422 packed format\n @since 12"]
268pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_VYUY_422_PKG: OH_NativeBuffer_Format = 33;
269#[doc = " RGBA_1010102 packed format\n @since 12"]
270pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA_1010102: OH_NativeBuffer_Format = 34;
271#[doc = " YCBCR420 semi-planar 10bit packed format\n @since 12"]
272pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCBCR_P010: OH_NativeBuffer_Format = 35;
273#[doc = " YCRCB420 semi-planar 10bit packed format\n @since 12"]
274pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_YCRCB_P010: OH_NativeBuffer_Format = 36;
275#[doc = " Raw 10bit packed format\n @since 12"]
276pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RAW10: OH_NativeBuffer_Format = 37;
277#[doc = " BLOB format\n @since 15"]
278#[cfg(feature = "api-15")]
279pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BLOB: OH_NativeBuffer_Format = 38;
280#[doc = " RGBA16 float format\n @since 15"]
281#[cfg(feature = "api-15")]
282pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_RGBA16_FLOAT: OH_NativeBuffer_Format = 39;
283#[doc = " Y8 format\n @since 20"]
284#[cfg(feature = "api-20")]
285pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_Y8: OH_NativeBuffer_Format = 40;
286#[doc = " Y16 format\n @since 20"]
287#[cfg(feature = "api-20")]
288pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_Y16: OH_NativeBuffer_Format = 41;
289#[doc = " vender mask format\n @since 12"]
290pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_VENDER_MASK: OH_NativeBuffer_Format =
291 2147418112;
292#[doc = " vender mask format\n @since 12"]
293pub const OH_NativeBuffer_Format_NATIVEBUFFER_PIXEL_FMT_BUTT: OH_NativeBuffer_Format = 2147483647;
294#[doc = " @brief Indicates the format of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 10\n @version 1.0"]
295pub type OH_NativeBuffer_Format = u32;
296#[doc = "< No rotation"]
297pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_NONE: OH_NativeBuffer_TransformType = 0;
298#[doc = "< Rotation by 90 degrees"]
299pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_90: OH_NativeBuffer_TransformType = 1;
300#[doc = "< Rotation by 180 degrees"]
301pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_180: OH_NativeBuffer_TransformType = 2;
302#[doc = "< Rotation by 270 degrees"]
303pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_ROTATE_270: OH_NativeBuffer_TransformType = 3;
304#[doc = "< Flip horizontally"]
305pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H: OH_NativeBuffer_TransformType = 4;
306#[doc = "< Flip vertically"]
307pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V: OH_NativeBuffer_TransformType = 5;
308#[doc = "< Flip horizontally and rotate 90 degrees"]
309pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT90: OH_NativeBuffer_TransformType =
310 6;
311#[doc = "< Flip vertically and rotate 90 degrees"]
312pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT90: OH_NativeBuffer_TransformType =
313 7;
314#[doc = "< Flip horizontally and rotate 180 degrees"]
315pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT180: OH_NativeBuffer_TransformType =
316 8;
317#[doc = "< Flip vertically and rotate 180 degrees"]
318pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT180: OH_NativeBuffer_TransformType =
319 9;
320#[doc = "< Flip horizontally and rotate 270 degrees"]
321pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_H_ROT270: OH_NativeBuffer_TransformType =
322 10;
323#[doc = "< Flip vertically and rotate 270 degrees"]
324pub const OH_NativeBuffer_TransformType_NATIVEBUFFER_FLIP_V_ROT270: OH_NativeBuffer_TransformType =
325 11;
326#[doc = " @brief Indicates the transform type of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
327pub type OH_NativeBuffer_TransformType = u32;
328#[doc = " 2-dimension video"]
329#[cfg(feature = "api-26")]
330pub const OH_NativeBuffer_VideoDimensionType_OH_VIDEO_DIM_TYPE_2D:
331 OH_NativeBuffer_VideoDimensionType = 0;
332#[doc = " 3-dimension video, format: side by side"]
333#[cfg(feature = "api-26")]
334pub const OH_NativeBuffer_VideoDimensionType_OH_VIDEO_DIM_TYPE_3D_SBS:
335 OH_NativeBuffer_VideoDimensionType = 1;
336#[doc = " 3-dimension video, format: top and bottom"]
337#[cfg(feature = "api-26")]
338pub const OH_NativeBuffer_VideoDimensionType_OH_VIDEO_DIM_TYPE_3D_TAB:
339 OH_NativeBuffer_VideoDimensionType = 2;
340#[doc = " Invalid video dimension type"]
341#[cfg(feature = "api-26")]
342pub const OH_NativeBuffer_VideoDimensionType_OH_VIDEO_DIM_TYPE_BUTT:
343 OH_NativeBuffer_VideoDimensionType = 3;
344#[doc = " @brief Indicates video dimension type.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 26.0.0\n @version 1.0"]
345#[cfg(feature = "api-26")]
346pub type OH_NativeBuffer_VideoDimensionType = u32;
347#[doc = " value: the video dimension type of the native buffer"]
348#[cfg(feature = "api-26")]
349pub const OH_NativeBuffer_3D_MetadataKey_OH_VIDEO_DIM_TYPE: OH_NativeBuffer_3D_MetadataKey = 0;
350#[doc = " @brief Indicates the descriptive 3D information of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 26.0.0\n @version 1.0"]
351#[cfg(feature = "api-26")]
352pub type OH_NativeBuffer_3D_MetadataKey = u32;
353#[doc = " @brief Buffer handle used to transfer and obtain information about the buffer.\n @since 8"]
354#[repr(C)]
355#[derive(Debug)]
356pub struct BufferHandle {
357 #[doc = "< buffer fd, -1 if not supported"]
358 pub fd: i32,
359 #[doc = "< the width of memory"]
360 pub width: i32,
361 #[doc = "< the stride of memory"]
362 pub stride: i32,
363 #[doc = "< the height of memory"]
364 pub height: i32,
365 pub size: i32,
366 #[doc = "< the format of memory"]
367 pub format: i32,
368 #[doc = "< the usage of memory"]
369 pub usage: u64,
370 #[doc = "< Virtual address of memory"]
371 pub virAddr: *mut ::std::os::raw::c_void,
372 #[doc = "< Shared memory key"]
373 pub key: i32,
374 #[doc = "< Physical address"]
375 pub phyAddr: u64,
376 #[doc = "< the number of reserved fd value"]
377 pub reserveFds: u32,
378 #[doc = "< the number of reserved integer value"]
379 pub reserveInts: u32,
380 #[doc = "< the data"]
381 pub reserve: __IncompleteArrayField<i32>,
382}
383#[repr(C)]
384#[derive(Debug, Copy, Clone)]
385pub struct OH_NativeBuffer {
386 _unused: [u8; 0],
387}
388#[repr(C)]
389#[derive(Debug, Copy, Clone)]
390pub struct OHIPCParcel {
391 _unused: [u8; 0],
392}
393#[doc = " @brief native window buffer.\n @since 8"]
394#[repr(C)]
395#[derive(Debug, Copy, Clone)]
396pub struct NativeWindowBuffer {
397 _unused: [u8; 0],
398}
399#[doc = " @brief define the new type name OHNativeWindowBuffer for struct NativeWindowBuffer.\n @since 8"]
400pub type OHNativeWindowBuffer = NativeWindowBuffer;
401#[doc = " @brief indicates a dirty region where content is updated.\n @since 8"]
402#[repr(C)]
403#[derive(Debug, Copy, Clone)]
404pub struct Region {
405 pub rects: *mut Region_Rect,
406 #[doc = " if rectNumber is 0, fill the Buffer dirty size by default"]
407 pub rectNumber: i32,
408}
409#[doc = " if rects is nullptr, fill the Buffer dirty size by default"]
410#[repr(C)]
411#[derive(Debug, Copy, Clone)]
412pub struct Region_Rect {
413 pub x: i32,
414 pub y: i32,
415 pub w: u32,
416 pub h: u32,
417}
418#[doc = " the window content is not updated until a buffer of\n the window size is received"]
419pub const OHScalingMode_OH_SCALING_MODE_FREEZE: OHScalingMode = 0;
420#[doc = " the buffer is scaled in two dimensions to match the window size"]
421pub const OHScalingMode_OH_SCALING_MODE_SCALE_TO_WINDOW: OHScalingMode = 1;
422#[doc = " the buffer is uniformly scaled so that the smaller size of\n the buffer matches the window size"]
423pub const OHScalingMode_OH_SCALING_MODE_SCALE_CROP: OHScalingMode = 2;
424#[doc = " the window is clipped to the size of the buffer's clipping rectangle\n pixels outside the clipping rectangle are considered fully transparent."]
425pub const OHScalingMode_OH_SCALING_MODE_NO_SCALE_CROP: OHScalingMode = 3;
426#[doc = " @brief Indicates Scaling Mode.\n @since 9\n @deprecated since 10\n @useinstead OHScalingModeV2"]
427pub type OHScalingMode = u32;
428#[doc = " the window content is not updated until a buffer of\n the window size is received"]
429pub const OHScalingModeV2_OH_SCALING_MODE_FREEZE_V2: OHScalingModeV2 = 0;
430#[doc = " the buffer is scaled in two dimensions to match the window size"]
431pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_TO_WINDOW_V2: OHScalingModeV2 = 1;
432#[doc = " the buffer is uniformly scaled so that the smaller size of\n the buffer matches the window size"]
433pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_CROP_V2: OHScalingModeV2 = 2;
434#[doc = " the window is clipped to the size of the buffer's clipping rectangle\n pixels outside the clipping rectangle are considered fully transparent."]
435pub const OHScalingModeV2_OH_SCALING_MODE_NO_SCALE_CROP_V2: OHScalingModeV2 = 3;
436#[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."]
437pub const OHScalingModeV2_OH_SCALING_MODE_SCALE_FIT_V2: OHScalingModeV2 = 4;
438#[doc = " @brief Indicates Scaling Mode.\n @since 12"]
439pub type OHScalingModeV2 = u32;
440pub const OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_X: OHHDRMetadataKey = 0;
441pub const OHHDRMetadataKey_OH_METAKEY_RED_PRIMARY_Y: OHHDRMetadataKey = 1;
442pub const OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_X: OHHDRMetadataKey = 2;
443pub const OHHDRMetadataKey_OH_METAKEY_GREEN_PRIMARY_Y: OHHDRMetadataKey = 3;
444pub const OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_X: OHHDRMetadataKey = 4;
445pub const OHHDRMetadataKey_OH_METAKEY_BLUE_PRIMARY_Y: OHHDRMetadataKey = 5;
446pub const OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_X: OHHDRMetadataKey = 6;
447pub const OHHDRMetadataKey_OH_METAKEY_WHITE_PRIMARY_Y: OHHDRMetadataKey = 7;
448pub const OHHDRMetadataKey_OH_METAKEY_MAX_LUMINANCE: OHHDRMetadataKey = 8;
449pub const OHHDRMetadataKey_OH_METAKEY_MIN_LUMINANCE: OHHDRMetadataKey = 9;
450pub const OHHDRMetadataKey_OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL: OHHDRMetadataKey = 10;
451pub const OHHDRMetadataKey_OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL: OHHDRMetadataKey = 11;
452pub const OHHDRMetadataKey_OH_METAKEY_HDR10_PLUS: OHHDRMetadataKey = 12;
453pub const OHHDRMetadataKey_OH_METAKEY_HDR_VIVID: OHHDRMetadataKey = 13;
454#[doc = " @brief Enumerates the HDR metadata keys.\n @since 9\n @deprecated since 10"]
455pub type OHHDRMetadataKey = u32;
456#[doc = " @brief Defines the HDR metadata.\n @since 9\n @deprecated since 10"]
457#[repr(C)]
458#[derive(Debug, Copy, Clone)]
459pub struct OHHDRMetaData {
460 pub key: OHHDRMetadataKey,
461 pub value: f32,
462}
463#[doc = " @brief Defines the ExtData Handle\n @since 9\n @deprecated since 10"]
464#[repr(C)]
465#[derive(Debug)]
466pub struct OHExtDataHandle {
467 pub fd: i32,
468 pub reserveInts: u32,
469 pub reserve: __IncompleteArrayField<i32>,
470}
471pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_READ: OH_NativeBuffer_Usage = 1;
472#[doc = " < CPU read buffer */"]
473pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_WRITE: OH_NativeBuffer_Usage = 2;
474#[doc = " < CPU write memory */"]
475pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_MEM_DMA: OH_NativeBuffer_Usage = 8;
476#[doc = " < Direct memory access (DMA) buffer */\n**\n* MMZ with cache\n* @since 20\n*/"]
477#[cfg(feature = "api-20")]
478pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_MEM_MMZ_CACHE: OH_NativeBuffer_Usage = 32;
479#[doc = " @since 12"]
480pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_HW_RENDER: OH_NativeBuffer_Usage = 256;
481#[doc = " < For GPU write case */\n**\n* @since 12\n*/"]
482pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_HW_TEXTURE: OH_NativeBuffer_Usage = 512;
483#[doc = " < For GPU read case */\n**\n* @since 12\n*/"]
484pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_CPU_READ_OFTEN: OH_NativeBuffer_Usage = 65536;
485#[doc = " < Often be mapped for direct CPU reads */\n**\n* @since 12\n*/"]
486pub const OH_NativeBuffer_Usage_NATIVEBUFFER_USAGE_ALIGNMENT_512: OH_NativeBuffer_Usage = 262144;
487#[doc = " @brief Indicates the usage of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 10\n @version 1.0"]
488pub type OH_NativeBuffer_Usage = u32;
489#[doc = "< Native or default"]
490pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_NATIVE: OH_NativeBuffer_ColorGamut =
491 0;
492#[doc = "< Standard BT601"]
493pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT601:
494 OH_NativeBuffer_ColorGamut = 1;
495#[doc = "< Standard BT709"]
496pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_STANDARD_BT709:
497 OH_NativeBuffer_ColorGamut = 2;
498#[doc = "< DCI P3"]
499pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DCI_P3: OH_NativeBuffer_ColorGamut =
500 3;
501#[doc = "< SRGB"]
502pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_SRGB: OH_NativeBuffer_ColorGamut = 4;
503#[doc = "< Adobe RGB"]
504pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_ADOBE_RGB:
505 OH_NativeBuffer_ColorGamut = 5;
506#[doc = "< Display P3"]
507pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DISPLAY_P3:
508 OH_NativeBuffer_ColorGamut = 6;
509#[doc = "< BT2020"]
510pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2020: OH_NativeBuffer_ColorGamut =
511 7;
512#[doc = "< BT2100 PQ"]
513pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2100_PQ:
514 OH_NativeBuffer_ColorGamut = 8;
515#[doc = "< BT2100 HLG"]
516pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_BT2100_HLG:
517 OH_NativeBuffer_ColorGamut = 9;
518#[doc = "< Display BT2020"]
519pub const OH_NativeBuffer_ColorGamut_NATIVEBUFFER_COLOR_GAMUT_DISPLAY_BT2020:
520 OH_NativeBuffer_ColorGamut = 10;
521#[doc = " @brief Indicates the color gamut of a native buffer.\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
522pub type OH_NativeBuffer_ColorGamut = u32;
523#[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"]
524#[repr(C)]
525#[derive(Debug, Copy, Clone)]
526pub struct OH_NativeBuffer_Config {
527 #[doc = "< Width in pixels"]
528 pub width: i32,
529 #[doc = "< Height in pixels"]
530 pub height: i32,
531 #[doc = "< One of PixelFormat"]
532 pub format: i32,
533 #[doc = "< Combination of buffer usage"]
534 pub usage: i32,
535 #[doc = "< the stride of memory in bytes"]
536 pub stride: i32,
537}
538#[doc = " @brief Holds info for a single image plane. \\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
539#[repr(C)]
540#[derive(Debug, Copy, Clone)]
541pub struct OH_NativeBuffer_Plane {
542 #[doc = "< Offset in bytes of plane."]
543 pub offset: u64,
544 #[doc = "< Distance in bytes from the first value of one row of the image to the first value of the next row."]
545 pub rowStride: u32,
546 #[doc = "< Distance in bytes from the first value of one column of the image to the first value of the next column."]
547 pub columnStride: u32,
548}
549#[doc = " @brief Holds all image planes. \\n\n\n @syscap SystemCapability.Graphic.Graphic2D.NativeBuffer\n @since 12\n @version 1.0"]
550#[repr(C)]
551#[derive(Debug, Copy, Clone)]
552pub struct OH_NativeBuffer_Planes {
553 #[doc = "< Number of distinct planes."]
554 pub planeCount: u32,
555 #[doc = "< Array of image planes."]
556 pub planes: [OH_NativeBuffer_Plane; 4usize],
557}
558extern "C" {
559 #[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"]
560 pub fn OH_NativeBuffer_Alloc(config: *const OH_NativeBuffer_Config) -> *mut OH_NativeBuffer;
561}
562extern "C" {
563 #[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"]
564 pub fn OH_NativeBuffer_Reference(buffer: *mut OH_NativeBuffer) -> i32;
565}
566extern "C" {
567 #[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"]
568 pub fn OH_NativeBuffer_Unreference(buffer: *mut OH_NativeBuffer) -> i32;
569}
570extern "C" {
571 #[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"]
572 pub fn OH_NativeBuffer_GetConfig(
573 buffer: *mut OH_NativeBuffer,
574 config: *mut OH_NativeBuffer_Config,
575 );
576}
577extern "C" {
578 #[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"]
579 pub fn OH_NativeBuffer_Map(
580 buffer: *mut OH_NativeBuffer,
581 virAddr: *mut *mut ::std::os::raw::c_void,
582 ) -> i32;
583}
584extern "C" {
585 #[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"]
586 pub fn OH_NativeBuffer_Unmap(buffer: *mut OH_NativeBuffer) -> i32;
587}
588extern "C" {
589 #[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"]
590 pub fn OH_NativeBuffer_GetSeqNum(buffer: *mut OH_NativeBuffer) -> u32;
591}
592extern "C" {
593 #[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"]
594 pub fn OH_NativeBuffer_MapPlanes(
595 buffer: *mut OH_NativeBuffer,
596 virAddr: *mut *mut ::std::os::raw::c_void,
597 outPlanes: *mut OH_NativeBuffer_Planes,
598 ) -> i32;
599}
600extern "C" {
601 #[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"]
602 pub fn OH_NativeBuffer_FromNativeWindowBuffer(
603 nativeWindowBuffer: *mut OHNativeWindowBuffer,
604 buffer: *mut *mut OH_NativeBuffer,
605 ) -> i32;
606}
607extern "C" {
608 #[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"]
609 pub fn OH_NativeBuffer_SetColorSpace(
610 buffer: *mut OH_NativeBuffer,
611 colorSpace: OH_NativeBuffer_ColorSpace,
612 ) -> i32;
613}
614extern "C" {
615 #[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"]
616 pub fn OH_NativeBuffer_GetColorSpace(
617 buffer: *mut OH_NativeBuffer,
618 colorSpace: *mut OH_NativeBuffer_ColorSpace,
619 ) -> i32;
620}
621extern "C" {
622 #[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"]
623 pub fn OH_NativeBuffer_SetMetadataValue(
624 buffer: *mut OH_NativeBuffer,
625 metadataKey: OH_NativeBuffer_MetadataKey,
626 size: i32,
627 metadata: *mut u8,
628 ) -> i32;
629}
630extern "C" {
631 #[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"]
632 pub fn OH_NativeBuffer_GetMetadataValue(
633 buffer: *mut OH_NativeBuffer,
634 metadataKey: OH_NativeBuffer_MetadataKey,
635 size: *mut i32,
636 metadata: *mut *mut u8,
637 ) -> i32;
638}
639extern "C" {
640 #[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"]
641 #[cfg(feature = "api-23")]
642 pub fn OH_NativeBuffer_MapWaitFence(
643 buffer: *mut OH_NativeBuffer,
644 fenceFd: i32,
645 virAddr: *mut *mut ::std::os::raw::c_void,
646 ) -> i32;
647}
648extern "C" {
649 #[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"]
650 #[cfg(feature = "api-23")]
651 pub fn OH_NativeBuffer_WriteToParcel(
652 buffer: *mut OH_NativeBuffer,
653 parcel: *mut OHIPCParcel,
654 ) -> i32;
655}
656extern "C" {
657 #[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"]
658 #[cfg(feature = "api-23")]
659 pub fn OH_NativeBuffer_ReadFromParcel(
660 parcel: *mut OHIPCParcel,
661 buffer: *mut *mut OH_NativeBuffer,
662 ) -> i32;
663}
664extern "C" {
665 #[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"]
666 #[cfg(feature = "api-23")]
667 pub fn OH_NativeBuffer_IsSupported(
668 config: OH_NativeBuffer_Config,
669 isSupported: *mut bool,
670 ) -> i32;
671}
672extern "C" {
673 #[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"]
674 #[cfg(feature = "api-23")]
675 pub fn OH_NativeBuffer_MapAndGetConfig(
676 buffer: *mut OH_NativeBuffer,
677 virAddr: *mut *mut ::std::os::raw::c_void,
678 config: *mut OH_NativeBuffer_Config,
679 ) -> i32;
680}