gl/egl: Appropriately mark display functions as manual

Two functions were manually implemented but not marked as such, leaving
unneeded "TODO call ffi:xxx" markers in the codebase.  Also improve the
aliases on the manual implementations.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1336>
This commit is contained in:
Marijn Suijten 2023-10-28 10:49:22 +02:00
parent 5741b6a52e
commit 1ec4560b62
3 changed files with 11 additions and 12 deletions

View file

@ -59,3 +59,11 @@ status = "generate"
name = "new" name = "new"
[object.function.return] [object.function.return]
nullable_return_is_error = "Failed to create EGL display" nullable_return_is_error = "Failed to create EGL display"
[[object.function]]
name = "new_with_egl_display"
manual = true
[[object.function]]
name = "get_from_native"
manual = true

View file

@ -26,12 +26,6 @@ impl GLDisplayEGL {
} }
} }
//#[doc(alias = "gst_gl_display_egl_new_with_egl_display")]
//#[doc(alias = "new_with_egl_display")]
//pub fn with_egl_display(display: /*Unimplemented*/Option<Basic: Pointer>) -> GLDisplayEGL {
// unsafe { TODO: call ffi:gst_gl_display_egl_new_with_egl_display() }
//}
#[doc(alias = "gst_gl_display_egl_from_gl_display")] #[doc(alias = "gst_gl_display_egl_from_gl_display")]
pub fn from_gl_display(display: &impl IsA<gst_gl::GLDisplay>) -> Option<GLDisplayEGL> { pub fn from_gl_display(display: &impl IsA<gst_gl::GLDisplay>) -> Option<GLDisplayEGL> {
assert_initialized_main_thread!(); assert_initialized_main_thread!();
@ -41,12 +35,6 @@ impl GLDisplayEGL {
)) ))
} }
} }
//#[doc(alias = "gst_gl_display_egl_get_from_native")]
//#[doc(alias = "get_from_native")]
//pub fn from_native(type_: /*Ignored*/gst_gl::GLDisplayType, display: /*Unimplemented*/Basic: UIntPtr) -> /*Unimplemented*/Option<Basic: Pointer> {
// unsafe { TODO: call ffi:gst_gl_display_egl_get_from_native() }
//}
} }
unsafe impl Send for GLDisplayEGL {} unsafe impl Send for GLDisplayEGL {}

View file

@ -13,6 +13,8 @@ use libc::uintptr_t;
use crate::GLDisplayEGL; use crate::GLDisplayEGL;
impl GLDisplayEGL { impl GLDisplayEGL {
#[doc(alias = "gst_gl_display_egl_new_with_egl_display")]
#[doc(alias = "new_with_egl_display")]
pub unsafe fn with_egl_display( pub unsafe fn with_egl_display(
display: uintptr_t, display: uintptr_t,
) -> Result<GLDisplayEGL, glib::error::BoolError> { ) -> Result<GLDisplayEGL, glib::error::BoolError> {
@ -22,6 +24,7 @@ impl GLDisplayEGL {
.ok_or_else(|| glib::bool_error!("Failed to create new EGL GL display")) .ok_or_else(|| glib::bool_error!("Failed to create new EGL GL display"))
} }
#[doc(alias = "gst_gl_display_egl_get_from_native")]
#[doc(alias = "get_from_native")] #[doc(alias = "get_from_native")]
pub unsafe fn from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer { pub unsafe fn from_native(display_type: GLDisplayType, display: uintptr_t) -> gpointer {
ffi::gst_gl_display_egl_get_from_native(display_type.into_glib(), display) ffi::gst_gl_display_egl_get_from_native(display_type.into_glib(), display)