gstreamer-rs/gstreamer-gl/egl/src/auto/gl_display_egl.rs

53 lines
1.8 KiB
Rust
Raw Normal View History

2018-11-27 21:52:42 +00:00
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
2018-11-27 21:52:42 +00:00
// DO NOT EDIT
use glib::{prelude::*, translate::*};
2018-11-27 21:52:42 +00:00
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstGLDisplayEGL")]
pub struct GLDisplayEGL(Object<ffi::GstGLDisplayEGL, ffi::GstGLDisplayEGLClass>) @extends gst_gl::GLDisplay, gst::Object;
2018-11-27 21:52:42 +00:00
match fn {
type_ => || ffi::gst_gl_display_egl_get_type(),
2018-11-27 21:52:42 +00:00
}
}
impl GLDisplayEGL {
2021-11-16 14:02:58 +00:00
pub const NONE: Option<&'static GLDisplayEGL> = None;
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_display_egl_new")]
pub fn new() -> Result<GLDisplayEGL, glib::BoolError> {
2018-11-27 21:52:42 +00:00
assert_initialized_main_thread!();
unsafe {
Option::<_>::from_glib_full(ffi::gst_gl_display_egl_new())
.ok_or_else(|| glib::bool_error!("Failed to create EGL display"))
}
2018-11-27 21:52:42 +00:00
}
#[cfg(feature = "v1_24")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
#[doc(alias = "gst_gl_display_egl_new_surfaceless")]
pub fn new_surfaceless() -> Result<GLDisplayEGL, glib::BoolError> {
assert_initialized_main_thread!();
unsafe {
Option::<_>::from_glib_full(ffi::gst_gl_display_egl_new_surfaceless())
.ok_or_else(|| glib::bool_error!("Failed to create surfaceless EGL display"))
}
}
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_gl_display_egl_from_gl_display")]
pub fn from_gl_display(display: &impl IsA<gst_gl::GLDisplay>) -> Option<GLDisplayEGL> {
assert_initialized_main_thread!();
2020-08-11 07:49:37 +00:00
unsafe {
2020-11-22 10:20:20 +00:00
from_glib_full(ffi::gst_gl_display_egl_from_gl_display(
2020-08-11 07:49:37 +00:00
display.as_ref().to_glib_none().0,
))
}
}
2018-11-27 21:52:42 +00:00
}
unsafe impl Send for GLDisplayEGL {}
unsafe impl Sync for GLDisplayEGL {}