mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
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:
parent
fd6bbf5929
commit
a7090b2a03
1 changed files with 9 additions and 3 deletions
|
@ -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")),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue