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
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT
use crate::{VulkanDevice, VulkanFence, ffi};
use glib::translate::*;
use std::boxed::Box as Box_;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct VulkanTrash(Boxed<ffi::GstVulkanTrash>);
match fn {
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_vulkan_trash_get_type(), ptr as *mut _) as *mut ffi::GstVulkanTrash,
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_vulkan_trash_get_type(), ptr as *mut _),
type_ => || ffi::gst_vulkan_trash_get_type(),
}
}
impl VulkanTrash {
#[doc(alias = "gst_vulkan_trash_new")]
pub fn new<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
fence: &mut VulkanFence,
notify: P,
) -> VulkanTrash {
assert_initialized_main_thread!();
let notify_data: Box_<P> = Box_::new(notify);
unsafe extern "C" fn notify_func<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
device: *mut ffi::GstVulkanDevice,
user_data: glib::ffi::gpointer,
) {
unsafe {
let device = from_glib_borrow(device);
let callback = Box_::from_raw(user_data as *mut P);
(*callback)(&device)
}
}
let notify = Some(notify_func::<P> as _);
let super_callback0: Box_<P> = notify_data;
unsafe {
from_glib_full(ffi::gst_vulkan_trash_new(
fence.to_glib_none_mut().0,
notify,
Box_::into_raw(super_callback0) as *mut _,
))
}
}
//#[doc(alias = "gst_vulkan_trash_new_free_semaphore")]
//pub fn new_free_semaphore(fence: &mut VulkanFence, semaphore: /*Ignored*/&vulkan::Semaphore) -> VulkanTrash {
// unsafe { TODO: call ffi:gst_vulkan_trash_new_free_semaphore() }
//}
//#[doc(alias = "gst_vulkan_trash_mini_object_unref")]
//pub fn mini_object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
// unsafe { TODO: call ffi:gst_vulkan_trash_mini_object_unref() }
//}
//#[doc(alias = "gst_vulkan_trash_object_unref")]
//pub fn object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
// unsafe { TODO: call ffi:gst_vulkan_trash_object_unref() }
//}
}
unsafe impl Send for VulkanTrash {}
unsafe impl Sync for VulkanTrash {}