Commit 6cf34b1b authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Add VideoOverlay::prepare_window_handle() and got_window_handle()

parent 0ddab168
......@@ -59,8 +59,3 @@ status = "generate"
name = "set_render_rectangle"
[object.function.return]
bool_return_is_error = "Failed to set render rectangle"
[[object.function]]
name = "prepare_window_handle"
# to be called by subclasses
ignore = true
......@@ -39,6 +39,8 @@ pub trait VideoOverlayExt {
fn handle_events(&self, handle_events: bool);
fn prepare_window_handle(&self);
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError>;
//fn set_window_handle(&self, handle: /*Unimplemented*/Fundamental: UIntPtr);
......@@ -61,6 +63,12 @@ impl<O: IsA<VideoOverlay>> VideoOverlayExt for O {
}
}
fn prepare_window_handle(&self) {
unsafe {
ffi::gst_video_overlay_prepare_window_handle(self.to_glib_none().0);
}
}
fn set_render_rectangle(&self, x: i32, y: i32, width: i32, height: i32) -> Result<(), glib::error::BoolError> {
unsafe {
glib::error::BoolError::from_glib(ffi::gst_video_overlay_set_render_rectangle(self.to_glib_none().0, x, y, width, height), "Failed to set render rectangle")
......
......@@ -14,10 +14,15 @@ use glib::IsA;
pub trait VideoOverlayExtManual {
unsafe fn set_window_handle(&self, handle: uintptr_t);
unsafe fn got_window_handle(&self, handle: uintptr_t);
}
impl<O: IsA<VideoOverlay>> VideoOverlayExtManual for O {
unsafe fn set_window_handle(&self, handle: uintptr_t) {
ffi::gst_video_overlay_set_window_handle(self.to_glib_none().0, handle)
}
unsafe fn got_window_handle(&self, handle: uintptr_t) {
ffi::gst_video_overlay_got_window_handle(self.to_glib_none().0, handle)
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment