1#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
7#![allow(
8 clippy::approx_constant,
9 clippy::type_complexity,
10 clippy::unreadable_literal,
11 clippy::upper_case_acronyms
12)]
13#![cfg_attr(docsrs, feature(doc_cfg))]
14
15use glib_sys as glib;
16use gstreamer_sys as gst;
17use gstreamer_video_sys as gst_video;
18
19#[allow(unused_imports)]
20use libc::{FILE, intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t};
21#[cfg(unix)]
22#[allow(unused_imports)]
23use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t};
24#[allow(unused_imports)]
25use std::ffi::{
26 c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void,
27};
28
29#[allow(unused_imports)]
30use glib::{GType, gboolean, gconstpointer, gpointer};
31
32pub type GstD3D12AllocationFlags = c_int;
34pub const GST_D3D12_ALLOCATION_FLAG_DEFAULT: GstD3D12AllocationFlags = 0;
35
36pub type GstD3D12ConverterAlphaMode = c_int;
37pub const GST_D3D12_CONVERTER_ALPHA_MODE_UNSPECIFIED: GstD3D12ConverterAlphaMode = 0;
38pub const GST_D3D12_CONVERTER_ALPHA_MODE_PREMULTIPLIED: GstD3D12ConverterAlphaMode = 1;
39pub const GST_D3D12_CONVERTER_ALPHA_MODE_STRAIGHT: GstD3D12ConverterAlphaMode = 2;
40
41pub type GstD3D12ConverterColorBalance = c_int;
42pub const GST_D3D12_CONVERTER_COLOR_BALANCE_DISABLED: GstD3D12ConverterColorBalance = 0;
43pub const GST_D3D12_CONVERTER_COLOR_BALANCE_ENABLED: GstD3D12ConverterColorBalance = 1;
44
45pub type GstD3D12ConverterMipGen = c_int;
46pub const GST_D3D12_CONVERTER_MIP_GEN_DISABLED: GstD3D12ConverterMipGen = 0;
47pub const GST_D3D12_CONVERTER_MIP_GEN_ENABLED: GstD3D12ConverterMipGen = 1;
48
49pub type GstD3D12ConverterSamplerFilter = c_int;
50pub const D3D12_FILTER_MIN_MAG_MIP_POINT: GstD3D12ConverterSamplerFilter = 0;
51pub const D3D12_FILTER_MIN_LINEAR_MAG_MIP_POINT: GstD3D12ConverterSamplerFilter = 16;
52pub const D3D12_FILTER_MIN_MAG_LINEAR_MIP_POINT: GstD3D12ConverterSamplerFilter = 20;
53pub const D3D12_FILTER_MIN_MAG_MIP_LINEAR: GstD3D12ConverterSamplerFilter = 21;
54pub const D3D12_FILTER_ANISOTROPIC: GstD3D12ConverterSamplerFilter = 85;
55
56pub const GST_CAPS_FEATURE_MEMORY_D3D12_MEMORY: &[u8] = b"memory:D3D12Memory\0";
58pub const GST_D3D12_CONVERTER_OPT_COLOR_BALANCE: &[u8] = b"GstD3D12Converter.color-balance\0";
59pub const GST_D3D12_CONVERTER_OPT_DEST_ALPHA_MODE: &[u8] = b"GstD3D12Converter.dest-alpha-mode\0";
60pub const GST_D3D12_CONVERTER_OPT_GAMMA_MODE: &[u8] = b"GstD3D12Converter.gamma-mode\0";
61pub const GST_D3D12_CONVERTER_OPT_MIP_GEN: &[u8] = b"GstD3D12Converter.mip-gen\0";
62pub const GST_D3D12_CONVERTER_OPT_PRIMARIES_MODE: &[u8] = b"GstD3D12Converter.primaries-mode\0";
63pub const GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_COUNT: &[u8] =
64 b"GstD3D12Converter.pso-sample-desc-count\0";
65pub const GST_D3D12_CONVERTER_OPT_PSO_SAMPLE_DESC_QUALITY: &[u8] =
66 b"GstD3D12Converter.pso-sample-desc-quality\0";
67pub const GST_D3D12_CONVERTER_OPT_SAMPLER_FILTER: &[u8] = b"GstD3D12Converter.sampler-filter\0";
68pub const GST_D3D12_CONVERTER_OPT_SRC_ALPHA_MODE: &[u8] = b"GstD3D12Converter.src-alpha-mode\0";
69pub const GST_D3D12_DEVICE_HANDLE_CONTEXT_TYPE: &[u8] = b"gst.d3d12.device.handle\0";
70pub const GST_D3D12_MEMORY_NAME: &[u8] = b"D3D12Memory\0";
71pub const GST_MAP_D3D12: gst::GstMapFlags = 131072;
72pub const GST_MAP_READ_D3D12: gst::GstMapFlags = 131073;
73pub const GST_MAP_WRITE_D3D12: gst::GstMapFlags = 131074;
74
75pub type GstD3D12FormatFlags = c_uint;
77pub const GST_D3D12_FORMAT_FLAG_NONE: GstD3D12FormatFlags = 0;
78pub const GST_D3D12_FORMAT_FLAG_OUTPUT_UAV: GstD3D12FormatFlags = 1;
79
80pub type GstD3D12FrameMapFlags = c_uint;
81pub const GST_D3D12_FRAME_MAP_FLAG_NONE: GstD3D12FrameMapFlags = 0;
82pub const GST_D3D12_FRAME_MAP_FLAG_SRV: GstD3D12FrameMapFlags = 1;
83pub const GST_D3D12_FRAME_MAP_FLAG_UAV: GstD3D12FrameMapFlags = 2;
84pub const GST_D3D12_FRAME_MAP_FLAG_RTV: GstD3D12FrameMapFlags = 4;
85
86pub type GstD3D12MemoryTransfer = c_uint;
87pub const GST_D3D12_MEMORY_TRANSFER_NEED_DOWNLOAD: GstD3D12MemoryTransfer = 1048576;
88pub const GST_D3D12_MEMORY_TRANSFER_NEED_UPLOAD: GstD3D12MemoryTransfer = 2097152;
89
90#[repr(C)]
92#[allow(dead_code)]
93pub struct GstD3D12AllocationParams {
94 _data: [u8; 0],
95 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
96}
97
98impl ::std::fmt::Debug for GstD3D12AllocationParams {
99 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
100 f.debug_struct(&format!("GstD3D12AllocationParams @ {self:p}"))
101 .finish()
102 }
103}
104
105#[derive(Copy, Clone)]
106#[repr(C)]
107pub struct GstD3D12AllocatorClass {
108 pub allocator_class: gst::GstAllocatorClass,
109 pub set_actvie: Option<unsafe extern "C" fn(*mut GstD3D12Allocator, gboolean) -> gboolean>,
110 pub _gst_reserved: [gpointer; 20],
111}
112
113impl ::std::fmt::Debug for GstD3D12AllocatorClass {
114 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
115 f.debug_struct(&format!("GstD3D12AllocatorClass @ {self:p}"))
116 .field("allocator_class", &self.allocator_class)
117 .field("set_actvie", &self.set_actvie)
118 .finish()
119 }
120}
121
122#[repr(C)]
123#[allow(dead_code)]
124pub struct _GstD3D12AllocatorPrivate {
125 _data: [u8; 0],
126 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
127}
128
129pub type GstD3D12AllocatorPrivate = _GstD3D12AllocatorPrivate;
130
131#[derive(Copy, Clone)]
132#[repr(C)]
133pub struct GstD3D12BufferPoolClass {
134 pub parent_class: gst::GstBufferPoolClass,
135}
136
137impl ::std::fmt::Debug for GstD3D12BufferPoolClass {
138 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
139 f.debug_struct(&format!("GstD3D12BufferPoolClass @ {self:p}"))
140 .field("parent_class", &self.parent_class)
141 .finish()
142 }
143}
144
145#[repr(C)]
146#[allow(dead_code)]
147pub struct _GstD3D12BufferPoolPrivate {
148 _data: [u8; 0],
149 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
150}
151
152pub type GstD3D12BufferPoolPrivate = _GstD3D12BufferPoolPrivate;
153
154#[repr(C)]
155#[allow(dead_code)]
156pub struct GstD3D12CmdAlloc {
157 _data: [u8; 0],
158 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
159}
160
161impl ::std::fmt::Debug for GstD3D12CmdAlloc {
162 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
163 f.debug_struct(&format!("GstD3D12CmdAlloc @ {self:p}"))
164 .finish()
165 }
166}
167
168#[derive(Copy, Clone)]
169#[repr(C)]
170pub struct GstD3D12CmdAllocPoolClass {
171 pub parent_class: gst::GstObjectClass,
172 pub _gst_reserved: [gpointer; 4],
173}
174
175impl ::std::fmt::Debug for GstD3D12CmdAllocPoolClass {
176 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
177 f.debug_struct(&format!("GstD3D12CmdAllocPoolClass @ {self:p}"))
178 .field("parent_class", &self.parent_class)
179 .finish()
180 }
181}
182
183#[repr(C)]
184#[allow(dead_code)]
185pub struct _GstD3D12CmdAllocPoolPrivate {
186 _data: [u8; 0],
187 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
188}
189
190pub type GstD3D12CmdAllocPoolPrivate = _GstD3D12CmdAllocPoolPrivate;
191
192#[derive(Copy, Clone)]
193#[repr(C)]
194pub struct GstD3D12CmdQueueClass {
195 pub parent_class: gst::GstObjectClass,
196 pub _gst_reserved: [gpointer; 4],
197}
198
199impl ::std::fmt::Debug for GstD3D12CmdQueueClass {
200 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
201 f.debug_struct(&format!("GstD3D12CmdQueueClass @ {self:p}"))
202 .field("parent_class", &self.parent_class)
203 .finish()
204 }
205}
206
207#[repr(C)]
208#[allow(dead_code)]
209pub struct _GstD3D12CmdQueuePrivate {
210 _data: [u8; 0],
211 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
212}
213
214pub type GstD3D12CmdQueuePrivate = _GstD3D12CmdQueuePrivate;
215
216#[derive(Copy, Clone)]
217#[repr(C)]
218pub struct GstD3D12ConverterClass {
219 pub parent_class: gst::GstObjectClass,
220 pub _gst_reserved: [gpointer; 4],
221}
222
223impl ::std::fmt::Debug for GstD3D12ConverterClass {
224 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
225 f.debug_struct(&format!("GstD3D12ConverterClass @ {self:p}"))
226 .field("parent_class", &self.parent_class)
227 .finish()
228 }
229}
230
231#[repr(C)]
232#[allow(dead_code)]
233pub struct _GstD3D12ConverterPrivate {
234 _data: [u8; 0],
235 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
236}
237
238pub type GstD3D12ConverterPrivate = _GstD3D12ConverterPrivate;
239
240#[repr(C)]
241#[allow(dead_code)]
242pub struct GstD3D12DescHeap {
243 _data: [u8; 0],
244 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
245}
246
247impl ::std::fmt::Debug for GstD3D12DescHeap {
248 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
249 f.debug_struct(&format!("GstD3D12DescHeap @ {self:p}"))
250 .finish()
251 }
252}
253
254#[derive(Copy, Clone)]
255#[repr(C)]
256pub struct GstD3D12DescHeapPoolClass {
257 pub parent_class: gst::GstObjectClass,
258 pub _gst_reserved: [gpointer; 4],
259}
260
261impl ::std::fmt::Debug for GstD3D12DescHeapPoolClass {
262 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
263 f.debug_struct(&format!("GstD3D12DescHeapPoolClass @ {self:p}"))
264 .field("parent_class", &self.parent_class)
265 .finish()
266 }
267}
268
269#[repr(C)]
270#[allow(dead_code)]
271pub struct _GstD3D12DescHeapPoolPrivate {
272 _data: [u8; 0],
273 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
274}
275
276pub type GstD3D12DescHeapPoolPrivate = _GstD3D12DescHeapPoolPrivate;
277
278#[derive(Copy, Clone)]
279#[repr(C)]
280pub struct GstD3D12DeviceClass {
281 pub parent_class: gst::GstObjectClass,
282 pub _gst_reserved: [gpointer; 4],
283}
284
285impl ::std::fmt::Debug for GstD3D12DeviceClass {
286 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
287 f.debug_struct(&format!("GstD3D12DeviceClass @ {self:p}"))
288 .field("parent_class", &self.parent_class)
289 .finish()
290 }
291}
292
293#[repr(C)]
294#[allow(dead_code)]
295pub struct _GstD3D12DevicePrivate {
296 _data: [u8; 0],
297 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
298}
299
300pub type GstD3D12DevicePrivate = _GstD3D12DevicePrivate;
301
302#[repr(C)]
303#[allow(dead_code)]
304pub struct GstD3D12FenceData {
305 _data: [u8; 0],
306 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
307}
308
309impl ::std::fmt::Debug for GstD3D12FenceData {
310 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
311 f.debug_struct(&format!("GstD3D12FenceData @ {self:p}"))
312 .finish()
313 }
314}
315
316#[derive(Copy, Clone)]
317#[repr(C)]
318pub struct GstD3D12FenceDataPoolClass {
319 pub parent_class: gst::GstObjectClass,
320 pub _gst_reserved: [gpointer; 4],
321}
322
323impl ::std::fmt::Debug for GstD3D12FenceDataPoolClass {
324 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
325 f.debug_struct(&format!("GstD3D12FenceDataPoolClass @ {self:p}"))
326 .field("parent_class", &self.parent_class)
327 .finish()
328 }
329}
330
331#[repr(C)]
332#[allow(dead_code)]
333pub struct _GstD3D12FenceDataPoolPrivate {
334 _data: [u8; 0],
335 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
336}
337
338pub type GstD3D12FenceDataPoolPrivate = _GstD3D12FenceDataPoolPrivate;
339
340#[derive(Copy, Clone)]
341#[repr(C)]
342pub struct GstD3D12Format {
343 pub format: gst_video::GstVideoFormat,
344 pub format_flags: GstD3D12FormatFlags,
345 pub dimension: c_int,
346 pub dxgi_format: c_int,
347 pub resource_format: [c_int; 4],
348 pub uav_format: [c_int; 4],
349 pub support1: c_int,
350 pub support2: c_int,
351 pub padding: [c_uint; 20],
352}
353
354impl ::std::fmt::Debug for GstD3D12Format {
355 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
356 f.debug_struct(&format!("GstD3D12Format @ {self:p}"))
357 .field("format", &self.format)
358 .field("format_flags", &self.format_flags)
359 .field("dimension", &self.dimension)
360 .field("dxgi_format", &self.dxgi_format)
361 .field("resource_format", &self.resource_format)
362 .field("uav_format", &self.uav_format)
363 .field("support1", &self.support1)
364 .field("support2", &self.support2)
365 .finish()
366 }
367}
368
369#[derive(Copy, Clone)]
370#[repr(C)]
371pub struct GstD3D12FrameFence {
372 pub fence: gpointer,
373 pub fence_value: u64,
374}
375
376impl ::std::fmt::Debug for GstD3D12FrameFence {
377 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
378 f.debug_struct(&format!("GstD3D12FrameFence @ {self:p}"))
379 .field("fence", &self.fence)
380 .field("fence_value", &self.fence_value)
381 .finish()
382 }
383}
384
385#[derive(Copy, Clone)]
386#[repr(C)]
387pub struct GstD3D12Memory {
388 pub mem: gst::GstMemory,
389 pub device: *mut GstD3D12Device,
390 pub priv_: *mut GstD3D12MemoryPrivate,
391 pub _gst_reserved: [gpointer; 4],
392}
393
394impl ::std::fmt::Debug for GstD3D12Memory {
395 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
396 f.debug_struct(&format!("GstD3D12Memory @ {self:p}"))
397 .field("mem", &self.mem)
398 .field("device", &self.device)
399 .finish()
400 }
401}
402
403#[repr(C)]
404#[allow(dead_code)]
405pub struct _GstD3D12MemoryPrivate {
406 _data: [u8; 0],
407 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
408}
409
410pub type GstD3D12MemoryPrivate = _GstD3D12MemoryPrivate;
411
412#[derive(Copy, Clone)]
413#[repr(C)]
414pub struct GstD3D12PoolAllocatorClass {
415 pub allocator_class: GstD3D12AllocatorClass,
416 pub _gst_reserved: [gpointer; 4],
417}
418
419impl ::std::fmt::Debug for GstD3D12PoolAllocatorClass {
420 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
421 f.debug_struct(&format!("GstD3D12PoolAllocatorClass @ {self:p}"))
422 .field("allocator_class", &self.allocator_class)
423 .finish()
424 }
425}
426
427#[repr(C)]
428#[allow(dead_code)]
429pub struct _GstD3D12PoolAllocatorPrivate {
430 _data: [u8; 0],
431 _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>,
432}
433
434pub type GstD3D12PoolAllocatorPrivate = _GstD3D12PoolAllocatorPrivate;
435
436#[derive(Copy, Clone)]
438#[repr(C)]
439pub struct GstD3D12Allocator {
440 pub allocator: gst::GstAllocator,
441 pub priv_: *mut GstD3D12AllocatorPrivate,
442 pub _gst_reserved: [gpointer; 4],
443}
444
445impl ::std::fmt::Debug for GstD3D12Allocator {
446 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
447 f.debug_struct(&format!("GstD3D12Allocator @ {self:p}"))
448 .field("allocator", &self.allocator)
449 .finish()
450 }
451}
452
453#[derive(Copy, Clone)]
454#[repr(C)]
455pub struct GstD3D12BufferPool {
456 pub parent: gst::GstBufferPool,
457 pub device: *mut GstD3D12Device,
458 pub priv_: *mut GstD3D12BufferPoolPrivate,
459}
460
461impl ::std::fmt::Debug for GstD3D12BufferPool {
462 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
463 f.debug_struct(&format!("GstD3D12BufferPool @ {self:p}"))
464 .field("parent", &self.parent)
465 .field("device", &self.device)
466 .finish()
467 }
468}
469
470#[derive(Copy, Clone)]
471#[repr(C)]
472pub struct GstD3D12CmdAllocPool {
473 pub parent: gst::GstObject,
474 pub priv_: *mut GstD3D12CmdAllocPoolPrivate,
475 pub _gst_reserved: [gpointer; 4],
476}
477
478impl ::std::fmt::Debug for GstD3D12CmdAllocPool {
479 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
480 f.debug_struct(&format!("GstD3D12CmdAllocPool @ {self:p}"))
481 .field("parent", &self.parent)
482 .finish()
483 }
484}
485
486#[derive(Copy, Clone)]
487#[repr(C)]
488pub struct GstD3D12CmdQueue {
489 pub parent: gst::GstObject,
490 pub priv_: *mut GstD3D12CmdQueuePrivate,
491 pub _gst_reserved: [gpointer; 4],
492}
493
494impl ::std::fmt::Debug for GstD3D12CmdQueue {
495 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
496 f.debug_struct(&format!("GstD3D12CmdQueue @ {self:p}"))
497 .field("parent", &self.parent)
498 .finish()
499 }
500}
501
502#[derive(Copy, Clone)]
503#[repr(C)]
504pub struct GstD3D12Converter {
505 pub parent: gst::GstObject,
506 pub device: *mut GstD3D12Device,
507 pub priv_: *mut GstD3D12ConverterPrivate,
508 pub _gst_reserved: [gpointer; 4],
509}
510
511impl ::std::fmt::Debug for GstD3D12Converter {
512 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
513 f.debug_struct(&format!("GstD3D12Converter @ {self:p}"))
514 .field("parent", &self.parent)
515 .field("device", &self.device)
516 .finish()
517 }
518}
519
520#[derive(Copy, Clone)]
521#[repr(C)]
522pub struct GstD3D12DescHeapPool {
523 pub parent: gst::GstObject,
524 pub priv_: *mut GstD3D12DescHeapPoolPrivate,
525 pub _gst_reserved: [gpointer; 4],
526}
527
528impl ::std::fmt::Debug for GstD3D12DescHeapPool {
529 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
530 f.debug_struct(&format!("GstD3D12DescHeapPool @ {self:p}"))
531 .field("parent", &self.parent)
532 .finish()
533 }
534}
535
536#[derive(Copy, Clone)]
537#[repr(C)]
538pub struct GstD3D12Device {
539 pub parent: gst::GstObject,
540 pub priv_: *mut GstD3D12DevicePrivate,
541 pub _gst_reserved: [gpointer; 4],
542}
543
544impl ::std::fmt::Debug for GstD3D12Device {
545 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
546 f.debug_struct(&format!("GstD3D12Device @ {self:p}"))
547 .field("parent", &self.parent)
548 .finish()
549 }
550}
551
552#[derive(Copy, Clone)]
553#[repr(C)]
554pub struct GstD3D12FenceDataPool {
555 pub parent: gst::GstObject,
556 pub priv_: *mut GstD3D12FenceDataPoolPrivate,
557 pub _gst_reserved: [gpointer; 4],
558}
559
560impl ::std::fmt::Debug for GstD3D12FenceDataPool {
561 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
562 f.debug_struct(&format!("GstD3D12FenceDataPool @ {self:p}"))
563 .field("parent", &self.parent)
564 .finish()
565 }
566}
567
568#[derive(Copy, Clone)]
569#[repr(C)]
570pub struct GstD3D12PoolAllocator {
571 pub allocator: GstD3D12Allocator,
572 pub device: *mut GstD3D12Device,
573 pub priv_: *mut GstD3D12PoolAllocatorPrivate,
574 pub _gst_reserved: [gpointer; 4],
575}
576
577impl ::std::fmt::Debug for GstD3D12PoolAllocator {
578 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
579 f.debug_struct(&format!("GstD3D12PoolAllocator @ {self:p}"))
580 .field("allocator", &self.allocator)
581 .field("device", &self.device)
582 .finish()
583 }
584}
585
586unsafe extern "C" {
587
588 pub fn gst_d3d12_converter_alpha_mode_get_type() -> GType;
592
593 pub fn gst_d3d12_converter_color_balance_get_type() -> GType;
597
598 pub fn gst_d3d12_converter_mip_gen_get_type() -> GType;
602
603 pub fn gst_d3d12_converter_sampler_filter_get_type() -> GType;
607
608 pub fn gst_d3d12_allocation_params_get_type() -> GType;
612 pub fn gst_d3d12_allocation_params_new(
613 device: *mut GstD3D12Device,
614 info: *const gst_video::GstVideoInfo,
615 flags: GstD3D12AllocationFlags,
616 resource_flags: c_int,
617 heap_flags: c_int,
618 ) -> *mut GstD3D12AllocationParams;
619 pub fn gst_d3d12_allocation_params_alignment(
620 parms: *mut GstD3D12AllocationParams,
621 align: *const gst_video::GstVideoAlignment,
622 ) -> gboolean;
623 pub fn gst_d3d12_allocation_params_copy(
624 src: *mut GstD3D12AllocationParams,
625 ) -> *mut GstD3D12AllocationParams;
626 pub fn gst_d3d12_allocation_params_free(params: *mut GstD3D12AllocationParams);
627 pub fn gst_d3d12_allocation_params_set_array_size(
628 params: *mut GstD3D12AllocationParams,
629 size: c_uint,
630 ) -> gboolean;
631 pub fn gst_d3d12_allocation_params_set_heap_flags(
632 params: *mut GstD3D12AllocationParams,
633 heap_flags: c_int,
634 ) -> gboolean;
635 pub fn gst_d3d12_allocation_params_set_mip_levels(
636 params: *mut GstD3D12AllocationParams,
637 mip_levels: c_uint,
638 ) -> gboolean;
639 pub fn gst_d3d12_allocation_params_set_resource_flags(
640 params: *mut GstD3D12AllocationParams,
641 resource_flags: c_int,
642 ) -> gboolean;
643 pub fn gst_d3d12_allocation_params_unset_resource_flags(
644 params: *mut GstD3D12AllocationParams,
645 resource_flags: c_int,
646 ) -> gboolean;
647
648 pub fn gst_d3d12_cmd_alloc_get_type() -> GType;
652 pub fn gst_d3d12_cmd_alloc_get_handle(ca: *mut GstD3D12CmdAlloc) -> gpointer;
653 pub fn gst_d3d12_cmd_alloc_ref(ca: *mut GstD3D12CmdAlloc) -> *mut GstD3D12CmdAlloc;
654 pub fn gst_d3d12_cmd_alloc_unref(ca: *mut GstD3D12CmdAlloc);
655
656 pub fn gst_d3d12_desc_heap_get_type() -> GType;
660 pub fn gst_d3d12_desc_heap_get_handle(heap: *mut GstD3D12DescHeap) -> gpointer;
661 pub fn gst_d3d12_desc_heap_ref(heap: *mut GstD3D12DescHeap) -> *mut GstD3D12DescHeap;
662 pub fn gst_d3d12_desc_heap_unref(heap: *mut GstD3D12DescHeap);
663
664 pub fn gst_d3d12_fence_data_get_type() -> GType;
668 pub fn gst_d3d12_fence_data_push(
669 data: *mut GstD3D12FenceData,
670 user_data: gpointer,
671 notify: glib::GDestroyNotify,
672 );
673 pub fn gst_d3d12_fence_data_ref(data: *mut GstD3D12FenceData) -> *mut GstD3D12FenceData;
674 pub fn gst_d3d12_fence_data_unref(data: *mut GstD3D12FenceData);
675
676 pub fn gst_d3d12_memory_get_type() -> GType;
680 pub fn gst_d3d12_memory_get_d3d11_texture(
681 mem: *mut GstD3D12Memory,
682 device11: gpointer,
683 ) -> gpointer;
684 pub fn gst_d3d12_memory_get_fence(
685 mem: *mut GstD3D12Memory,
686 fence: *mut gpointer,
687 fence_value: *mut u64,
688 ) -> gboolean;
689 pub fn gst_d3d12_memory_get_nt_handle(
690 mem: *mut GstD3D12Memory,
691 handle: *mut gpointer,
692 ) -> gboolean;
693 pub fn gst_d3d12_memory_get_plane_count(mem: *mut GstD3D12Memory) -> c_uint;
694 pub fn gst_d3d12_memory_get_plane_rectangle(
695 mem: *mut GstD3D12Memory,
696 plane: c_uint,
697 rect: gpointer,
698 ) -> gboolean;
699 pub fn gst_d3d12_memory_get_render_target_view_heap(mem: *mut GstD3D12Memory) -> gpointer;
700 pub fn gst_d3d12_memory_get_resource_handle(mem: *mut GstD3D12Memory) -> gpointer;
701 pub fn gst_d3d12_memory_get_shader_resource_view_heap(mem: *mut GstD3D12Memory) -> gpointer;
702 pub fn gst_d3d12_memory_get_subresource_index(
703 mem: *mut GstD3D12Memory,
704 plane: c_uint,
705 index: *mut c_uint,
706 ) -> gboolean;
707 pub fn gst_d3d12_memory_get_token_data(mem: *mut GstD3D12Memory, token: i64) -> gpointer;
708 pub fn gst_d3d12_memory_get_unordered_access_view_heap(mem: *mut GstD3D12Memory) -> gpointer;
709 pub fn gst_d3d12_memory_set_fence(
710 mem: *mut GstD3D12Memory,
711 fence: gpointer,
712 fence_value: u64,
713 wait: gboolean,
714 );
715 pub fn gst_d3d12_memory_set_token_data(
716 mem: *mut GstD3D12Memory,
717 token: i64,
718 data: gpointer,
719 notify: glib::GDestroyNotify,
720 );
721 pub fn gst_d3d12_memory_sync(mem: *mut GstD3D12Memory) -> gboolean;
722 pub fn gst_d3d12_memory_init_once();
723
724 pub fn gst_d3d12_allocator_get_type() -> GType;
728 pub fn gst_d3d12_allocator_alloc(
729 allocator: *mut GstD3D12Allocator,
730 device: *mut GstD3D12Device,
731 heap_props: gconstpointer,
732 heap_flags: c_int,
733 desc: gconstpointer,
734 initial_state: c_int,
735 optimized_clear_value: gconstpointer,
736 ) -> *mut gst::GstMemory;
737 pub fn gst_d3d12_allocator_alloc_wrapped(
738 allocator: *mut GstD3D12Allocator,
739 device: *mut GstD3D12Device,
740 resource: gpointer,
741 array_slice: c_uint,
742 user_data: gpointer,
743 notify: glib::GDestroyNotify,
744 ) -> *mut gst::GstMemory;
745 pub fn gst_d3d12_allocator_set_active(
746 allocator: *mut GstD3D12Allocator,
747 active: gboolean,
748 ) -> gboolean;
749
750 pub fn gst_d3d12_buffer_pool_get_type() -> GType;
754 pub fn gst_d3d12_buffer_pool_new(device: *mut GstD3D12Device) -> *mut gst::GstBufferPool;
755
756 pub fn gst_d3d12_cmd_alloc_pool_get_type() -> GType;
760 pub fn gst_d3d12_cmd_alloc_pool_new(
761 device: gpointer,
762 type_: c_int,
763 ) -> *mut GstD3D12CmdAllocPool;
764 pub fn gst_d3d12_cmd_alloc_pool_acquire(
765 pool: *mut GstD3D12CmdAllocPool,
766 ca: *mut *mut GstD3D12CmdAlloc,
767 ) -> gboolean;
768
769 pub fn gst_d3d12_cmd_queue_get_type() -> GType;
773 pub fn gst_d3d12_cmd_queue_new(
774 device: gpointer,
775 desc: gconstpointer,
776 fence_flags: c_int,
777 queue_size: c_uint,
778 ) -> *mut GstD3D12CmdQueue;
779 pub fn gst_d3d12_cmd_queue_drain(queue: *mut GstD3D12CmdQueue) -> c_int;
780 pub fn gst_d3d12_cmd_queue_execute_command_lists(
781 queue: *mut GstD3D12CmdQueue,
782 num_command_lists: c_uint,
783 command_lists: *mut gpointer,
784 fence_value: *mut u64,
785 ) -> c_int;
786 pub fn gst_d3d12_cmd_queue_execute_command_lists_full(
787 queue: *mut GstD3D12CmdQueue,
788 num_fences_to_wait: c_uint,
789 fences_to_wait: *mut gpointer,
790 fence_values_to_wait: *const u64,
791 num_command_lists: c_uint,
792 command_lists: *mut gpointer,
793 fence_value: *mut u64,
794 ) -> c_int;
795 pub fn gst_d3d12_cmd_queue_execute_wait(
796 queue: *mut GstD3D12CmdQueue,
797 fence: gpointer,
798 fence_value: u64,
799 ) -> c_int;
800 pub fn gst_d3d12_cmd_queue_fence_wait(queue: *mut GstD3D12CmdQueue, fence_value: u64) -> c_int;
801 pub fn gst_d3d12_cmd_queue_get_completed_value(queue: *mut GstD3D12CmdQueue) -> u64;
802 pub fn gst_d3d12_cmd_queue_get_fence_handle(queue: *mut GstD3D12CmdQueue) -> gpointer;
803 pub fn gst_d3d12_cmd_queue_get_handle(queue: *mut GstD3D12CmdQueue) -> gpointer;
804 pub fn gst_d3d12_cmd_queue_set_notify(
805 queue: *mut GstD3D12CmdQueue,
806 fence_value: u64,
807 fence_data: gpointer,
808 notify: glib::GDestroyNotify,
809 );
810
811 pub fn gst_d3d12_converter_get_type() -> GType;
815 pub fn gst_d3d12_converter_new(
816 device: *mut GstD3D12Device,
817 queue: *mut GstD3D12CmdQueue,
818 in_info: *const gst_video::GstVideoInfo,
819 out_info: *const gst_video::GstVideoInfo,
820 blend_desc: gconstpointer,
821 blend_factor: *const c_float,
822 config: *mut gst::GstStructure,
823 ) -> *mut GstD3D12Converter;
824 pub fn gst_d3d12_converter_convert_buffer(
825 converter: *mut GstD3D12Converter,
826 in_buf: *mut gst::GstBuffer,
827 out_buf: *mut gst::GstBuffer,
828 fence_data: *mut GstD3D12FenceData,
829 command_list: gpointer,
830 execute_gpu_wait: gboolean,
831 ) -> gboolean;
832 pub fn gst_d3d12_converter_update_blend_state(
833 converter: *mut GstD3D12Converter,
834 blend_desc: gconstpointer,
835 blend_factor: *const c_float,
836 ) -> gboolean;
837
838 pub fn gst_d3d12_desc_heap_pool_get_type() -> GType;
842 pub fn gst_d3d12_desc_heap_pool_new(
843 device: gpointer,
844 desc: gconstpointer,
845 ) -> *mut GstD3D12DescHeapPool;
846 pub fn gst_d3d12_desc_heap_pool_acquire(
847 pool: *mut GstD3D12DescHeapPool,
848 heap: *mut *mut GstD3D12DescHeap,
849 ) -> gboolean;
850
851 pub fn gst_d3d12_device_get_type() -> GType;
855 pub fn gst_d3d12_device_new(adapter_index: c_uint) -> *mut GstD3D12Device;
856 pub fn gst_d3d12_device_new_for_adapter_luid(adapter_luid: i64) -> *mut GstD3D12Device;
857 pub fn gst_d3d12_device_execute_command_lists(
858 device: *mut GstD3D12Device,
859 queue_type: c_int,
860 num_command_lists: c_uint,
861 command_lists: *mut gpointer,
862 fence_value: *mut u64,
863 ) -> c_int;
864 pub fn gst_d3d12_device_fence_wait(
865 device: *mut GstD3D12Device,
866 queue_type: c_int,
867 fence_value: u64,
868 ) -> c_int;
869 pub fn gst_d3d12_device_get_adapter_handle(device: *mut GstD3D12Device) -> gpointer;
870 pub fn gst_d3d12_device_get_cmd_queue(
871 device: *mut GstD3D12Device,
872 queue_type: c_int,
873 ) -> *mut GstD3D12CmdQueue;
874 pub fn gst_d3d12_device_get_completed_value(
875 device: *mut GstD3D12Device,
876 queue_type: c_int,
877 ) -> u64;
878 pub fn gst_d3d12_device_get_device_handle(device: *mut GstD3D12Device) -> gpointer;
879 pub fn gst_d3d12_device_get_factory_handle(device: *mut GstD3D12Device) -> gpointer;
880 pub fn gst_d3d12_device_get_fence_handle(
881 device: *mut GstD3D12Device,
882 queue_type: c_int,
883 ) -> gpointer;
884 pub fn gst_d3d12_device_get_format(
885 device: *mut GstD3D12Device,
886 format: gst_video::GstVideoFormat,
887 device_format: *mut GstD3D12Format,
888 ) -> gboolean;
889 pub fn gst_d3d12_device_is_equal(
890 device1: *mut GstD3D12Device,
891 device2: *mut GstD3D12Device,
892 ) -> gboolean;
893 pub fn gst_d3d12_device_set_fence_notify(
894 device: *mut GstD3D12Device,
895 queue_type: c_int,
896 fence_value: u64,
897 fence_data: gpointer,
898 notify: glib::GDestroyNotify,
899 ) -> gboolean;
900
901 pub fn gst_d3d12_fence_data_pool_get_type() -> GType;
905 pub fn gst_d3d12_fence_data_pool_new() -> *mut GstD3D12FenceDataPool;
906 pub fn gst_d3d12_fence_data_pool_acquire(
907 pool: *mut GstD3D12FenceDataPool,
908 data: *mut *mut GstD3D12FenceData,
909 ) -> gboolean;
910
911 pub fn gst_d3d12_pool_allocator_get_type() -> GType;
915 pub fn gst_d3d12_pool_allocator_new(
916 device: *mut GstD3D12Device,
917 heap_props: gconstpointer,
918 heap_flags: c_int,
919 desc: gconstpointer,
920 initial_state: c_int,
921 optimized_clear_value: gconstpointer,
922 ) -> *mut GstD3D12PoolAllocator;
923 pub fn gst_d3d12_pool_allocator_acquire_memory(
924 allocator: *mut GstD3D12PoolAllocator,
925 memory: *mut *mut gst::GstMemory,
926 ) -> gst::GstFlowReturn;
927
928 pub fn gst_buffer_pool_config_get_d3d12_allocation_params(
932 config: *mut gst::GstStructure,
933 ) -> *mut GstD3D12AllocationParams;
934 pub fn gst_buffer_pool_config_set_d3d12_allocation_params(
935 config: *mut gst::GstStructure,
936 params: *mut GstD3D12AllocationParams,
937 );
938 pub fn gst_clear_d3d12_cmd_alloc(ca: *mut *mut GstD3D12CmdAlloc);
939 pub fn gst_clear_d3d12_desc_heap(heap: *mut *mut GstD3D12DescHeap);
940 pub fn gst_clear_d3d12_fence_data(data: *mut *mut GstD3D12FenceData);
941 pub fn gst_d3d12_buffer_copy_into(
942 dest: *mut gst::GstBuffer,
943 src: *mut gst::GstBuffer,
944 info: *const gst_video::GstVideoInfo,
945 ) -> gboolean;
946 pub fn gst_d3d12_buffer_set_fence(
947 buffer: *mut gst::GstBuffer,
948 fence: gpointer,
949 fence_value: u64,
950 wait: gboolean,
951 );
952 pub fn gst_d3d12_context_new(device: *mut GstD3D12Device) -> *mut gst::GstContext;
953 pub fn gst_d3d12_create_user_token() -> i64;
954 pub fn gst_d3d12_dxgi_format_to_gst(format: c_int) -> gst_video::GstVideoFormat;
955 pub fn gst_d3d12_ensure_element_data(
956 element: *mut gst::GstElement,
957 adapter_index: c_int,
958 device: *mut *mut GstD3D12Device,
959 ) -> gboolean;
960 pub fn gst_d3d12_ensure_element_data_for_adapter_luid(
961 element: *mut gst::GstElement,
962 adapter_luid: i64,
963 device: *mut *mut GstD3D12Device,
964 ) -> gboolean;
965 pub fn gst_d3d12_flush_all_devices();
966 pub fn gst_d3d12_get_copyable_footprints(
967 device: *mut GstD3D12Device,
968 info: *const gst_video::GstVideoInfo,
969 layout: gpointer,
970 size: *mut u64,
971 ) -> gboolean;
972 pub fn gst_d3d12_handle_context_query(
973 element: *mut gst::GstElement,
974 query: *mut gst::GstQuery,
975 device: *mut GstD3D12Device,
976 ) -> gboolean;
977 pub fn gst_d3d12_handle_set_context(
978 element: *mut gst::GstElement,
979 context: *mut gst::GstContext,
980 adapter_index: c_int,
981 device: *mut *mut GstD3D12Device,
982 ) -> gboolean;
983 pub fn gst_d3d12_handle_set_context_for_adapter_luid(
984 element: *mut gst::GstElement,
985 context: *mut gst::GstContext,
986 adapter_luid: i64,
987 device: *mut *mut GstD3D12Device,
988 ) -> gboolean;
989 pub fn gst_d3d12_luid_to_int64(luid: gconstpointer) -> i64;
990 pub fn gst_is_d3d12_memory(mem: *mut gst::GstMemory) -> gboolean;
991
992}