gstreamer_gl_egl/
gl_display_egl.rs1use glib::{ffi::gpointer, translate::*};
10use gst_gl::GLDisplayType;
11use libc::uintptr_t;
12
13use crate::{ffi, GLDisplayEGL};
14
15impl GLDisplayEGL {
16 #[doc(alias = "gst_gl_display_egl_new_with_egl_display")]
17 #[doc(alias = "new_with_egl_display")]
18 pub unsafe fn with_egl_display(
19 display: uintptr_t,
20 ) -> Result<GLDisplayEGL, glib::error::BoolError> {
21 from_glib_full::<_, Option<GLDisplayEGL>>(ffi::gst_gl_display_egl_new_with_egl_display(
22 display as gpointer,
23 ))
24 .ok_or_else(|| glib::bool_error!("Failed to create new EGL GL display"))
25 }
26
27 #[doc(alias = "gst_gl_display_egl_get_from_native")]
28 #[doc(alias = "get_from_native")]
29 pub unsafe fn from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer {
30 ffi::gst_gl_display_egl_get_from_native(display_type.into_glib(), display)
31 }
32}