gstreamer_video/
video_overlay.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use glib::{prelude::*, translate::*};
4use libc::uintptr_t;
5
6use crate::{ffi, VideoOverlay};
7
8mod sealed {
9    pub trait Sealed {}
10    impl<T: super::IsA<super::VideoOverlay>> Sealed for T {}
11}
12
13pub 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.
20    unsafe 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    }
23
24    unsafe 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}
28
29impl<O: IsA<VideoOverlay>> VideoOverlayExtManual for O {}
30
31#[doc(alias = "gst_is_video_overlay_prepare_window_handle_message")]
32pub fn is_video_overlay_prepare_window_handle_message(msg: &gst::MessageRef) -> bool {
33    skip_assert_initialized!();
34    unsafe {
35        from_glib(ffi::gst_is_video_overlay_prepare_window_handle_message(
36            msg.as_mut_ptr(),
37        ))
38    }
39}