// 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 #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] use crate::RTPHeaderExtension; use glib::{ prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*, }; use std::boxed::Box as Box_; glib::wrapper! { #[doc(alias = "GstRTPBaseDepayload")] pub struct RTPBaseDepayload(Object) @extends gst::Element, gst::Object; match fn { type_ => || ffi::gst_rtp_base_depayload_get_type(), } } impl RTPBaseDepayload { pub const NONE: Option<&'static RTPBaseDepayload> = None; } unsafe impl Send for RTPBaseDepayload {} unsafe impl Sync for RTPBaseDepayload {} mod sealed { pub trait Sealed {} impl> Sealed for T {} } pub trait RTPBaseDepayloadExt: IsA + sealed::Sealed + 'static { #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_rtp_base_depayload_delayed")] fn delayed(&self) { unsafe { ffi::gst_rtp_base_depayload_delayed(self.as_ref().to_glib_none().0); } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_rtp_base_depayload_dropped")] fn dropped(&self) { unsafe { ffi::gst_rtp_base_depayload_dropped(self.as_ref().to_glib_none().0); } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_rtp_base_depayload_flush")] fn flush(&self, keep_current: bool) { unsafe { ffi::gst_rtp_base_depayload_flush( self.as_ref().to_glib_none().0, keep_current.into_glib(), ); } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_rtp_base_depayload_is_aggregate_hdrext_enabled")] fn is_aggregate_hdrext_enabled(&self) -> bool { unsafe { from_glib(ffi::gst_rtp_base_depayload_is_aggregate_hdrext_enabled( self.as_ref().to_glib_none().0, )) } } #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[doc(alias = "gst_rtp_base_depayload_is_source_info_enabled")] fn is_source_info_enabled(&self) -> bool { unsafe { from_glib(ffi::gst_rtp_base_depayload_is_source_info_enabled( self.as_ref().to_glib_none().0, )) } } #[doc(alias = "gst_rtp_base_depayload_push")] fn push(&self, out_buf: gst::Buffer) -> Result { unsafe { try_from_glib(ffi::gst_rtp_base_depayload_push( self.as_ref().to_glib_none().0, out_buf.into_glib_ptr(), )) } } #[doc(alias = "gst_rtp_base_depayload_push_list")] fn push_list(&self, out_list: gst::BufferList) -> Result { unsafe { try_from_glib(ffi::gst_rtp_base_depayload_push_list( self.as_ref().to_glib_none().0, out_list.into_glib_ptr(), )) } } #[cfg(feature = "v1_24")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))] #[doc(alias = "gst_rtp_base_depayload_set_aggregate_hdrext_enabled")] fn set_aggregate_hdrext_enabled(&self, enable: bool) { unsafe { ffi::gst_rtp_base_depayload_set_aggregate_hdrext_enabled( self.as_ref().to_glib_none().0, enable.into_glib(), ); } } #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[doc(alias = "gst_rtp_base_depayload_set_source_info_enabled")] fn set_source_info_enabled(&self, enable: bool) { unsafe { ffi::gst_rtp_base_depayload_set_source_info_enabled( self.as_ref().to_glib_none().0, enable.into_glib(), ); } } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "auto-header-extension")] fn is_auto_header_extension(&self) -> bool { ObjectExt::property(self.as_ref(), "auto-header-extension") } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "auto-header-extension")] fn set_auto_header_extension(&self, auto_header_extension: bool) { ObjectExt::set_property( self.as_ref(), "auto-header-extension", auto_header_extension, ) } #[cfg(feature = "v1_18")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))] #[doc(alias = "max-reorder")] fn max_reorder(&self) -> i32 { ObjectExt::property(self.as_ref(), "max-reorder") } #[cfg(feature = "v1_18")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))] #[doc(alias = "max-reorder")] fn set_max_reorder(&self, max_reorder: i32) { ObjectExt::set_property(self.as_ref(), "max-reorder", max_reorder) } #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[doc(alias = "source-info")] fn is_source_info(&self) -> bool { ObjectExt::property(self.as_ref(), "source-info") } #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[doc(alias = "source-info")] fn set_source_info(&self, source_info: bool) { ObjectExt::set_property(self.as_ref(), "source-info", source_info) } fn stats(&self) -> Option { ObjectExt::property(self.as_ref(), "stats") } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "add-extension")] fn connect_add_extension( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn add_extension_trampoline< P: IsA, F: Fn(&P, &RTPHeaderExtension) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, ext: *mut ffi::GstRTPHeaderExtension, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f( RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(), &from_glib_full(ext), ) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"add-extension\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( add_extension_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] fn emit_add_extension(&self, ext: &RTPHeaderExtension) { self.emit_by_name::<()>("add-extension", &[&ext]); } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "clear-extensions")] fn connect_clear_extensions( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn clear_extensions_trampoline< P: IsA, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"clear-extensions\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( clear_extensions_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] fn emit_clear_extensions(&self) { self.emit_by_name::<()>("clear-extensions", &[]); } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "request-extension")] fn connect_request_extension< F: Fn(&Self, u32, Option<&str>) -> Option + Send + Sync + 'static, >( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn request_extension_trampoline< P: IsA, F: Fn(&P, u32, Option<&str>) -> Option + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, ext_id: libc::c_uint, ext_uri: *mut libc::c_char, f: glib::ffi::gpointer, ) -> *mut ffi::GstRTPHeaderExtension { let f: &F = &*(f as *const F); f( RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref(), ext_id, Option::::from_glib_borrow(ext_uri) .as_ref() .as_ref() .map(|s| s.as_str()), ) .to_glib_full() } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"request-extension\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( request_extension_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_20")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_20")))] #[doc(alias = "auto-header-extension")] fn connect_auto_header_extension_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_auto_header_extension_trampoline< P: IsA, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::auto-header-extension\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( notify_auto_header_extension_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_18")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_18")))] #[doc(alias = "max-reorder")] fn connect_max_reorder_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_max_reorder_trampoline< P: IsA, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::max-reorder\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( notify_max_reorder_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[cfg(feature = "v1_16")] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[doc(alias = "source-info")] fn connect_source_info_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_source_info_trampoline< P: IsA, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::source-info\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( notify_source_info_trampoline:: as *const (), )), Box_::into_raw(f), ) } } #[doc(alias = "stats")] fn connect_stats_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_stats_trampoline< P: IsA, F: Fn(&P) + Send + Sync + 'static, >( this: *mut ffi::GstRTPBaseDepayload, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) { let f: &F = &*(f as *const F); f(RTPBaseDepayload::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::stats\0".as_ptr() as *const _, Some(std::mem::transmute::<_, unsafe extern "C" fn()>( notify_stats_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl> RTPBaseDepayloadExt for O {}