Skip to main content

gstreamer_vulkan/auto/
vulkan_descriptor_cache.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::{VulkanDescriptorSet, VulkanHandlePool, ffi};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10    #[doc(alias = "GstVulkanDescriptorCache")]
11    pub struct VulkanDescriptorCache(Object<ffi::GstVulkanDescriptorCache, ffi::GstVulkanDescriptorCacheClass>) @extends VulkanHandlePool, gst::Object;
12
13    match fn {
14        type_ => || ffi::gst_vulkan_descriptor_cache_get_type(),
15    }
16}
17
18impl VulkanDescriptorCache {
19    pub const NONE: Option<&'static VulkanDescriptorCache> = None;
20}
21
22unsafe impl Send for VulkanDescriptorCache {}
23unsafe impl Sync for VulkanDescriptorCache {}
24
25pub trait VulkanDescriptorCacheExt: IsA<VulkanDescriptorCache> + 'static {
26    #[doc(alias = "gst_vulkan_descriptor_cache_acquire")]
27    fn acquire(&self) -> Result<VulkanDescriptorSet, glib::Error> {
28        unsafe {
29            let mut error = std::ptr::null_mut();
30            let ret = ffi::gst_vulkan_descriptor_cache_acquire(
31                self.as_ref().to_glib_none().0,
32                &mut error,
33            );
34            if error.is_null() {
35                Ok(from_glib_full(ret))
36            } else {
37                Err(from_glib_full(error))
38            }
39        }
40    }
41}
42
43impl<O: IsA<VulkanDescriptorCache>> VulkanDescriptorCacheExt for O {}