gstreamer-gl/wayland: Change a function from returning an Option to Results

Partial work for:
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/issues/216
This commit is contained in:
Tony Jinwoo Ahn 2019-11-23 12:51:38 +00:00 committed by Sebastian Dröge
parent fd6bbf5929
commit a7090b2a03

View file

@ -13,9 +13,15 @@ use libc::uintptr_t;
use GLDisplayWayland;
impl GLDisplayWayland {
pub unsafe fn new_with_display(display: uintptr_t) -> Option<GLDisplayWayland> {
from_glib_full(gst_gl_sys::gst_gl_display_wayland_new_with_display(
pub unsafe fn new_with_display(
display: uintptr_t,
) -> Result<GLDisplayWayland, glib::error::BoolError> {
let result = from_glib_full(gst_gl_sys::gst_gl_display_wayland_new_with_display(
display as gpointer,
))
));
match result {
Some(d) => Ok(d),
None => Err(glib_bool_error!("Failed to create new Wayland GL display")),
}
}
}