• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# BufferHandle
2
3
4## Overview
5
6The BufferHandle struct describes the buffer handle, which is used to transfer and obtain buffer information. The handle contains the file descriptor, size, format, usage, virtual address, shared memory key, physical address, and custom data of the buffer.
7
8**Since**: 8
9
10**Related module**: [NativeWindow](_native_window.md)
11
12
13## Summary
14
15
16### Member Variables
17
18| Name| Description|
19| -------- | -------- |
20| int32_t [fd](#fd) | File descriptor of the buffer. The value **-1** means that the buffer is not supported. |
21| int32_t [width](#width) | Width of the buffer memory, in pixels. |
22| int32_t [stride](#stride) | Stride of the buffer memory, in bytes. |
23| int32_t [height](#height) | Height of the buffer memory, in pixels. |
24| int32_t [size](#size) | Size of the buffer memory, in bytes. |
25| int32_t [format](#format) | Format of the buffer memory. For details about available options, see [OH_NativeBuffer_Format](_o_h___native_buffer.md#oh_nativebuffer_format-1). |
26| uint64_t [usage](#usage) | Usage of the buffer memory, represented as bit flags. For details about available options, see [OH_NativeBuffer_Usage](_o_h___native_buffer.md#oh_nativebuffer_usage-1). |
27| void \* [virAddr](#viraddr) | Virtual address of the buffer memory. |
28| int32_t [key](#key) | Shared memory key of the buffer memory. |
29| uint64_t [phyAddr](#phyaddr) | Physical address of the buffer memory. |
30| uint32_t [reserveFds](#reservefds) | Number of file descriptors for extra data. |
31| uint32_t [reserveInts](#reserveints) | Number of integer values for extra data. |
32| int32_t [reserve](#reserve) [0] | Extra data. |
33
34
35## Member Variable Description
36
37
38### fd
39
40```
41int32_t BufferHandle::fd
42```
43
44**Description**
45
46File descriptor of the buffer. The value **-1** means that the buffer is not supported.
47
48
49### format
50
51```
52int32_t BufferHandle::format
53```
54
55**Description**
56
57Format of the buffer memory. For details about available options, see [OH_NativeBuffer_Format](_o_h___native_buffer.md#oh_nativebuffer_format-1).
58
59
60### height
61
62```
63int32_t BufferHandle::height
64```
65
66**Description**
67
68Height of the buffer memory, in pixels.
69
70
71### key
72
73```
74int32_t BufferHandle::key
75```
76
77**Description**
78
79Shared memory key of the buffer memory.
80
81
82### phyAddr
83
84```
85uint64_t BufferHandle::phyAddr
86```
87
88**Description**
89
90Physical address of the buffer memory.
91
92
93### reserve
94
95```
96int32_t BufferHandle::reserve[0]
97```
98
99**Description**
100
101Extra data.
102
103
104### reserveFds
105
106```
107uint32_t BufferHandle::reserveFds
108```
109
110**Description**
111
112Number of file descriptors for extra data.
113
114
115### reserveInts
116
117```
118uint32_t BufferHandle::reserveInts
119```
120
121**Description**
122
123Number of integer values for extra data.
124
125
126### size
127
128```
129int32_t BufferHandle::size
130```
131
132**Description**
133
134Size of the buffer memory, in bytes.
135
136
137### stride
138
139```
140int32_t BufferHandle::stride
141```
142
143**Description**
144
145Stride of the buffer memory, in bytes.
146
147
148### usage
149
150```
151uint64_t BufferHandle::usage
152```
153
154**Description**
155
156Usage of the buffer memory, represented as bit flags. For details about available options, see [OH_NativeBuffer_Usage](_o_h___native_buffer.md#oh_nativebuffer_usage-1).
157
158
159### virAddr
160
161```
162void* BufferHandle::virAddr
163```
164
165**Description**
166
167Virtual address of the buffer memory.
168
169
170### width
171
172```
173int32_t BufferHandle::width
174```
175
176**Description**
177
178Width of the buffer memory, in pixels.
179