use glib::{prelude::*, translate::*};
glib::wrapper! {
#[doc(alias = "GstVideoOverlay")]
pub struct VideoOverlay(Interface<ffi::GstVideoOverlay, ffi::GstVideoOverlayInterface>);
match fn {
type_ => || ffi::gst_video_overlay_get_type(),
}
}
impl VideoOverlay {
pub const NONE: Option<&'static VideoOverlay> = None;
}
unsafe impl Send for VideoOverlay {}
unsafe impl Sync for VideoOverlay {}
mod sealed {
pub trait Sealed {}
impl<T: super::IsA<super::VideoOverlay>> Sealed for T {}
}
pub trait VideoOverlayExt: IsA<VideoOverlay> + sealed::Sealed + 'static {
#[doc(alias = "gst_video_overlay_expose")]
fn expose(&self) {
unsafe {
ffi::gst_video_overlay_expose(self.as_ref().to_glib_none().0);
}
}
#[doc(alias = "gst_video_overlay_handle_events")]
fn handle_events(&self, handle_events: bool) {
unsafe {
ffi::gst_video_overlay_handle_events(
self.as_ref().to_glib_none().0,
handle_events.into_glib(),
);
}
}
#[doc(alias = "gst_video_overlay_prepare_window_handle")]
fn prepare_window_handle(&self) {
unsafe {
ffi::gst_video_overlay_prepare_window_handle(self.as_ref().to_glib_none().0);
}
}
#[doc(alias = "gst_video_overlay_set_render_rectangle")]
fn set_render_rectangle(
&self,
x: i32,
y: i32,
width: i32,
height: i32,
) -> Result<(), glib::error::BoolError> {
unsafe {
glib::result_from_gboolean!(
ffi::gst_video_overlay_set_render_rectangle(
self.as_ref().to_glib_none().0,
x,
y,
width,
height
),
"Failed to set render rectangle"
)
}
}
}
impl<O: IsA<VideoOverlay>> VideoOverlayExt for O {}