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
8pub trait VideoOverlayExtManual: IsA<VideoOverlay> + 'static {
9    /// This will call the video overlay's set_window_handle method. You
10    /// should use this method to tell to an overlay to display video output to a
11    /// specific window (e.g. an XWindow on X11). Passing 0 as the `handle` will
12    /// tell the overlay to stop using that window and create an internal one.
13    /// ## `handle`
14    /// a handle referencing the window.
15    unsafe fn set_window_handle(&self, handle: uintptr_t) {
16        ffi::gst_video_overlay_set_window_handle(self.as_ref().to_glib_none().0, handle)
17    }
18
19    unsafe fn got_window_handle(&self, handle: uintptr_t) {
20        ffi::gst_video_overlay_got_window_handle(self.as_ref().to_glib_none().0, handle)
21    }
22}
23
24impl<O: IsA<VideoOverlay>> VideoOverlayExtManual for O {}
25
26#[doc(alias = "gst_is_video_overlay_prepare_window_handle_message")]
27pub fn is_video_overlay_prepare_window_handle_message(msg: &gst::MessageRef) -> bool {
28    skip_assert_initialized!();
29    unsafe {
30        from_glib(ffi::gst_is_video_overlay_prepare_window_handle_message(
31            msg.as_mut_ptr(),
32        ))
33    }
34}