gstreamer-vulkan 0.25.2

Rust bindings for GStreamer Vulkan library
Documentation
// 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 {}