diff --git a/Gir_GstBase.toml b/Gir_GstBase.toml index ba530b612..39ac6d5a5 100644 --- a/Gir_GstBase.toml +++ b/Gir_GstBase.toml @@ -19,7 +19,6 @@ generate = [ "GstBase.BaseSink", "GstBase.BaseTransform", "GstBase.PushSrc", - "GstBase.AggregatorPad", ] manual = [ @@ -86,12 +85,22 @@ status = "generate" [[object]] name = "GstBase.Aggregator" status = "generate" +version = "1.14" [[object.function]] name = "finish_buffer" # Takes ownership ignore = true + [[object.property]] + name = "latency" + version = "1.14" + +[[object]] +name = "GstBase.AggregatorPad" +status = "generate" +version = "1.14" + [[object]] name = "GstBase.*" status = "generate" diff --git a/gstreamer-base/src/auto/aggregator.rs b/gstreamer-base/src/auto/aggregator.rs index 670da140e..e48453d3f 100644 --- a/gstreamer-base/src/auto/aggregator.rs +++ b/gstreamer-base/src/auto/aggregator.rs @@ -35,48 +35,59 @@ unsafe impl Send for Aggregator {} unsafe impl Sync for Aggregator {} pub trait AggregatorExt { + //#[cfg(any(feature = "v1_14", feature = "dox"))] //fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams); + #[cfg(any(feature = "v1_14", feature = "dox"))] fn get_buffer_pool(&self) -> Option; + #[cfg(any(feature = "v1_14", feature = "dox"))] fn get_latency(&self) -> gst::ClockTime; + #[cfg(any(feature = "v1_14", feature = "dox"))] fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime); + #[cfg(any(feature = "v1_14", feature = "dox"))] fn set_src_caps(&self, caps: &gst::Caps); fn get_property_start_time(&self) -> u64; fn set_property_start_time(&self, start_time: u64); + #[cfg(any(feature = "v1_14", feature = "dox"))] fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId; fn connect_property_start_time_notify(&self, f: F) -> SignalHandlerId; } impl + IsA> AggregatorExt for O { + //#[cfg(any(feature = "v1_14", feature = "dox"))] //fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams) { // unsafe { TODO: call ffi::gst_aggregator_get_allocator() } //} + #[cfg(any(feature = "v1_14", feature = "dox"))] fn get_buffer_pool(&self) -> Option { unsafe { from_glib_full(ffi::gst_aggregator_get_buffer_pool(self.to_glib_none().0)) } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn get_latency(&self) -> gst::ClockTime { unsafe { from_glib(ffi::gst_aggregator_get_latency(self.to_glib_none().0)) } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime) { unsafe { ffi::gst_aggregator_set_latency(self.to_glib_none().0, min_latency.to_glib(), max_latency.to_glib()); } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn set_src_caps(&self, caps: &gst::Caps) { unsafe { ffi::gst_aggregator_set_src_caps(self.to_glib_none().0, caps.to_glib_none().0); @@ -97,6 +108,7 @@ impl + IsA> AggregatorExt for O { } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn connect_property_latency_notify(&self, f: F) -> SignalHandlerId { unsafe { let f: Box_> = Box_::new(Box_::new(f)); @@ -114,6 +126,7 @@ impl + IsA> AggregatorExt for O { } } +#[cfg(any(feature = "v1_14", feature = "dox"))] unsafe extern "C" fn notify_latency_trampoline

(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) where P: IsA { let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f); diff --git a/gstreamer-base/src/auto/aggregator_pad.rs b/gstreamer-base/src/auto/aggregator_pad.rs index 9925362e1..b67400158 100644 --- a/gstreamer-base/src/auto/aggregator_pad.rs +++ b/gstreamer-base/src/auto/aggregator_pad.rs @@ -27,19 +27,24 @@ unsafe impl Send for AggregatorPad {} unsafe impl Sync for AggregatorPad {} pub trait AggregatorPadExt { + #[cfg(any(feature = "v1_14", feature = "dox"))] fn drop_buffer(&self) -> bool; #[cfg(any(feature = "v1_14_1", feature = "dox"))] fn has_buffer(&self) -> bool; + #[cfg(any(feature = "v1_14", feature = "dox"))] fn is_eos(&self) -> bool; + #[cfg(any(feature = "v1_14", feature = "dox"))] fn peek_buffer(&self) -> Option; + #[cfg(any(feature = "v1_14", feature = "dox"))] fn pop_buffer(&self) -> Option; } impl> AggregatorPadExt for O { + #[cfg(any(feature = "v1_14", feature = "dox"))] fn drop_buffer(&self) -> bool { unsafe { from_glib(ffi::gst_aggregator_pad_drop_buffer(self.to_glib_none().0)) @@ -53,18 +58,21 @@ impl> AggregatorPadExt for O { } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn is_eos(&self) -> bool { unsafe { from_glib(ffi::gst_aggregator_pad_is_eos(self.to_glib_none().0)) } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn peek_buffer(&self) -> Option { unsafe { from_glib_full(ffi::gst_aggregator_pad_peek_buffer(self.to_glib_none().0)) } } + #[cfg(any(feature = "v1_14", feature = "dox"))] fn pop_buffer(&self) -> Option { unsafe { from_glib_full(ffi::gst_aggregator_pad_pop_buffer(self.to_glib_none().0)) diff --git a/gstreamer-base/src/auto/mod.rs b/gstreamer-base/src/auto/mod.rs index a2c9ee430..0bce4e707 100644 --- a/gstreamer-base/src/auto/mod.rs +++ b/gstreamer-base/src/auto/mod.rs @@ -5,12 +5,18 @@ mod adapter; pub use self::adapter::Adapter; +#[cfg(any(feature = "v1_14", feature = "dox"))] mod aggregator; +#[cfg(any(feature = "v1_14", feature = "dox"))] pub use self::aggregator::Aggregator; +#[cfg(any(feature = "v1_14", feature = "dox"))] pub use self::aggregator::AggregatorExt; +#[cfg(any(feature = "v1_14", feature = "dox"))] mod aggregator_pad; +#[cfg(any(feature = "v1_14", feature = "dox"))] pub use self::aggregator_pad::AggregatorPad; +#[cfg(any(feature = "v1_14", feature = "dox"))] pub use self::aggregator_pad::AggregatorPadExt; mod base_sink; @@ -32,7 +38,9 @@ pub mod functions; #[doc(hidden)] pub mod traits { + #[cfg(any(feature = "v1_14", feature = "dox"))] pub use super::AggregatorExt; + #[cfg(any(feature = "v1_14", feature = "dox"))] pub use super::AggregatorPadExt; pub use super::BaseSinkExt; pub use super::BaseSrcExt; diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index e928dd379..85c1b5796 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -40,6 +40,7 @@ pub use functions::*; mod adapter; mod flow_combiner; pub use flow_combiner::*; +#[cfg(any(feature = "v1_14", feature = "dox"))] mod aggregator; mod base_sink; mod base_src; @@ -51,6 +52,7 @@ pub mod prelude { pub use glib::prelude::*; pub use gst::prelude::*; + #[cfg(any(feature = "v1_14", feature = "dox"))] pub use aggregator::AggregatorExtManual; pub use auto::traits::*; pub use base_sink::BaseSinkExtManual;