gstreamer_vulkan/auto/
vulkan_command_pool.rs1use crate::{ffi, VulkanCommandBuffer, VulkanQueue};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstVulkanCommandPool")]
16 pub struct VulkanCommandPool(Object<ffi::GstVulkanCommandPool, ffi::GstVulkanCommandPoolClass>) @extends gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_vulkan_command_pool_get_type(),
20 }
21}
22
23impl VulkanCommandPool {
24 pub const NONE: Option<&'static VulkanCommandPool> = None;
25}
26
27unsafe impl Send for VulkanCommandPool {}
28unsafe impl Sync for VulkanCommandPool {}
29
30pub trait VulkanCommandPoolExt: IsA<VulkanCommandPool> + 'static {
36 #[doc(alias = "gst_vulkan_command_pool_create")]
41 fn create(&self) -> Result<VulkanCommandBuffer, glib::Error> {
42 unsafe {
43 let mut error = std::ptr::null_mut();
44 let ret =
45 ffi::gst_vulkan_command_pool_create(self.as_ref().to_glib_none().0, &mut error);
46 if error.is_null() {
47 Ok(from_glib_full(ret))
48 } else {
49 Err(from_glib_full(error))
50 }
51 }
52 }
53
54 #[doc(alias = "gst_vulkan_command_pool_get_queue")]
59 #[doc(alias = "get_queue")]
60 fn queue(&self) -> VulkanQueue {
61 unsafe {
62 from_glib_full(ffi::gst_vulkan_command_pool_get_queue(
63 self.as_ref().to_glib_none().0,
64 ))
65 }
66 }
67}
68
69impl<O: IsA<VulkanCommandPool>> VulkanCommandPoolExt for O {}