Skip to main content

gstreamer_vulkan/auto/
vulkan_trash.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
4// DO NOT EDIT
5
6use crate::{VulkanDevice, VulkanFence, ffi};
7use glib::translate::*;
8use std::boxed::Box as Box_;
9
10glib::wrapper! {
11    #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
12    pub struct VulkanTrash(Boxed<ffi::GstVulkanTrash>);
13
14    match fn {
15        copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gst_vulkan_trash_get_type(), ptr as *mut _) as *mut ffi::GstVulkanTrash,
16        free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gst_vulkan_trash_get_type(), ptr as *mut _),
17        type_ => || ffi::gst_vulkan_trash_get_type(),
18    }
19}
20
21impl VulkanTrash {
22    #[doc(alias = "gst_vulkan_trash_new")]
23    pub fn new<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
24        fence: &mut VulkanFence,
25        notify: P,
26    ) -> VulkanTrash {
27        assert_initialized_main_thread!();
28        let notify_data: Box_<P> = Box_::new(notify);
29        unsafe extern "C" fn notify_func<P: FnOnce(&VulkanDevice) + Send + Sync + 'static>(
30            device: *mut ffi::GstVulkanDevice,
31            user_data: glib::ffi::gpointer,
32        ) {
33            unsafe {
34                let device = from_glib_borrow(device);
35                let callback = Box_::from_raw(user_data as *mut P);
36                (*callback)(&device)
37            }
38        }
39        let notify = Some(notify_func::<P> as _);
40        let super_callback0: Box_<P> = notify_data;
41        unsafe {
42            from_glib_full(ffi::gst_vulkan_trash_new(
43                fence.to_glib_none_mut().0,
44                notify,
45                Box_::into_raw(super_callback0) as *mut _,
46            ))
47        }
48    }
49
50    //#[doc(alias = "gst_vulkan_trash_new_free_semaphore")]
51    //pub fn new_free_semaphore(fence: &mut VulkanFence, semaphore: /*Ignored*/&vulkan::Semaphore) -> VulkanTrash {
52    //    unsafe { TODO: call ffi:gst_vulkan_trash_new_free_semaphore() }
53    //}
54
55    //#[doc(alias = "gst_vulkan_trash_mini_object_unref")]
56    //pub fn mini_object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
57    //    unsafe { TODO: call ffi:gst_vulkan_trash_mini_object_unref() }
58    //}
59
60    //#[doc(alias = "gst_vulkan_trash_object_unref")]
61    //pub fn object_unref(device: &impl IsA<VulkanDevice>, user_data: /*Unimplemented*/Option<Basic: Pointer>) {
62    //    unsafe { TODO: call ffi:gst_vulkan_trash_object_unref() }
63    //}
64}
65
66unsafe impl Send for VulkanTrash {}
67unsafe impl Sync for VulkanTrash {}