gstreamer_vulkan/auto/vulkan_command_pool.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::{VulkanCommandBuffer, VulkanQueue, ffi};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstVulkanCommandPool")]
11 pub struct VulkanCommandPool(Object<ffi::GstVulkanCommandPool, ffi::GstVulkanCommandPoolClass>) @extends gst::Object;
12
13 match fn {
14 type_ => || ffi::gst_vulkan_command_pool_get_type(),
15 }
16}
17
18impl VulkanCommandPool {
19 pub const NONE: Option<&'static VulkanCommandPool> = None;
20}
21
22unsafe impl Send for VulkanCommandPool {}
23unsafe impl Sync for VulkanCommandPool {}
24
25pub trait VulkanCommandPoolExt: IsA<VulkanCommandPool> + 'static {
26 #[doc(alias = "gst_vulkan_command_pool_create")]
27 fn create(&self) -> Result<VulkanCommandBuffer, glib::Error> {
28 unsafe {
29 let mut error = std::ptr::null_mut();
30 let ret =
31 ffi::gst_vulkan_command_pool_create(self.as_ref().to_glib_none().0, &mut error);
32 if error.is_null() {
33 Ok(from_glib_full(ret))
34 } else {
35 Err(from_glib_full(error))
36 }
37 }
38 }
39
40 #[doc(alias = "gst_vulkan_command_pool_get_queue")]
41 #[doc(alias = "get_queue")]
42 fn queue(&self) -> VulkanQueue {
43 unsafe {
44 from_glib_full(ffi::gst_vulkan_command_pool_get_queue(
45 self.as_ref().to_glib_none().0,
46 ))
47 }
48 }
49}
50
51impl<O: IsA<VulkanCommandPool>> VulkanCommandPoolExt for O {}