gstreamer_vulkan_xcb/auto/vulkan_display_xcb.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;
7use glib::translate::*;
8
9glib::wrapper! {
10 /// the contents of a [`VulkanDisplayXCB`][crate::VulkanDisplayXCB] are private and should only be accessed
11 /// through the provided API
12 ///
13 /// # Implements
14 ///
15 /// [`trait@gst::prelude::ObjectExt`], [`trait@glib::ObjectExt`]
16 #[doc(alias = "GstVulkanDisplayXCB")]
17 pub struct VulkanDisplayXCB(Object<ffi::GstVulkanDisplayXCB, ffi::GstVulkanDisplayXCBClass>) @extends gst::Object;
18
19 match fn {
20 type_ => || ffi::gst_vulkan_display_xcb_get_type(),
21 }
22}
23
24impl VulkanDisplayXCB {
25 /// Create a new [`VulkanDisplayXCB`][crate::VulkanDisplayXCB] from the xcb display name. See XOpenDisplay\()
26 /// for details on what is a valid name.
27 /// ## `name`
28 /// a display name
29 ///
30 /// # Returns
31 ///
32 /// a new [`VulkanDisplayXCB`][crate::VulkanDisplayXCB] or [`None`]
33 #[doc(alias = "gst_vulkan_display_xcb_new")]
34 pub fn new(name: Option<&str>) -> Result<VulkanDisplayXCB, glib::BoolError> {
35 assert_initialized_main_thread!();
36 unsafe {
37 Option::<_>::from_glib_full(ffi::gst_vulkan_display_xcb_new(name.to_glib_none().0))
38 .ok_or_else(|| glib::bool_error!("Failed to create XCB display"))
39 }
40 }
41}
42
43unsafe impl Send for VulkanDisplayXCB {}
44unsafe impl Sync for VulkanDisplayXCB {}