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::{prelude::*, translate::*};
8
9glib::wrapper! {
10 #[doc(alias = "GstGLDisplayEGL")]
11 pub struct GLDisplayEGL(Object<ffi::GstGLDisplayEGL, ffi::GstGLDisplayEGLClass>) @extends gst_gl::GLDisplay, gst::Object;
12
13 match fn {
14 type_ => || ffi::gst_gl_display_egl_get_type(),
15 }
16}
17
18impl GLDisplayEGL {
19 pub const NONE: Option<&'static GLDisplayEGL> = None;
20
21 #[doc(alias = "gst_gl_display_egl_new")]
22 pub fn new() -> Result<GLDisplayEGL, glib::BoolError> {
23 assert_initialized_main_thread!();
24 unsafe {
25 Option::<_>::from_glib_full(ffi::gst_gl_display_egl_new())
26 .ok_or_else(|| glib::bool_error!("Failed to create EGL display"))
27 }
28 }
29
30 #[cfg(feature = "v1_24")]
31 #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
32 #[doc(alias = "gst_gl_display_egl_new_surfaceless")]
33 pub fn new_surfaceless() -> Result<GLDisplayEGL, glib::BoolError> {
34 assert_initialized_main_thread!();
35 unsafe {
36 Option::<_>::from_glib_full(ffi::gst_gl_display_egl_new_surfaceless())
37 .ok_or_else(|| glib::bool_error!("Failed to create surfaceless EGL display"))
38 }
39 }
40
41 #[doc(alias = "gst_gl_display_egl_from_gl_display")]
42 pub fn from_gl_display(display: &impl IsA<gst_gl::GLDisplay>) -> Option<GLDisplayEGL> {
43 assert_initialized_main_thread!();
44 unsafe {
45 from_glib_full(ffi::gst_gl_display_egl_from_gl_display(
46 display.as_ref().to_glib_none().0,
47 ))
48 }
49 }
50}
51
52unsafe impl Send for GLDisplayEGL {}
53unsafe impl Sync for GLDisplayEGL {}
54