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