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::{VulkanCommandBuffer, VulkanQueue, ffi};
use glib::{prelude::*, translate::*};

glib::wrapper! {
    #[doc(alias = "GstVulkanCommandPool")]
    pub struct VulkanCommandPool(Object<ffi::GstVulkanCommandPool, ffi::GstVulkanCommandPoolClass>) @extends gst::Object;

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

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

unsafe impl Send for VulkanCommandPool {}
unsafe impl Sync for VulkanCommandPool {}

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

    #[doc(alias = "gst_vulkan_command_pool_get_queue")]
    #[doc(alias = "get_queue")]
    fn queue(&self) -> VulkanQueue {
        unsafe {
            from_glib_full(ffi::gst_vulkan_command_pool_get_queue(
                self.as_ref().to_glib_none().0,
            ))
        }
    }
}

impl<O: IsA<VulkanCommandPool>> VulkanCommandPoolExt for O {}