2018-11-27 21:52:42 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2018-11-27 21:52:42 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-22 10:20:20 +00:00
|
|
|
use crate::GLContext;
|
2023-01-03 18:56:00 +00:00
|
|
|
use glib::{
|
|
|
|
prelude::*,
|
|
|
|
signal::{connect_raw, SignalHandlerId},
|
|
|
|
translate::*,
|
|
|
|
};
|
|
|
|
use std::{boxed::Box as Box_, mem::transmute};
|
2018-11-27 21:52:42 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstGLBaseFilter")]
|
2021-01-29 21:12:00 +00:00
|
|
|
pub struct GLBaseFilter(Object<ffi::GstGLBaseFilter, ffi::GstGLBaseFilterClass>) @extends gst_base::BaseTransform, gst::Element, gst::Object;
|
2018-11-27 21:52:42 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_gl_base_filter_get_type(),
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-03 17:28:46 +00:00
|
|
|
impl GLBaseFilter {
|
|
|
|
pub const NONE: Option<&'static GLBaseFilter> = None;
|
|
|
|
}
|
2019-01-16 11:32:39 +00:00
|
|
|
|
2021-11-16 14:02:58 +00:00
|
|
|
unsafe impl Send for GLBaseFilter {}
|
|
|
|
unsafe impl Sync for GLBaseFilter {}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::GLBaseFilter>> Sealed for T {}
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
pub trait GLBaseFilterExt: IsA<GLBaseFilter> + sealed::Sealed + 'static {
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_16")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_gl_base_filter_find_gl_context")]
|
2019-04-23 14:32:09 +00:00
|
|
|
fn find_gl_context(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib(ffi::gst_gl_base_filter_find_gl_context(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2019-04-23 14:32:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-05-04 05:51:18 +00:00
|
|
|
#[cfg(feature = "v1_18")]
|
|
|
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))]
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "gst_gl_base_filter_get_gl_context")]
|
|
|
|
#[doc(alias = "get_gl_context")]
|
2021-04-11 19:38:18 +00:00
|
|
|
fn gl_context(&self) -> Option<GLContext> {
|
2020-04-30 16:51:41 +00:00
|
|
|
unsafe {
|
2020-11-22 10:20:20 +00:00
|
|
|
from_glib_full(ffi::gst_gl_base_filter_get_gl_context(
|
2020-04-30 16:51:41 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 19:38:18 +00:00
|
|
|
fn context(&self) -> Option<GLContext> {
|
2023-07-06 13:05:38 +00:00
|
|
|
ObjectExt::property(self.as_ref(), "context")
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 18:20:29 +00:00
|
|
|
#[doc(alias = "context")]
|
2021-05-03 18:35:37 +00:00
|
|
|
fn connect_context_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
2019-06-18 10:12:00 +00:00
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
2021-05-26 22:02:42 +00:00
|
|
|
unsafe extern "C" fn notify_context_trampoline<
|
|
|
|
P: IsA<GLBaseFilter>,
|
|
|
|
F: Fn(&P) + Send + Sync + 'static,
|
|
|
|
>(
|
2020-11-22 10:20:20 +00:00
|
|
|
this: *mut ffi::GstGLBaseFilter,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2021-05-26 22:02:42 +00:00
|
|
|
) {
|
2019-06-18 10:10:46 +00:00
|
|
|
let f: &F = &*(f as *const F);
|
2021-06-21 21:07:45 +00:00
|
|
|
f(GLBaseFilter::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2018-11-27 21:52:42 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::context\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_context_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
2018-11-27 21:52:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 18:20:29 +00:00
|
|
|
|
|
|
|
impl<O: IsA<GLBaseFilter>> GLBaseFilterExt for O {}
|