/
qabstractvideobuffer.go
371 lines (291 loc) · 12.1 KB
/
qabstractvideobuffer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
package qtmultimedia
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h
// #include <qabstractvideobuffer.h>
// #include <QtMultimedia>
// header block end
// main block begin
// main block end
// use block begin
// use block end
// ext block begin
/*
#include <stdlib.h>
// extern C begin: 45
*/
// import "C"
import "unsafe"
import "reflect"
import "fmt"
import "log"
import "github.com/kitech/qt.go/qtrt"
import "github.com/kitech/qt.go/qtcore"
import "github.com/kitech/qt.go/qtgui"
import "github.com/kitech/qt.go/qtnetwork"
// ext block end
// body block begin
/*
*/
type QAbstractVideoBuffer struct {
*qtrt.CObject
}
type QAbstractVideoBuffer_ITF interface {
QAbstractVideoBuffer_PTR() *QAbstractVideoBuffer
}
func (ptr *QAbstractVideoBuffer) QAbstractVideoBuffer_PTR() *QAbstractVideoBuffer { return ptr }
func (this *QAbstractVideoBuffer) GetCthis() unsafe.Pointer {
if this == nil {
return nil
} else {
return this.Cthis
}
}
func (this *QAbstractVideoBuffer) SetCthis(cthis unsafe.Pointer) {
if this.CObject == nil {
this.CObject = &qtrt.CObject{cthis}
} else {
this.CObject.Cthis = cthis
}
}
func NewQAbstractVideoBufferFromPointer(cthis unsafe.Pointer) *QAbstractVideoBuffer {
return &QAbstractVideoBuffer{&qtrt.CObject{cthis}}
}
func (*QAbstractVideoBuffer) NewFromPointer(cthis unsafe.Pointer) *QAbstractVideoBuffer {
return NewQAbstractVideoBufferFromPointer(cthis)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:78
// index:0
// Public Visibility=Default Availability=Available
// [-2] void QAbstractVideoBuffer(QAbstractVideoBuffer::HandleType)
/*
Constructs an abstract video buffer of the given type.
*/
func (*QAbstractVideoBuffer) NewForInherit(type_ int) *QAbstractVideoBuffer {
return NewQAbstractVideoBuffer(type_)
}
func NewQAbstractVideoBuffer(type_ int) *QAbstractVideoBuffer {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBufferC2ENS_10HandleTypeE", qtrt.FFI_TYPE_POINTER, type_)
qtrt.ErrPrint(err, rv)
gothis := NewQAbstractVideoBufferFromPointer(unsafe.Pointer(uintptr(rv)))
qtrt.SetFinalizer(gothis, DeleteQAbstractVideoBuffer)
return gothis
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:79
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void ~QAbstractVideoBuffer()
/*
*/
func DeleteQAbstractVideoBuffer(this *QAbstractVideoBuffer) {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBufferD2Ev", qtrt.FFI_TYPE_VOID, this.GetCthis())
qtrt.Cmemset(this.GetCthis(), 9, 24)
qtrt.ErrPrint(err, rv)
this.SetCthis(nil)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:80
// index:0
// Public virtual Visibility=Default Availability=Available
// [-2] void release()
/*
Releases the video buffer.
QVideoFrame calls QAbstractVideoBuffer::release when the buffer is not used any more and can be destroyed or returned to the buffer pool.
The default implementation deletes the buffer instance.
*/
func (this *QAbstractVideoBuffer) Release() {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBuffer7releaseEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:82
// index:0
// Public Visibility=Default Availability=Available
// [4] QAbstractVideoBuffer::HandleType handleType() const
/*
Returns the type of a video buffer's handle.
See also handle().
*/
func (this *QAbstractVideoBuffer) HandleType() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK20QAbstractVideoBuffer10handleTypeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:84
// index:0
// Public purevirtual virtual Visibility=Default Availability=Available
// [4] QAbstractVideoBuffer::MapMode mapMode() const
/*
Returns the mode a video buffer is mapped in.
See also map().
*/
func (this *QAbstractVideoBuffer) MapMode() int {
rv, err := qtrt.InvokeQtFunc6("_ZNK20QAbstractVideoBuffer7mapModeEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
return int(rv)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:86
// index:0
// Public purevirtual virtual Visibility=Default Availability=Available
// [8] uchar * map(QAbstractVideoBuffer::MapMode, int *, int *)
/*
Maps the contents of a video buffer to memory.
In some cases the video buffer might be stored in video memory or otherwise inaccessible memory, so it is necessary to map the buffer before accessing the pixel data. This may involve copying the contents around, so avoid mapping and unmapping unless required.
The map mode indicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the mapped memory will be populated with the content of the buffer when initially mapped. If the map mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the possibly modified mapped memory will be written back to the buffer when unmapped.
When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory and possibly update the buffer contents.
Returns a pointer to the mapped memory region, or a null pointer if the mapping failed. The size in bytes of the mapped memory region is returned in numBytes, and the line stride in bytesPerLine.
Note: Writing to memory that is mapped as read-only is undefined, and may result in changes to shared data or crashes.
See also unmap() and mapMode().
*/
func (this *QAbstractVideoBuffer) Map(mode int, numBytes unsafe.Pointer /*666*/, bytesPerLine unsafe.Pointer /*666*/) unsafe.Pointer /*666*/ {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBuffer3mapENS_7MapModeEPiS1_", qtrt.FFI_TYPE_POINTER, this.GetCthis(), mode, numBytes, bytesPerLine)
qtrt.ErrPrint(err, rv)
return unsafe.Pointer(uintptr(rv))
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:87
// index:0
// Public Visibility=Default Availability=Available
// [4] int mapPlanes(QAbstractVideoBuffer::MapMode, int *, int *, uchar **)
/*
Independently maps the planes of a video buffer to memory.
The map mode indicates whether the contents of the mapped memory should be read from and/or written to the buffer. If the map mode includes the QAbstractVideoBuffer::ReadOnly flag the mapped memory will be populated with the content of the buffer when initially mapped. If the map mode includes the QAbstractVideoBuffer::WriteOnly flag the content of the possibly modified mapped memory will be written back to the buffer when unmapped.
When access to the data is no longer needed be sure to call the unmap() function to release the mapped memory and possibly update the buffer contents.
Returns the number of planes in the mapped video data. For each plane the line stride of that plane will be returned in bytesPerLine, and a pointer to the plane data will be returned in data. The accumulative size of the mapped data is returned in numBytes.
Not all buffer implementations will map more than the first plane, if this returns a single plane for a planar format the additional planes will have to be calculated from the line stride of the first plane and the frame height. Mapping a buffer with QVideoFrame will do this for you.
To implement this function create a derivative of QAbstractPlanarVideoBuffer and implement its map function instance instead.
This function was introduced in Qt 5.4.
*/
func (this *QAbstractVideoBuffer) MapPlanes(mode int, numBytes unsafe.Pointer /*666*/, bytesPerLine unsafe.Pointer, data unsafe.Pointer) int {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBuffer9mapPlanesENS_7MapModeEPiS1_PPh", qtrt.FFI_TYPE_POINTER, this.GetCthis(), mode, numBytes, bytesPerLine, data)
qtrt.ErrPrint(err, rv)
return qtrt.Cretval2go("int", rv).(int) // 1111
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:88
// index:0
// Public purevirtual virtual Visibility=Default Availability=Available
// [-2] void unmap()
/*
Releases the memory mapped by the map() function.
If the MapMode included the QAbstractVideoBuffer::WriteOnly flag this will write the current content of the mapped memory back to the video frame.
See also map().
*/
func (this *QAbstractVideoBuffer) Unmap() {
rv, err := qtrt.InvokeQtFunc6("_ZN20QAbstractVideoBuffer5unmapEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
}
// /usr/include/qt/QtMultimedia/qabstractvideobuffer.h:90
// index:0
// Public virtual Visibility=Default Availability=Available
// [16] QVariant handle() const
/*
Returns a type specific handle to the data buffer.
The type of the handle is given by handleType() function.
See also handleType().
*/
func (this *QAbstractVideoBuffer) Handle() *qtcore.QVariant /*123*/ {
rv, err := qtrt.InvokeQtFunc6("_ZNK20QAbstractVideoBuffer6handleEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
qtrt.ErrPrint(err, rv)
rv2 := qtcore.NewQVariantFromPointer(unsafe.Pointer(uintptr(rv))) // 333
qtrt.SetFinalizer(rv2, qtcore.DeleteQVariant)
return rv2
}
/*
Identifies the type of a video buffers handle.
See also handleType().
*/
type QAbstractVideoBuffer__HandleType = int
// The buffer has no handle, its data can only be accessed by mapping the buffer.
const QAbstractVideoBuffer__NoHandle QAbstractVideoBuffer__HandleType = 0
// The handle of the buffer is an OpenGL texture ID.
const QAbstractVideoBuffer__GLTextureHandle QAbstractVideoBuffer__HandleType = 1
// The handle contains pointer to shared memory XVideo image.
const QAbstractVideoBuffer__XvShmImageHandle QAbstractVideoBuffer__HandleType = 2
// The handle contains pointer to macOS CIImage.
const QAbstractVideoBuffer__CoreImageHandle QAbstractVideoBuffer__HandleType = 3
// The handle of the buffer is a QPixmap.
const QAbstractVideoBuffer__QPixmapHandle QAbstractVideoBuffer__HandleType = 4
// The handle of the buffer is an EGLImageKHR.
const QAbstractVideoBuffer__EGLImageHandle QAbstractVideoBuffer__HandleType = 5
//
const QAbstractVideoBuffer__UserHandle QAbstractVideoBuffer__HandleType = 1000
func (this *QAbstractVideoBuffer) HandleTypeItemName(val int) string {
switch val {
case QAbstractVideoBuffer__NoHandle: // 0
return "NoHandle"
case QAbstractVideoBuffer__GLTextureHandle: // 1
return "GLTextureHandle"
case QAbstractVideoBuffer__XvShmImageHandle: // 2
return "XvShmImageHandle"
case QAbstractVideoBuffer__CoreImageHandle: // 3
return "CoreImageHandle"
case QAbstractVideoBuffer__QPixmapHandle: // 4
return "QPixmapHandle"
case QAbstractVideoBuffer__EGLImageHandle: // 5
return "EGLImageHandle"
case QAbstractVideoBuffer__UserHandle: // 1000
return "UserHandle"
default:
return fmt.Sprintf("%d", val)
}
}
func QAbstractVideoBuffer_HandleTypeItemName(val int) string {
var nilthis *QAbstractVideoBuffer
return nilthis.HandleTypeItemName(val)
}
/*
Enumerates how a video buffer's data is mapped to system memory.
QAbstractVideoBuffer::ReadWriteReadOnly | WriteOnlyThe mapped memory is populated with data from the video buffer, and the video buffer is repopulated with the content of the mapped memory when it is unmapped.
See also mapMode() and map().
*/
type QAbstractVideoBuffer__MapMode = int
//
const QAbstractVideoBuffer__NotMapped QAbstractVideoBuffer__MapMode = 0
//
const QAbstractVideoBuffer__ReadOnly QAbstractVideoBuffer__MapMode = 1
//
const QAbstractVideoBuffer__WriteOnly QAbstractVideoBuffer__MapMode = 2
//
const QAbstractVideoBuffer__ReadWrite QAbstractVideoBuffer__MapMode = 3
func (this *QAbstractVideoBuffer) MapModeItemName(val int) string {
switch val {
case QAbstractVideoBuffer__NotMapped: // 0
return "NotMapped"
case QAbstractVideoBuffer__ReadOnly: // 1
return "ReadOnly"
case QAbstractVideoBuffer__WriteOnly: // 2
return "WriteOnly"
case QAbstractVideoBuffer__ReadWrite: // 3
return "ReadWrite"
default:
return fmt.Sprintf("%d", val)
}
}
func QAbstractVideoBuffer_MapModeItemName(val int) string {
var nilthis *QAbstractVideoBuffer
return nilthis.MapModeItemName(val)
}
// body block end
// keep block begin
func init_unused_11733() {
if false {
reflect.TypeOf(123)
}
if false {
reflect.TypeOf(unsafe.Sizeof(0))
}
if false {
fmt.Println(123)
}
if false {
log.Println(123)
}
if false {
qtrt.KeepMe()
}
if false {
qtcore.KeepMe()
}
if false {
qtgui.KeepMe()
}
if false {
qtnetwork.KeepMe()
}
}
// keep block end