2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2017-08-13 17:22:29 +00:00
|
|
|
|
2020-11-22 10:32:04 +00:00
|
|
|
use crate::PlayerVideoOverlayVideoRenderer;
|
2021-04-26 12:15:53 +00:00
|
|
|
use glib::prelude::*;
|
2017-08-13 17:22:29 +00:00
|
|
|
use glib::translate::*;
|
|
|
|
|
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
use libc::uintptr_t;
|
|
|
|
|
|
|
|
impl PlayerVideoOverlayVideoRenderer {
|
|
|
|
pub unsafe fn new(window_handle: uintptr_t) -> PlayerVideoOverlayVideoRenderer {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
|
2020-11-22 10:32:04 +00:00
|
|
|
from_glib_full(
|
|
|
|
ffi::gst_player_video_overlay_video_renderer_new(window_handle as *mut _) as *mut _,
|
|
|
|
)
|
2017-08-13 17:22:29 +00:00
|
|
|
}
|
|
|
|
|
2020-06-11 08:53:35 +00:00
|
|
|
pub unsafe fn with_handle_and_sink<P: IsA<gst::Element>>(
|
2017-08-13 17:22:29 +00:00
|
|
|
window_handle: uintptr_t,
|
|
|
|
video_sink: &P,
|
|
|
|
) -> PlayerVideoOverlayVideoRenderer {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
|
2020-11-22 10:32:04 +00:00
|
|
|
from_glib_full(ffi::gst_player_video_overlay_video_renderer_new_with_sink(
|
|
|
|
window_handle as *mut _,
|
|
|
|
video_sink.as_ref().to_glib_none().0,
|
|
|
|
) as *mut _)
|
2017-08-13 17:22:29 +00:00
|
|
|
}
|
|
|
|
|
2021-05-19 20:35:47 +00:00
|
|
|
#[doc(alias = "gst_player_video_overlay_video_renderer_new_with_sink")]
|
2020-06-11 08:53:35 +00:00
|
|
|
pub fn with_sink<P: IsA<gst::Element>>(video_sink: &P) -> PlayerVideoOverlayVideoRenderer {
|
2017-08-13 17:22:29 +00:00
|
|
|
assert_initialized_main_thread!();
|
|
|
|
|
|
|
|
unsafe {
|
2020-11-22 10:32:04 +00:00
|
|
|
from_glib_full(ffi::gst_player_video_overlay_video_renderer_new_with_sink(
|
|
|
|
ptr::null_mut(),
|
|
|
|
video_sink.as_ref().to_glib_none().0,
|
|
|
|
) as *mut _)
|
2017-08-13 17:22:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-02 09:41:18 +00:00
|
|
|
#[doc(alias = "get_window_handle")]
|
2021-04-11 19:39:50 +00:00
|
|
|
pub unsafe fn window_handle(&self) -> uintptr_t {
|
2020-11-22 10:32:04 +00:00
|
|
|
ffi::gst_player_video_overlay_video_renderer_get_window_handle(self.to_glib_none().0)
|
|
|
|
as uintptr_t
|
2017-08-13 17:22:29 +00:00
|
|
|
}
|
|
|
|
|
2017-12-16 09:18:00 +00:00
|
|
|
pub unsafe fn set_window_handle(&self, window_handle: uintptr_t) {
|
2020-11-22 10:32:04 +00:00
|
|
|
ffi::gst_player_video_overlay_video_renderer_set_window_handle(
|
2017-08-13 17:22:29 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
window_handle as *mut _,
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|