1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
// DO NOT EDIT

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;

    //#[doc(alias = "gst_video_overlay_install_properties")]
    //pub fn install_properties(oclass: /*Ignored*/&mut glib::ObjectClass, last_prop_id: i32) {
    //    unsafe { TODO: call ffi:gst_video_overlay_install_properties() }
    //}
}

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_got_window_handle")]
    //fn got_window_handle(&self, handle: /*Unimplemented*/Basic: UIntPtr) {
    //    unsafe { TODO: call ffi:gst_video_overlay_got_window_handle() }
    //}

    #[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 {}