1// Take a look at the license at the top of the repository in the LICENSE file.
23use glib::{prelude::*, translate::*};
4use libc::uintptr_t;
56use crate::{ffi, VideoOverlay};
78mod sealed {
9pub trait Sealed {}
10impl<T: super::IsA<super::VideoOverlay>> Sealed for T {}
11}
1213pub trait VideoOverlayExtManual: sealed::Sealed + IsA<VideoOverlay> + 'static {
14/// This will call the video overlay's set_window_handle method. You
15 /// should use this method to tell to an overlay to display video output to a
16 /// specific window (e.g. an XWindow on X11). Passing 0 as the `handle` will
17 /// tell the overlay to stop using that window and create an internal one.
18 /// ## `handle`
19 /// a handle referencing the window.
20unsafe fn set_window_handle(&self, handle: uintptr_t) {
21 ffi::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
22 }
2324unsafe fn got_window_handle(&self, handle: uintptr_t) {
25 ffi::gst_video_overlay_got_window_handle(self.as_ref().to_glib_none().0, handle)
26 }
27}
2829impl<O: IsA<VideoOverlay>> VideoOverlayExtManual for O {}
3031#[doc(alias = "gst_is_video_overlay_prepare_window_handle_message")]
32pub fn is_video_overlay_prepare_window_handle_message(msg: &gst::MessageRef) -> bool {
33skip_assert_initialized!();
34unsafe {
35 from_glib(ffi::gst_is_video_overlay_prepare_window_handle_message(
36 msg.as_mut_ptr(),
37 ))
38 }
39}