• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# NativeWindow
2
3
4## Overview
5
6The **NativeWindow** module provides the **NativeWindow** capability for connection to the EGL.
7
8\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
9
10**Since**
11
128
13
14
15## Summary
16
17
18### Files
19
20| Name| Description|
21| -------- | -------- |
22| [external_window.h](external__window_8h.md) | Declares the functions for obtaining and using **NativeWindow**.<br>File to include: &lt;native_window/external_window.h&gt; <br>Library: libnative_window.so|
23
24
25### Structs
26
27| Name| Description|
28| -------- | -------- |
29| [Region](_region.md) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
30| [OHHDRMetaData](_o_h_h_d_r_meta_data.md) | Defines the HDR metadata.|
31| [OHExtDataHandle](_o_h_ext_data_handle.md) | Defines the extended data handle.|
32
33
34### Types
35
36| Name| Description|
37| -------- | -------- |
38| [OHNativeWindow](#ohnativewindow) | Provides the capability of accessing the **OHNativeWindow**.|
39| [OHNativeWindowBuffer](#ohnativewindowbuffer) | Provides the capability of accessing the **OHNativeWindowBuffer**.|
40| [Region](#region) | Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.|
41
42
43### Enums
44
45| Name| Description|
46| -------- | -------- |
47| [NativeWindowOperation](#nativewindowoperation) {<br>SET_BUFFER_GEOMETRY, GET_BUFFER_GEOMETRY, GET_FORMAT, SET_FORMAT,<br>GET_USAGE, SET_USAGE, SET_STRIDE, GET_STRIDE,<br>SET_SWAP_INTERVAL, GET_SWAP_INTERVAL, SET_TIMEOUT, GET_TIMEOUT,<br>SET_COLOR_GAMUT, GET_COLOR_GAMUT, SET_TRANSFORM, GET_TRANSFORM,<br>SET_UI_TIMESTAMP<br>} | Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function.|
48| [OHScalingMode](#ohscalingmode) { OH_SCALING_MODE_FREEZE = 0, OH_SCALING_MODE_SCALE_TO_WINDOW, OH_SCALING_MODE_SCALE_CROP, OH_SCALING_MODE_NO_SCALE_CROP } | Enumerates the scaling modes.|
49| [OHHDRMetadataKey](#ohhdrmetadatakey) {<br>OH_METAKEY_RED_PRIMARY_X = 0, OH_METAKEY_RED_PRIMARY_Y = 1, OH_METAKEY_GREEN_PRIMARY_X = 2, OH_METAKEY_GREEN_PRIMARY_Y = 3,<br>OH_METAKEY_BLUE_PRIMARY_X = 4, OH_METAKEY_BLUE_PRIMARY_Y = 5, OH_METAKEY_WHITE_PRIMARY_X = 6, OH_METAKEY_WHITE_PRIMARY_Y = 7,<br>OH_METAKEY_MAX_LUMINANCE = 8, OH_METAKEY_MIN_LUMINANCE = 9, OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL = 10, OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL = 11,<br>OH_METAKEY_HDR10_PLUS = 12, OH_METAKEY_HDR_VIVID = 13<br>} | Enumerates the HDR metadata keys.|
50
51
52### Functions
53
54| Name| Description|
55| -------- | -------- |
56| [OH_NativeWindow_CreateNativeWindow](#oh_nativewindow_createnativewindow) (void \*pSurface) | Creates an **OHNativeWindow** instance. A new **OHNativeWindow** instance is created each time this function is called.|
57| [OH_NativeWindow_DestroyNativeWindow](#oh_nativewindow_destroynativewindow) (OHNativeWindow \*window) | Decreases the reference count of an **OHNativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance.|
58| [OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer](#oh_nativewindow_createnativewindowbufferfromsurfacebuffer) (void \*pSurfaceBuffer) | Creates an **OHNativeWindowBuffer** instance. A new **OHNativeWindowBuffer** instance is created each time this function is called.|
59| [OH_NativeWindow_DestroyNativeWindowBuffer](#oh_nativewindow_destroynativewindowbuffer) (OHNativeWindowBuffer \*buffer) | Decreases the reference count of an **OHNativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance.|
60| [OH_NativeWindow_NativeWindowRequestBuffer](#oh_nativewindow_nativewindowrequestbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*\*buffer, int \*fenceFd) | Requests an **OHNativeWindowBuffer** through an **OHNativeWindow** instance for content production.|
61| [OH_NativeWindow_NativeWindowFlushBuffer](#oh_nativewindow_nativewindowflushbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer, int fenceFd, Region region) | Flushes the **OHNativeWindowBuffer** filled with the content to the buffer queue through an **OHNativeWindow** instance for content consumption.|
62| [OH_NativeWindow_NativeWindowAbortBuffer](#oh_nativewindow_nativewindowabortbuffer) (OHNativeWindow \*window, OHNativeWindowBuffer \*buffer) | Returns the **OHNativeWindowBuffer** to the buffer queue through an **OHNativeWindow** instance, without filling in any content. The **OHNativeWindowBuffer** can be used for a new request.|
63| [OH_NativeWindow_NativeWindowHandleOpt](#oh_nativewindow_nativewindowhandleopt) (OHNativeWindow \*window, int code,...) | Sets or obtains the attributes of an **OHNativeWindow**, including the width, height, and content format.|
64| [OH_NativeWindow_GetBufferHandleFromNative](#oh_nativewindow_getbufferhandlefromnative) (OHNativeWindowBuffer \*buffer) | Obtains the pointer to a **BufferHandle** of an **OHNativeWindowBuffer** instance.|
65| [OH_NativeWindow_NativeObjectReference](#oh_nativewindow_nativeobjectreference) (void \*obj) | Adds the reference count of a native object.|
66| [OH_NativeWindow_NativeObjectUnreference](#oh_nativewindow_nativeobjectunreference) (void \*obj) | Decreases the reference count of a native object and when the reference count reaches 0, destroys this object.|
67| [OH_NativeWindow_GetNativeObjectMagic](#oh_nativewindow_getnativeobjectmagic) (void \*obj) | Obtains the magic ID of a native object.|
68| [OH_NativeWindow_NativeWindowSetScalingMode](#oh_nativewindow_nativewindowsetscalingmode) (OHNativeWindow \*window, uint32_t sequence, OHScalingMode scalingMode) | Sets a scaling mode for an **OHNativeWindow**.|
69| [OH_NativeWindow_NativeWindowSetMetaData](#oh_nativewindow_nativewindowsetmetadata) (OHNativeWindow \*window, uint32_t sequence, int32_t size, const OHHDRMetaData \*metaData) | Sets metadata for an **OHNativeWindow**.|
70| [OH_NativeWindow_NativeWindowSetMetaDataSet](#oh_nativewindow_nativewindowsetmetadataset) (OHNativeWindow*window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t \*metaData) | Sets a metadata set for an **OHNativeWindow**.|
71| [OH_NativeWindow_NativeWindowSetTunnelHandle](#oh_nativewindow_nativewindowsettunnelhandle) (OHNativeWindow \*window, const OHExtDataHandle \*handle) | Sets a tunnel handle to an **OHNativeWindow**.|
72
73
74## Type Description
75
76
77### OHNativeWindow
78
79
80```
81typedef struct NativeWindow OHNativeWindow
82```
83
84**Description**
85
86Provides the capability of accessing the **OHNativeWindow**.
87
88
89### OHNativeWindowBuffer
90
91
92```
93typedef struct NativeWindowBuffer OHNativeWindowBuffer
94```
95
96**Description**
97
98Provides the capability of accessing the **OHNativeWindowBuffer**.
99
100
101### Region
102
103
104```
105typedef struct Region Region
106```
107
108**Description**
109
110Defines the rectangle (dirty region) where the content is to be updated in the local **OHNativeWindow**.
111
112
113## Enum Description
114
115
116### NativeWindowOperation
117
118
119```
120enum NativeWindowOperation
121```
122
123**Description**
124
125Enumerates the operation codes in the **OH_NativeWindow_NativeWindowHandleOpt** function.
126
127| Value| Description|
128| -------- | -------- |
129| SET_BUFFER_GEOMETRY | Setting the geometry for the local window buffer.<br>Variable arguments in the function: [Input] int32_t height and [Input] int32_t width.|
130| GET_BUFFER_GEOMETRY | Obtaining the geometry of the local window buffer.<br>Variable arguments in the function: [Output] int32_t *height and [Output] int32_t *width.|
131| GET_FORMAT | Obtaining the format of the local window buffer.<br>Variable argument in the function: [Output] int32_t *format.|
132| SET_FORMAT | Setting the format for the local window buffer.<br>Variable argument in the function: [Input] int32_t format.|
133| GET_USAGE | Obtaining the usage mode of the local window buffer.<br>Variable argument in the function: [Output] int32_t *usage.|
134| SET_USAGE | Setting the usage mode for the local window buffer.<br>Variable argument in the function: [Input] int32_t usage.|
135| SET_STRIDE | Setting the stride for the local window buffer.<br>Variable argument in the function: [Input] int32_t stride.|
136| GET_STRIDE | Obtaining the stride of the local window buffer.<br>Variable argument in the function: [Output] int32_t *stride.|
137| SET_SWAP_INTERVAL | Setting the swap interval for the local window buffer.<br>Variable argument in the function: [Input] int32_t interval.|
138| GET_SWAP_INTERVAL | Obtaining the swap interval of the local window buffer.<br>Variable argument in the function: [Output] int32_t *interval.|
139| SET_TIMEOUT | Setting the timeout duration for requesting the local window buffer.<br>Variable argument in the function: [Input] int32_t timeout.|
140| GET_TIMEOUT | Obtaining the timeout duration for requesting the local window buffer.<br>Variable argument in the function: [Output] int32_t *timeout.|
141| SET_COLOR_GAMUT | Setting the color gamut for the local window buffer.<br>Variable argument in the function: [Input] int32_t colorGamut.|
142| GET_COLOR_GAMUT | Obtaining the color gamut of the local window buffer.<br>Variable argument in the function: [Output] int32_t *colorGamut.|
143| SET_TRANSFORM | Setting the transform for the local window buffer.<br>Variable argument in the function: [Input] int32_t transform.|
144| GET_TRANSFORM | Obtaining the transform of the local window buffer.<br>Variable argument in the function: [Output] int32_t *transform.|
145| SET_UI_TIMESTAMP | Setting the UI timestamp for the local window buffer.<br>Variable argument in the function: [Input] uint64_t uiTimestamp.|
146
147
148### OHHDRMetadataKey
149
150
151```
152enum OHHDRMetadataKey
153```
154
155**Description**
156
157Enumerates the HDR metadata keys.
158
159**Since**
160
1619
162
163**Deprecated**
164
165This enum is deprecated since API version 10. No substitute enum is provided.
166
167| Value| Description|
168| -------- | -------- |
169| OH_METAKEY_RED_PRIMARY_X | X coordinate of the red primary color.|
170| OH_METAKEY_RED_PRIMARY_Y | Y coordinate of the red primary color.|
171| OH_METAKEY_GREEN_PRIMARY_X | X coordinate of the green primary color.|
172| OH_METAKEY_GREEN_PRIMARY_Y | Y coordinate of the green primary color.|
173| OH_METAKEY_BLUE_PRIMARY_X | X coordinate of the blue primary color.|
174| OH_METAKEY_BLUE_PRIMARY_Y | Y coordinate of the blue primary color.|
175| OH_METAKEY_WHITE_PRIMARY_X | X coordinate of the white point.|
176| OH_METAKEY_WHITE_PRIMARY_Y | Y coordinate of the white point.|
177| OH_METAKEY_MAX_LUMINANCE | Maximum luminance.|
178| OH_METAKEY_MIN_LUMINANCE | Minimum luminance.|
179| OH_METAKEY_MAX_CONTENT_LIGHT_LEVEL | Maximum content light level (MaxCLL).|
180| OH_METAKEY_MAX_FRAME_AVERAGE_LIGHT_LEVEL | Maximum frame average light level (MaxFALLL).|
181| OH_METAKEY_HDR10_PLUS | HDR10 Plus |
182| OH_METAKEY_HDR_VIVID | Vivid |
183
184
185### OHScalingMode
186
187
188```
189enum OHScalingMode
190```
191
192**Description**
193
194Enumerates the scaling modes.
195
196**Since**
197
1989
199
200**Deprecated**
201
202This enum is deprecated since API version 10. No substitute enum is provided.
203
204| Value| Description|
205| -------- | -------- |
206| OH_SCALING_MODE_FREEZE | The window content cannot be updated before the buffer of the window size is received.|
207| OH_SCALING_MODE_SCALE_TO_WINDOW | The buffer is scaled in two dimensions to match the window size.|
208| OH_SCALING_MODE_SCALE_CROP | The buffer is scaled uniformly so that its smaller size can match the window size.|
209| OH_SCALING_MODE_NO_SCALE_CROP | The window is cropped to the size of the buffer's cropping rectangle. Pixels outside the cropping rectangle are considered completely transparent.|
210
211
212## Function Description
213
214
215### OH_NativeWindow_CreateNativeWindow()
216
217
218```
219OHNativeWindow* OH_NativeWindow_CreateNativeWindow (void * pSurface)
220```
221
222**Description**
223
224Creates an **OHNativeWindow** instance. A new **OHNativeWindow** instance is created each time this function is called.
225
226\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
227
228**Parameters**
229
230| Name| Description|
231| -------- | -------- |
232| pSurface | Pointer to a **ProduceSurface**. The type is **sptr&lt;OHOS::Surface&gt;**.|
233
234**Returns**
235
236Returns the pointer to the **OHNativeWindow** instance created.
237
238
239### OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer()
240
241
242```
243OHNativeWindowBuffer* OH_NativeWindow_CreateNativeWindowBufferFromSurfaceBuffer (void * pSurfaceBuffer)
244```
245
246**Description**
247
248Creates an **OHNativeWindowBuffer** instance. A new **OHNativeWindowBuffer** instance is created each time this function is called.
249
250\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
251
252**Parameters**
253
254| Name| Description|
255| -------- | -------- |
256| pSurfaceBuffer | Pointer to a **ProduceSurfaceBuffer**. The type is **sptr&lt;OHOS::SurfaceBuffer&gt;**.|
257
258**Returns**
259
260Returns the pointer to the **OHNativeWindowBuffer** instance created.
261
262
263### OH_NativeWindow_DestroyNativeWindow()
264
265
266```
267void OH_NativeWindow_DestroyNativeWindow (OHNativeWindow *  window)
268```
269
270**Description**
271
272Decreases the reference count of an **OHNativeWindow** instance by 1 and when the reference count reaches 0, destroys the instance.
273
274\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
275
276**Parameters**
277
278| Name| Description|
279| -------- | -------- |
280| window | Pointer to an **OHNativeWindow** instance.|
281
282
283### OH_NativeWindow_DestroyNativeWindowBuffer()
284
285
286```
287void OH_NativeWindow_DestroyNativeWindowBuffer (OHNativeWindowBuffer *  buffer)
288```
289
290**Description**
291
292Decreases the reference count of an **OHNativeWindowBuffer** instance by 1 and when the reference count reaches 0, destroys the instance.
293
294\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
295
296**Parameters**
297
298| Name| Description|
299| -------- | -------- |
300| buffer | Pointer to an **OHNativeWindowBuffer** instance.|
301
302
303### OH_NativeWindow_GetBufferHandleFromNative()
304
305
306```
307BufferHandle* OH_NativeWindow_GetBufferHandleFromNative (OHNativeWindowBuffer *  buffer)
308```
309
310**Description**
311
312Obtains the pointer to a **BufferHandle** of an **OHNativeWindowBuffer** instance.
313
314\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
315
316**Parameters**
317
318| Name| Description|
319| -------- | -------- |
320| buffer | Pointer to an **OHNativeWindowBuffer** instance.|
321
322**Returns**
323
324Returns the pointer to the **BufferHandle** instance obtained.
325
326
327### OH_NativeWindow_GetNativeObjectMagic()
328
329
330```
331int32_t OH_NativeWindow_GetNativeObjectMagic (void * obj)
332```
333
334**Description**
335
336Obtains the magic ID of a native object.
337
338\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
339
340**Parameters**
341
342| Name| Description|
343| -------- | -------- |
344| obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
345
346**Returns**
347
348Returns the magic ID, which is unique for each native object.
349
350
351### OH_NativeWindow_NativeObjectReference()
352
353
354```
355int32_t OH_NativeWindow_NativeObjectReference (void * obj)
356```
357
358**Description**
359
360Adds the reference count of a native object.
361
362\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
363
364**Parameters**
365
366| Name| Description|
367| -------- | -------- |
368| obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
369
370**Returns**
371
372Returns **0** if the operation is successful.
373
374
375### OH_NativeWindow_NativeObjectUnreference()
376
377
378```
379int32_t OH_NativeWindow_NativeObjectUnreference (void * obj)
380```
381
382**Description**
383
384Decreases the reference count of a native object and when the reference count reaches 0, destroys this object.
385
386\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
387
388**Parameters**
389
390| Name| Description|
391| -------- | -------- |
392| obj | Pointer to an **OHNativeWindow** or **OHNativeWindowBuffer** instance.|
393
394**Returns**
395
396Returns **0** if the operation is successful.
397
398
399### OH_NativeWindow_NativeWindowAbortBuffer()
400
401
402```
403int32_t OH_NativeWindow_NativeWindowAbortBuffer (OHNativeWindow *  window, OHNativeWindowBuffer *  buffer )
404```
405
406**Description**
407
408Returns the **OHNativeWindowBuffer** to the buffer queue through an **OHNativeWindow** instance, without filling in any content. The **OHNativeWindowBuffer** can be used for a new request.
409
410\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
411
412**Parameters**
413
414| Name| Description|
415| -------- | -------- |
416| window | Pointer to an **OHNativeWindow** instance.|
417| buffer | Pointer to an **OHNativeWindowBuffer** instance.|
418
419**Returns**
420
421Returns **0** if the operation is successful.
422
423
424### OH_NativeWindow_NativeWindowFlushBuffer()
425
426
427```
428int32_t OH_NativeWindow_NativeWindowFlushBuffer (OHNativeWindow *  window, OHNativeWindowBuffer *  buffer, int fenceFd, Region region )
429```
430
431**Description**
432
433Flushes the **OHNativeWindowBuffer** filled with the content to the buffer queue through an **OHNativeWindow** instance for content consumption.
434
435\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
436
437**Parameters**
438
439| Name| Description|
440| -------- | -------- |
441| window | Pointer to an **OHNativeWindow** instance.|
442| buffer | Pointer to an **OHNativeWindowBuffer** instance.|
443| fenceFd | File descriptor handle, which is used for timing synchronization.|
444| region | Dirty region where content is updated.|
445
446**Returns**
447
448Returns **0** if the operation is successful.
449
450
451### OH_NativeWindow_NativeWindowHandleOpt()
452
453
454```
455int32_t OH_NativeWindow_NativeWindowHandleOpt (OHNativeWindow *  window, int code,  ... )
456```
457
458**Description**
459
460Sets or obtains the attributes of an **OHNativeWindow**, including the width, height, and content format.
461
462\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
463
464**Parameters**
465
466| Name| Description|
467| -------- | -------- |
468| window | Pointer to an **OHNativeWindow** instance.|
469| code | Operation code. For details, see [NativeWindowOperation](#nativewindowoperation).|
470| ... | Variable argument, which must correspond to the operation code.|
471
472**Returns**
473
474Returns **0** if the operation is successful.
475
476
477### OH_NativeWindow_NativeWindowRequestBuffer()
478
479
480```
481int32_t OH_NativeWindow_NativeWindowRequestBuffer (OHNativeWindow *  window, OHNativeWindowBuffer **  buffer, int * fenceFd )
482```
483
484**Description**
485
486Requests an **OHNativeWindowBuffer** through an **OHNativeWindow** instance for content production.
487
488\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
489
490**Parameters**
491
492| Name| Description|
493| -------- | -------- |
494| window | Pointer to an **OHNativeWindow** instance.|
495| buffer | Double pointer to an **OHNativeWindowBuffer** instance.|
496| fenceFd | Pointer to a file descriptor handle.|
497
498**Returns**
499
500Returns **0** if the operation is successful.
501
502
503### OH_NativeWindow_NativeWindowSetMetaData()
504
505
506```
507int32_t OH_NativeWindow_NativeWindowSetMetaData (OHNativeWindow *  window, uint32_t sequence, int32_t size, const OHHDRMetaData *  metaData )
508```
509
510**Description**
511
512Sets metadata for an **OHNativeWindow**.
513
514\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
515
516**Parameters**
517
518| Name| Description|
519| -------- | -------- |
520| window | Pointer to an **OHNativeWindow** instance.|
521| sequence | Sequence of the producer buffer.|
522| size | Size of the **OHHDRMetaData** array.|
523| metaData| Pointer to the **OHHDRMetaData** array.|
524
525**Returns**
526
527Returns **0** if the operation is successful.
528
529**Since**
530
5319
532
533**Deprecated**
534
535This function is deprecated since API version 10. No substitute function is provided.
536
537
538### OH_NativeWindow_NativeWindowSetMetaDataSet()
539
540
541```
542int32_t OH_NativeWindow_NativeWindowSetMetaDataSet (OHNativeWindow *  window, uint32_t sequence, OHHDRMetadataKey key, int32_t size, const uint8_t * metaData )
543```
544
545**Description**
546
547Sets a metadata set for an **OHNativeWindow**.
548
549\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
550
551**Parameters**
552
553| Name| Description|
554| -------- | -------- |
555| window | Pointer to an **OHNativeWindow** instance.|
556| sequence | Sequence of the producer buffer.|
557| key | Metadata key. For details, see [OHHDRMetadataKey](#ohhdrmetadatakey).|
558| size | Size of the uint8_t vector.|
559| metaData| Pointer to the uint8_t vector.|
560
561**Returns**
562
563Returns **0** if the operation is successful.
564
565**Since**
566
5679
568
569**Deprecated**
570
571This function is deprecated since API version 10. No substitute function is provided.
572
573
574### OH_NativeWindow_NativeWindowSetScalingMode()
575
576
577```
578int32_t OH_NativeWindow_NativeWindowSetScalingMode (OHNativeWindow *  window, uint32_t sequence, OHScalingMode scalingMode )
579```
580
581**Description**
582
583Sets a scaling mode for an **OHNativeWindow**.
584
585\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
586
587**Parameters**
588
589| Name| Description|
590| -------- | -------- |
591| window | Pointer to an **OHNativeWindow** instance.|
592| sequence | Sequence of the producer buffer.|
593| scalingMode | Scaling mode to set. For details, see [OHScalingMode](#ohscalingmode).|
594
595**Returns**
596
597Returns **0** if the operation is successful.
598
599**Since**
600
6019
602
603**Deprecated**
604
605This function is deprecated since API version 10. No substitute function is provided.
606
607
608### OH_NativeWindow_NativeWindowSetTunnelHandle()
609
610
611```
612int32_t OH_NativeWindow_NativeWindowSetTunnelHandle (OHNativeWindow *  window, const OHExtDataHandle *  handle )
613```
614
615**Description**
616
617Sets a tunnel handle to an **OHNativeWindow**.
618
619\@syscap SystemCapability.Graphic.Graphic2D.NativeWindow
620
621**Parameters**
622
623| Name| Description|
624| -------- | -------- |
625| window | Pointer to an **OHNativeWindow** instance.|
626| handle | Pointer to an [OHExtDataHandle](_o_h_ext_data_handle.md).|
627
628**Returns**
629
630Returns **0** if the operation is successful.
631
632**Since**
633
6349
635
636**Deprecated**
637
638This function is deprecated since API version 10. No substitute function is provided.
639