gstreamer-vulkan 0.25.0-alpha.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::{VulkanDescriptorSet, VulkanHandlePool, ffi};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GstVulkanDescriptorCache")]
    pub struct VulkanDescriptorCache(Object<ffi::GstVulkanDescriptorCache, ffi::GstVulkanDescriptorCacheClass>) @extends VulkanHandlePool, gst::Object;

    match fn {
        type_ => || ffi::gst_vulkan_descriptor_cache_get_type(),
    }
}

impl VulkanDescriptorCache {
    pub const NONE: Option<&'static VulkanDescriptorCache> = None;
}

unsafe impl Send for VulkanDescriptorCache {}
unsafe impl Sync for VulkanDescriptorCache {}

pub trait VulkanDescriptorCacheExt: IsA<VulkanDescriptorCache> + 'static {
    #[doc(alias = "gst_vulkan_descriptor_cache_acquire")]
    fn acquire(&self) -> Result<VulkanDescriptorSet, glib::Error> {
        unsafe {
            let mut error = std::ptr::null_mut();
            let ret = ffi::gst_vulkan_descriptor_cache_acquire(
                self.as_ref().to_glib_none().0,
                &mut error,
            );
            if error.is_null() {
                Ok(from_glib_full(ret))
            } else {
                Err(from_glib_full(error))
            }
        }
    }
}

impl<O: IsA<VulkanDescriptorCache>> VulkanDescriptorCacheExt for O {}