gstreamer-rs/gstreamer-video/src/auto/video_sink.rs

83 lines
2.5 KiB
Rust
Raw Normal View History

2020-06-12 14:05:46 +00:00
// 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)
2020-06-12 14:05:46 +00:00
// DO NOT EDIT
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::StaticType;
2021-04-19 16:24:43 +00:00
use glib::ToValue;
2020-06-12 14:05:46 +00:00
use std::boxed::Box as Box_;
use std::mem::transmute;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
#[doc(alias = "GstVideoSink")]
2020-11-22 09:50:37 +00:00
pub struct VideoSink(Object<ffi::GstVideoSink, ffi::GstVideoSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object;
2020-06-12 14:05:46 +00:00
match fn {
type_ => || ffi::gst_video_sink_get_type(),
2020-06-12 14:05:46 +00:00
}
}
unsafe impl Send for VideoSink {}
unsafe impl Sync for VideoSink {}
2021-11-03 17:28:46 +00:00
impl VideoSink {
pub const NONE: Option<&'static VideoSink> = None;
}
2020-06-12 14:05:46 +00:00
pub trait VideoSinkExt: 'static {
#[doc(alias = "show-preroll-frame")]
2021-04-11 19:38:18 +00:00
fn shows_preroll_frame(&self) -> bool;
2020-06-12 14:05:46 +00:00
#[doc(alias = "show-preroll-frame")]
2021-04-11 19:38:18 +00:00
fn set_show_preroll_frame(&self, show_preroll_frame: bool);
2020-06-12 14:05:46 +00:00
#[doc(alias = "show-preroll-frame")]
fn connect_show_preroll_frame_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-06-12 14:05:46 +00:00
&self,
f: F,
) -> SignalHandlerId;
}
impl<O: IsA<VideoSink>> VideoSinkExt for O {
2021-04-11 19:38:18 +00:00
fn shows_preroll_frame(&self) -> bool {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::property(self.as_ref(), "show-preroll-frame")
2020-06-12 14:05:46 +00:00
}
2021-04-11 19:38:18 +00:00
fn set_show_preroll_frame(&self, show_preroll_frame: bool) {
2021-11-06 17:31:52 +00:00
glib::ObjectExt::set_property(self.as_ref(), "show-preroll-frame", &show_preroll_frame)
2020-06-12 14:05:46 +00:00
}
fn connect_show_preroll_frame_notify<F: Fn(&Self) + Send + Sync + 'static>(
2020-06-12 14:05:46 +00:00
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_show_preroll_frame_trampoline<
P: IsA<VideoSink>,
2020-06-12 14:05:46 +00:00
F: Fn(&P) + Send + Sync + 'static,
>(
2020-11-22 09:50:37 +00:00
this: *mut ffi::GstVideoSink,
_param_spec: glib::ffi::gpointer,
f: glib::ffi::gpointer,
) {
2020-06-12 14:05:46 +00:00
let f: &F = &*(f as *const F);
2021-06-21 21:07:45 +00:00
f(VideoSink::from_glib_borrow(this).unsafe_cast_ref())
2020-06-12 14:05:46 +00:00
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(
self.as_ptr() as *mut _,
b"notify::show-preroll-frame\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(
notify_show_preroll_frame_trampoline::<Self, F> as *const (),
)),
Box_::into_raw(f),
)
}
}
}