/
GstAllocators-1.0.d.ts
321 lines (254 loc) · 9.66 KB
/
GstAllocators-1.0.d.ts
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
// @ts-nocheck
/*
* Type Definitions for node-gtk (https://github.com/romgrk/node-gtk)
*
* These type definitions are automatically generated, do not edit them by hand.
* If you found a bug fix it in ts-for-gir itself or create a bug report on https://github.com/sammydre/ts-for-gjs
*/
/**
* GstAllocators-1.0
*/
import type Gst from './Gst-1.0';
import type GObject from './GObject-2.0';
import type GLib from './GLib-2.0';
import type GModule from './GModule-2.0';
export namespace GstAllocators {
/**
* Various flags to control the operation of the fd backed memory.
* @bitfield
*/
enum FdMemoryFlags {
/**
* no flag
*/
NONE,
/**
* once the memory is mapped,
* keep it mapped until the memory is destroyed.
*/
KEEP_MAPPED,
/**
* do a private mapping instead of
* the default shared mapping.
*/
MAP_PRIVATE,
/**
* don't close the file descriptor when
* the memory is freed. Since: 1.10
*/
DONT_CLOSE,
}
const ALLOCATOR_DMABUF: string
const ALLOCATOR_FD: string
/**
* Constant that defines the caps feature name for DMA buffer sharing.
*
* It has to be used for non-mappable dma-buf only, i.e. when the underlying
* memory is not mappable to user space. Or when the mapped memory contains
* non meaningful data. It can be the case for protected content or when the
* user wants explicitly avoid any software post processing.
*
* In these cases all elements between the exported and the importer has to work
* in passthrough mode. This is done by adding this caps feature.
*
* When the memory is mappable for read and write requests then it is assumes
* to be a fast path and so this caps feature should not be used. Though
* according to the dma-buf protocol, while it is mapped it prevents the
* exporter to migrate the buffer.
*
* This caps feature should not serve at all the purpose of selecting the
* `GST_ALLOCATOR_DMABUF` allocator during caps negotiation.
* When the exporter is the upstream element from the importer point of view,
* the exporter should try to map the dma buffer at runtime (preferably during
* decide_allocation phase). When it succeeds for #GST_MAP_READWRITE this caps
* feature should not be used. This allows scalers, color converts and any image
* processing filters to work directly on the dma buffer.
* In this case the importer element should check all incoming memory using
* gst_is_dmabuf_memory().
*/
const CAPS_FEATURE_MEMORY_DMABUF: string
/**
* Return the file descriptor associated with `mem`.
* @param mem the memory to get the file descriptor
*/
function dmabufMemoryGetFd(mem: Gst.Memory): number
/**
* Get the fd from `mem`. Call gst_is_fd_memory() to check if `mem` has
* an fd.
* @param mem #GstMemory
*/
function fdMemoryGetFd(mem: Gst.Memory): number
/**
* Check if `mem` is dmabuf memory.
* @param mem the memory to be check
*/
function isDmabufMemory(mem: Gst.Memory): boolean
/**
* Check if `mem` is memory backed by an fd
* @param mem #GstMemory
*/
function isFdMemory(mem: Gst.Memory): boolean
function isPhysMemory(mem: Gst.Memory): boolean
function physMemoryGetPhysAddr(mem: Gst.Memory): number
interface PhysMemoryAllocator_ConstructProps extends Gst.Allocator_ConstructProps, GObject.Object_ConstructProps {
}
interface PhysMemoryAllocator extends Gst.Allocator {
// Conflicting properties
object: any
// Conflicting methods
ref(...args: any[]): any
// Class property signals of GstAllocators-1.0.GstAllocators.PhysMemoryAllocator
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
class PhysMemoryAllocator extends GObject.Object {
// Own properties of GstAllocators-1.0.GstAllocators.PhysMemoryAllocator
static name: string
static $gtype: GObject.GType<PhysMemoryAllocator>
// Constructors of GstAllocators-1.0.GstAllocators.PhysMemoryAllocator
constructor(config?: PhysMemoryAllocator_ConstructProps)
_init(config?: PhysMemoryAllocator_ConstructProps): void
}
interface DmaBufAllocator_ConstructProps extends FdAllocator_ConstructProps {
}
interface DmaBufAllocator {
// Conflicting properties
object: any
// Own fields of GstAllocators-1.0.GstAllocators.DmaBufAllocator
parent: FdAllocator
// Conflicting methods
ref(...args: any[]): any
// Class property signals of GstAllocators-1.0.GstAllocators.DmaBufAllocator
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
/**
* Base class for allocators with dmabuf-backed memory
* @class
*/
class DmaBufAllocator extends FdAllocator {
// Own properties of GstAllocators-1.0.GstAllocators.DmaBufAllocator
static name: string
static $gtype: GObject.GType<DmaBufAllocator>
// Constructors of GstAllocators-1.0.GstAllocators.DmaBufAllocator
constructor(config?: DmaBufAllocator_ConstructProps)
/**
* Return a new dmabuf allocator.
* @constructor
*/
constructor()
/**
* Return a new dmabuf allocator.
* @constructor
*/
static new(): DmaBufAllocator
_init(config?: DmaBufAllocator_ConstructProps): void
/**
* Return a %GstMemory that wraps a dmabuf file descriptor.
* @param allocator allocator to be used for this memory
* @param fd dmabuf file descriptor
* @param size memory size
*/
static alloc(allocator: Gst.Allocator, fd?: number, size?: number): Gst.Memory
// Overloads of alloc
/**
* Return a %GstMemory that wraps a generic file descriptor.
* @param allocator allocator to be used for this memory
* @param fd file descriptor
* @param size memory size
* @param flags extra #GstFdMemoryFlags
*/
static alloc(allocator: Gst.Allocator, fd?: number, size?: number, flags?: FdMemoryFlags): Gst.Memory
static alloc(...args: any[]): any
static alloc(args_or_allocator: any[] | Gst.Allocator, fd?: number, size?: number, flags?: FdMemoryFlags): Gst.Memory | any
/**
* Return a %GstMemory that wraps a dmabuf file descriptor.
* @param allocator allocator to be used for this memory
* @param fd dmabuf file descriptor
* @param size memory size
* @param flags extra #GstFdMemoryFlags
*/
static allocWithFlags(allocator: Gst.Allocator, fd: number, size: number, flags: FdMemoryFlags): Gst.Memory
}
interface FdAllocator_ConstructProps extends Gst.Allocator_ConstructProps {
}
interface FdAllocator {
// Conflicting properties
object: any
// Own fields of GstAllocators-1.0.GstAllocators.FdAllocator
parent: Gst.Allocator
// Conflicting methods
ref(...args: any[]): any
// Class property signals of GstAllocators-1.0.GstAllocators.FdAllocator
connect(sigName: string, callback: (...args: any[]) => void): number
on(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
once(sigName: string, callback: (...args: any[]) => void, after?: boolean): NodeJS.EventEmitter
off(sigName: string, callback: (...args: any[]) => void): NodeJS.EventEmitter
emit(sigName: string, ...args: any[]): void
}
/**
* Base class for allocators with fd-backed memory
* @class
*/
class FdAllocator extends Gst.Allocator {
// Own properties of GstAllocators-1.0.GstAllocators.FdAllocator
static name: string
static $gtype: GObject.GType<FdAllocator>
// Constructors of GstAllocators-1.0.GstAllocators.FdAllocator
constructor(config?: FdAllocator_ConstructProps)
/**
* Return a new fd allocator.
* @constructor
*/
constructor()
/**
* Return a new fd allocator.
* @constructor
*/
static new(): FdAllocator
_init(config?: FdAllocator_ConstructProps): void
/**
* Return a %GstMemory that wraps a generic file descriptor.
* @param allocator allocator to be used for this memory
* @param fd file descriptor
* @param size memory size
* @param flags extra #GstFdMemoryFlags
*/
static alloc(allocator: Gst.Allocator, fd?: number, size?: number, flags?: FdMemoryFlags): Gst.Memory
}
interface DmaBufAllocatorClass {
// Own fields of GstAllocators-1.0.GstAllocators.DmaBufAllocatorClass
parentClass: FdAllocatorClass
}
abstract class DmaBufAllocatorClass {
// Own properties of GstAllocators-1.0.GstAllocators.DmaBufAllocatorClass
static name: string
}
interface FdAllocatorClass {
// Own fields of GstAllocators-1.0.GstAllocators.FdAllocatorClass
parentClass: Gst.AllocatorClass
}
abstract class FdAllocatorClass {
// Own properties of GstAllocators-1.0.GstAllocators.FdAllocatorClass
static name: string
}
interface PhysMemoryAllocatorInterface {
// Own fields of GstAllocators-1.0.GstAllocators.PhysMemoryAllocatorInterface
getPhysAddr: (allocator: PhysMemoryAllocator, mem: Gst.Memory) => number
}
/**
* Marker interface for allocators with physical address backed memory
* @record
*/
abstract class PhysMemoryAllocatorInterface {
// Own properties of GstAllocators-1.0.GstAllocators.PhysMemoryAllocatorInterface
static name: string
}
}
export default GstAllocators;