gstreamer_gl/auto/
functions.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, GLDisplay, GLSLProfile, GLSLVersion};
7use glib::{prelude::*, translate::*};
8
9/// ## `name`
10/// the extension to search for
11/// ## `ext`
12/// the list of possible extensions
13///
14/// # Returns
15///
16/// whether `name` is in the space separated list of `ext`
17#[doc(alias = "gst_gl_check_extension")]
18pub fn gl_check_extension(name: &str, ext: &str) -> bool {
19    assert_initialized_main_thread!();
20    unsafe {
21        from_glib(ffi::gst_gl_check_extension(
22            name.to_glib_none().0,
23            ext.to_glib_none().0,
24        ))
25    }
26}
27
28//#[cfg(feature = "v1_26")]
29//#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
30//#[doc(alias = "gst_gl_dma_buf_transform_drm_formats_to_gst_formats")]
31//pub fn gl_dma_buf_transform_drm_formats_to_gst_formats(context: &impl IsA<GLContext>, src: &glib::Value, flags: /*Ignored*/GLDrmFormatFlags, dst: /*Unimplemented*/glib::Value) -> bool {
32//    unsafe { TODO: call ffi:gst_gl_dma_buf_transform_drm_formats_to_gst_formats() }
33//}
34
35//#[cfg(feature = "v1_26")]
36//#[cfg_attr(docsrs, doc(cfg(feature = "v1_26")))]
37//#[doc(alias = "gst_gl_dma_buf_transform_gst_formats_to_drm_formats")]
38//pub fn gl_dma_buf_transform_gst_formats_to_drm_formats(context: &impl IsA<GLContext>, src: &glib::Value, flags: /*Ignored*/GLDrmFormatFlags, dst: /*Unimplemented*/glib::Value) -> bool {
39//    unsafe { TODO: call ffi:gst_gl_dma_buf_transform_gst_formats_to_drm_formats() }
40//}
41
42#[doc(alias = "gst_gl_element_propagate_display_context")]
43pub fn gl_element_propagate_display_context(
44    element: &impl IsA<gst::Element>,
45    display: &impl IsA<GLDisplay>,
46) {
47    skip_assert_initialized!();
48    unsafe {
49        ffi::gst_gl_element_propagate_display_context(
50            element.as_ref().to_glib_none().0,
51            display.as_ref().to_glib_none().0,
52        );
53    }
54}
55
56//#[cfg(feature = "v1_24")]
57//#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
58//#[doc(alias = "gst_gl_swizzle_invert")]
59//pub fn gl_swizzle_invert(swizzle: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 14 }; 4, inversion: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 14 }; 4) {
60//    unsafe { TODO: call ffi:gst_gl_swizzle_invert() }
61//}
62
63//#[cfg(feature = "v1_24")]
64//#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
65//#[doc(alias = "gst_gl_video_format_swizzle")]
66//pub fn gl_video_format_swizzle(video_format: /*Ignored*/gst_video::VideoFormat, swizzle: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 14 }; 4) -> bool {
67//    unsafe { TODO: call ffi:gst_gl_video_format_swizzle() }
68//}
69
70/// Note: this function first searches the first 1 kilobytes for a ``version``
71/// preprocessor directive and then executes [`GLSLVersion::profile_from_string()`][crate::GLSLVersion::profile_from_string()].
72/// ## `s`
73/// string to search for a valid ``version`` string
74///
75/// # Returns
76///
77/// TRUE if a valid ``version`` string was found, FALSE otherwise
78///
79/// ## `version`
80/// resulting [`GLSLVersion`][crate::GLSLVersion]
81///
82/// ## `profile`
83/// resulting [`GLSLProfile`][crate::GLSLProfile]
84#[doc(alias = "gst_glsl_string_get_version_profile")]
85pub fn glsl_string_get_version_profile(s: &str) -> Option<(GLSLVersion, GLSLProfile)> {
86    assert_initialized_main_thread!();
87    unsafe {
88        let mut version = std::mem::MaybeUninit::uninit();
89        let mut profile = std::mem::MaybeUninit::uninit();
90        let ret = from_glib(ffi::gst_glsl_string_get_version_profile(
91            s.to_glib_none().0,
92            version.as_mut_ptr(),
93            profile.as_mut_ptr(),
94        ));
95        if ret {
96            Some((
97                from_glib(version.assume_init()),
98                from_glib(profile.assume_init()),
99            ))
100        } else {
101            None
102        }
103    }
104}