diff --git a/gstreamer-gl/Gir.toml b/gstreamer-gl/Gir.toml index b53da8406..b55ec87de 100644 --- a/gstreamer-gl/Gir.toml +++ b/gstreamer-gl/Gir.toml @@ -34,6 +34,7 @@ generate = [ # Objects #"GstGL.GLBufferPool", "GstGL.GLBaseMemoryAllocator", + "GstGL.GLBaseSrc", "GstGL.GLMemoryAllocator", #"GstGL.GLMemoryPBOAllocator", #"GstGL.GLRenderbufferAllocator", @@ -51,6 +52,7 @@ manual = [ "Gst.Memory", "Gst.Object", "Gst.PadDirection", + "GstBase.BaseSrc", "GstBase.BaseTransform", "GstBase.PushSrc", "GstGL.GLBaseMemory", diff --git a/gstreamer-gl/src/auto/gl_base_src.rs b/gstreamer-gl/src/auto/gl_base_src.rs new file mode 100644 index 000000000..f42a3a57d --- /dev/null +++ b/gstreamer-gl/src/auto/gl_base_src.rs @@ -0,0 +1,96 @@ +// 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::object::Cast; +use glib::object::IsA; +use glib::signal::connect_raw; +use glib::signal::SignalHandlerId; +use glib::translate::*; +use glib::StaticType; +use glib::ToValue; +use std::boxed::Box as Box_; +use std::mem::transmute; + +glib::wrapper! { + pub struct GLBaseSrc(Object) @extends gst_base::PushSrc, gst_base::BaseSrc, gst::Element, gst::Object; + + match fn { + type_ => || ffi::gst_gl_base_src_get_type(), + } +} + +unsafe impl Send for GLBaseSrc {} +unsafe impl Sync for GLBaseSrc {} + +pub const NONE_GL_BASE_SRC: Option<&GLBaseSrc> = None; + +pub trait GLBaseSrcExt: 'static { + #[doc(alias = "get_property_timestamp_offset")] + fn timestamp_offset(&self) -> i64; + + #[doc(alias = "set_property_timestamp_offset")] + fn set_timestamp_offset(&self, timestamp_offset: i64); + + fn connect_property_timestamp_offset_notify( + &self, + f: F, + ) -> SignalHandlerId; +} + +impl> GLBaseSrcExt for O { + fn timestamp_offset(&self) -> i64 { + unsafe { + let mut value = glib::Value::from_type(::static_type()); + glib::gobject_ffi::g_object_get_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"timestamp-offset\0".as_ptr() as *const _, + value.to_glib_none_mut().0, + ); + value + .get() + .expect("Return Value for property `timestamp-offset` getter") + } + } + + fn set_timestamp_offset(&self, timestamp_offset: i64) { + unsafe { + glib::gobject_ffi::g_object_set_property( + self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, + b"timestamp-offset\0".as_ptr() as *const _, + timestamp_offset.to_value().to_glib_none().0, + ); + } + } + + fn connect_property_timestamp_offset_notify( + &self, + f: F, + ) -> SignalHandlerId { + unsafe extern "C" fn notify_timestamp_offset_trampoline< + P, + F: Fn(&P) + Send + Sync + 'static, + >( + this: *mut ffi::GstGLBaseSrc, + _param_spec: glib::ffi::gpointer, + f: glib::ffi::gpointer, + ) where + P: IsA, + { + let f: &F = &*(f as *const F); + f(&GLBaseSrc::from_glib_borrow(this).unsafe_cast_ref()) + } + unsafe { + let f: Box_ = Box_::new(f); + connect_raw( + self.as_ptr() as *mut _, + b"notify::timestamp-offset\0".as_ptr() as *const _, + Some(transmute::<_, unsafe extern "C" fn()>( + notify_timestamp_offset_trampoline:: as *const (), + )), + Box_::into_raw(f), + ) + } + } +} diff --git a/gstreamer-gl/src/auto/mod.rs b/gstreamer-gl/src/auto/mod.rs index 2e32a5301..1a1da3415 100644 --- a/gstreamer-gl/src/auto/mod.rs +++ b/gstreamer-gl/src/auto/mod.rs @@ -9,6 +9,13 @@ pub use self::gl_base_filter::{GLBaseFilter, NONE_GL_BASE_FILTER}; mod gl_base_memory_allocator; pub use self::gl_base_memory_allocator::{GLBaseMemoryAllocator, NONE_GL_BASE_MEMORY_ALLOCATOR}; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +mod gl_base_src; +#[cfg(any(feature = "v1_18", feature = "dox"))] +#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] +pub use self::gl_base_src::{GLBaseSrc, NONE_GL_BASE_SRC}; + mod gl_color_convert; pub use self::gl_color_convert::GLColorConvert; @@ -71,6 +78,9 @@ pub use self::flags::GLAPI; #[doc(hidden)] pub mod traits { pub use super::gl_base_filter::GLBaseFilterExt; + #[cfg(any(feature = "v1_18", feature = "dox"))] + #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))] + pub use super::gl_base_src::GLBaseSrcExt; pub use super::gl_context::GLContextExt; pub use super::gl_display::GLDisplayExt; pub use super::gl_filter::GLFilterExt;