gstreamer_vulkan/auto/vulkan_image_buffer_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::{ffi, VulkanDevice};
7use glib::{prelude::*, translate::*};
8
9glib::wrapper! {
10 ///
11 ///
12 /// # Implements
13 ///
14 /// [`trait@gst::prelude::BufferPoolExt`], [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
15 #[doc(alias = "GstVulkanImageBufferPool")]
16 pub struct VulkanImageBufferPool(Object<ffi::GstVulkanImageBufferPool, ffi::GstVulkanImageBufferPoolClass>) @extends gst::BufferPool, gst::Object;
17
18 match fn {
19 type_ => || ffi::gst_vulkan_image_buffer_pool_get_type(),
20 }
21}
22
23impl VulkanImageBufferPool {
24 pub const NONE: Option<&'static VulkanImageBufferPool> = None;
25
26 /// ## `device`
27 /// the [`VulkanDevice`][crate::VulkanDevice] to use
28 ///
29 /// # Returns
30 ///
31 /// a [`gst::BufferPool`][crate::gst::BufferPool] that allocates buffers with `GstGLMemory`
32 #[doc(alias = "gst_vulkan_image_buffer_pool_new")]
33 pub fn new(device: &impl IsA<VulkanDevice>) -> VulkanImageBufferPool {
34 skip_assert_initialized!();
35 unsafe {
36 gst::BufferPool::from_glib_full(ffi::gst_vulkan_image_buffer_pool_new(
37 device.as_ref().to_glib_none().0,
38 ))
39 .unsafe_cast()
40 }
41 }
42
43 //#[cfg(feature = "v1_26")]
44 //#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
45 //#[doc(alias = "gst_vulkan_image_buffer_pool_config_get_allocation_params")]
46 //pub fn config_get_allocation_params(config: &gst::Structure, usage: /*Ignored*/vulkan::ImageUsageFlags, mem_props: /*Ignored*/vulkan::MemoryPropertyFlags, initial_layout: /*Ignored*/vulkan::ImageLayout) -> u64 {
47 // unsafe { TODO: call ffi:gst_vulkan_image_buffer_pool_config_get_allocation_params() }
48 //}
49
50 //#[cfg(feature = "v1_24")]
51 //#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
52 //#[doc(alias = "gst_vulkan_image_buffer_pool_config_set_allocation_params")]
53 //pub fn config_set_allocation_params(config: &gst::Structure, usage: /*Ignored*/&vulkan::ImageUsageFlags, mem_properties: /*Ignored*/&vulkan::MemoryPropertyFlags, initial_layout: /*Ignored*/&vulkan::ImageLayout, initial_access: u64) {
54 // unsafe { TODO: call ffi:gst_vulkan_image_buffer_pool_config_set_allocation_params() }
55 //}
56
57 /// Decode `caps` are used when the buffers are going to be used either as decoded
58 /// dest or DPB images.
59 /// ## `config`
60 /// the [`gst::Structure`][crate::gst::Structure] with the pool's configuration.
61 /// ## `caps`
62 /// Upstream decode caps.
63 #[cfg(feature = "v1_24")]
64 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
65 #[doc(alias = "gst_vulkan_image_buffer_pool_config_set_decode_caps")]
66 pub fn config_set_decode_caps(config: &gst::Structure, caps: &gst::Caps) {
67 assert_initialized_main_thread!();
68 unsafe {
69 ffi::gst_vulkan_image_buffer_pool_config_set_decode_caps(
70 config.to_glib_none().0,
71 caps.to_glib_none().0,
72 );
73 }
74 }
75
76 /// Encode `caps` are used when the buffers are going to be used either as encoded
77 /// src or DPB images.
78 /// ## `config`
79 /// the [`gst::Structure`][crate::gst::Structure] with the pool's configuration.
80 /// ## `caps`
81 /// Upstream encode caps.
82 #[cfg(feature = "v1_26")]
83 #[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
84 #[doc(alias = "gst_vulkan_image_buffer_pool_config_set_encode_caps")]
85 pub fn config_set_encode_caps(config: &gst::Structure, caps: &gst::Caps) {
86 assert_initialized_main_thread!();
87 unsafe {
88 ffi::gst_vulkan_image_buffer_pool_config_set_encode_caps(
89 config.to_glib_none().0,
90 caps.to_glib_none().0,
91 );
92 }
93 }
94}
95
96unsafe impl Send for VulkanImageBufferPool {}
97unsafe impl Sync for VulkanImageBufferPool {}