mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-23 18:40:32 +00:00
Update for the subclassing glib/gstreamer bindings API changes
This commit is contained in:
parent
aa354058f5
commit
2cada57efc
58 changed files with 47 additions and 158 deletions
|
@ -90,7 +90,6 @@ impl ObjectSubclass for AudioEcho {
|
|||
const NAME: &'static str = "RsAudioEcho";
|
||||
type Type = super::AudioEcho;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for AudioEcho {
|
||||
|
|
|
@ -1705,7 +1705,6 @@ impl ObjectSubclass for AudioLoudNorm {
|
|||
const NAME: &'static str = "RsAudioLoudNorm";
|
||||
type Type = super::AudioLoudNorm;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -194,7 +194,6 @@ impl ObjectSubclass for AudioRNNoise {
|
|||
const NAME: &'static str = "AudioRNNoise";
|
||||
type Type = super::AudioRNNoise;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for AudioRNNoise {}
|
||||
|
|
|
@ -43,7 +43,6 @@ impl ObjectSubclass for ClaxonDec {
|
|||
const NAME: &'static str = "ClaxonDec";
|
||||
type Type = super::ClaxonDec;
|
||||
type ParentType = gst_audio::AudioDecoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for ClaxonDec {}
|
||||
|
|
|
@ -318,7 +318,6 @@ impl ObjectSubclass for CsoundFilter {
|
|||
const NAME: &'static str = "CsoundFilter";
|
||||
type Type = super::CsoundFilter;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn new() -> Self {
|
||||
let csound = Csound::new();
|
||||
|
|
|
@ -49,7 +49,6 @@ impl ObjectSubclass for LewtonDec {
|
|||
const NAME: &'static str = "LewtonDec";
|
||||
type Type = super::LewtonDec;
|
||||
type ParentType = gst_audio::AudioDecoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for LewtonDec {}
|
||||
|
|
|
@ -112,7 +112,6 @@ impl ObjectSubclass for FileSink {
|
|||
type Type = super::FileSink;
|
||||
type ParentType = gst_base::BaseSink;
|
||||
type Interfaces = (gst::URIHandler,);
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for FileSink {
|
||||
|
|
|
@ -126,7 +126,6 @@ impl ObjectSubclass for FileSrc {
|
|||
type Type = super::FileSrc;
|
||||
type ParentType = gst_base::BaseSrc;
|
||||
type Interfaces = (gst::URIHandler,);
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for FileSrc {
|
||||
|
|
|
@ -549,7 +549,6 @@ impl ObjectSubclass for Decrypter {
|
|||
const NAME: &'static str = "RsSodiumDecryptor";
|
||||
type Type = super::Decrypter;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -339,7 +339,6 @@ impl ObjectSubclass for Encrypter {
|
|||
const NAME: &'static str = "RsSodiumEncrypter";
|
||||
type Type = super::Encrypter;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -508,7 +508,6 @@ impl ObjectSubclass for AppSrc {
|
|||
const NAME: &'static str = "RsTsAppSrc";
|
||||
type Type = super::AppSrc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let src_pad_handler = AppSrcPadHandler::default();
|
||||
|
|
|
@ -395,7 +395,6 @@ impl ObjectSubclass for InputSelector {
|
|||
const NAME: &'static str = "RsTsInputSelector";
|
||||
type Type = super::InputSelector;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
Self {
|
||||
|
|
|
@ -1339,7 +1339,6 @@ impl ObjectSubclass for JitterBuffer {
|
|||
const NAME: &'static str = "RsTsJitterBuffer";
|
||||
type Type = super::JitterBuffer;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let sink_pad_handler = SinkHandler::default();
|
||||
|
|
|
@ -576,7 +576,6 @@ impl ObjectSubclass for ProxySink {
|
|||
const NAME: &'static str = "RsTsProxySink";
|
||||
type Type = super::ProxySink;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
Self {
|
||||
|
@ -1114,7 +1113,6 @@ impl ObjectSubclass for ProxySrc {
|
|||
const NAME: &'static str = "RsTsProxySrc";
|
||||
type Type = super::ProxySrc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
Self {
|
||||
|
|
|
@ -696,7 +696,6 @@ impl ObjectSubclass for Queue {
|
|||
const NAME: &'static str = "RsTsQueue";
|
||||
type Type = super::Queue;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
Self {
|
||||
|
|
|
@ -549,7 +549,6 @@ impl ObjectSubclass for TcpClientSrc {
|
|||
const NAME: &'static str = "RsTsTcpClientSrc";
|
||||
type Type = super::TcpClientSrc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let src_pad_handler = TcpClientSrcPadHandler::default();
|
||||
|
|
|
@ -948,7 +948,6 @@ impl ObjectSubclass for UdpSink {
|
|||
const NAME: &'static str = "RsTsUdpSink";
|
||||
type Type = super::UdpSink;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let settings = Arc::new(StdMutex::new(Settings::default()));
|
||||
|
|
|
@ -690,7 +690,6 @@ impl ObjectSubclass for UdpSrc {
|
|||
const NAME: &'static str = "RsTsUdpSrc";
|
||||
type Type = super::UdpSrc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let src_pad_handler = UdpSrcPadHandler::default();
|
||||
|
|
|
@ -306,7 +306,6 @@ mod imp_src {
|
|||
const NAME: &'static str = "TsElementSrcTest";
|
||||
type Type = super::ElementSrcTest;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
ElementSrcTest {
|
||||
|
@ -638,7 +637,6 @@ mod imp_sink {
|
|||
const NAME: &'static str = "TsElementSinkTest";
|
||||
type Type = super::ElementSinkTest;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
ElementSinkTest {
|
||||
|
|
|
@ -1117,5 +1117,4 @@ impl ObjectSubclass for ReqwestHttpSrc {
|
|||
type Type = super::ReqwestHttpSrc;
|
||||
type ParentType = gst_base::PushSrc;
|
||||
type Interfaces = (gst::URIHandler,);
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
|
|
@ -969,7 +969,6 @@ impl ObjectSubclass for Transcriber {
|
|||
const NAME: &'static str = "RsAwsTranscriber";
|
||||
type Type = super::Transcriber;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -346,7 +346,6 @@ impl ObjectSubclass for S3Sink {
|
|||
const NAME: &'static str = "RusotoS3Sink";
|
||||
type Type = super::S3Sink;
|
||||
type ParentType = gst_base::BaseSink;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for S3Sink {
|
||||
|
|
|
@ -208,7 +208,6 @@ impl ObjectSubclass for S3Src {
|
|||
type Type = super::S3Src;
|
||||
type ParentType = gst_base::BaseSrc;
|
||||
type Interfaces = (gst::URIHandler,);
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for S3Src {
|
||||
|
|
|
@ -205,7 +205,6 @@ impl ObjectSubclass for JsonGstEnc {
|
|||
const NAME: &'static str = "RsJsonGstEnc";
|
||||
type Type = super::JsonGstEnc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -867,7 +867,6 @@ impl ObjectSubclass for JsonGstParse {
|
|||
const NAME: &'static str = "RsJsonGstParse";
|
||||
type Type = super::JsonGstParse;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -123,7 +123,6 @@ impl ObjectSubclass for RegEx {
|
|||
const NAME: &'static str = "RsRegEx";
|
||||
type Type = super::RegEx;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -426,7 +426,6 @@ impl ObjectSubclass for TextWrap {
|
|||
const NAME: &'static str = "RsTextWrap";
|
||||
type Type = super::TextWrap;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -118,7 +118,6 @@ impl ObjectSubclass for Identity {
|
|||
const NAME: &'static str = "RsIdentity";
|
||||
type Type = super::Identity;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
// Called when a new instance is to be created. We need to return an instance
|
||||
// of our struct here and also get the class struct passed in case it's needed
|
||||
|
|
|
@ -48,7 +48,6 @@ impl ObjectSubclass for ProgressBin {
|
|||
const NAME: &'static str = "RsProgressBin";
|
||||
type Type = super::ProgressBin;
|
||||
type ParentType = gst::Bin;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
// Called when a new instance is to be created. We need to return an instance
|
||||
// of our struct here and also get the class struct passed in case it's needed
|
||||
|
|
|
@ -95,7 +95,6 @@ impl ObjectSubclass for Rgb2Gray {
|
|||
const NAME: &'static str = "RsRgb2Gray";
|
||||
type Type = super::Rgb2Gray;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
// Implementation of glib::Object virtual methods
|
||||
|
|
|
@ -158,7 +158,6 @@ impl ObjectSubclass for SineSrc {
|
|||
const NAME: &'static str = "RsSineSrc";
|
||||
type Type = super::SineSrc;
|
||||
type ParentType = gst_base::PushSrc;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
// Implementation of glib::Object virtual methods
|
||||
|
|
|
@ -173,7 +173,6 @@ impl ObjectSubclass for Rgb2Gray {
|
|||
const NAME: &'static str = "RsRgb2Gray";
|
||||
type Type = super::Rgb2Gray;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -277,7 +276,6 @@ impl ObjectSubclass for Rgb2Gray {
|
|||
const NAME: &'static str = "RsRgb2Gray";
|
||||
type Type = super::Rgb2Gray;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for Rgb2Gray {}
|
||||
|
|
|
@ -110,7 +110,6 @@ impl ObjectSubclass for SineSrc {
|
|||
const NAME: &'static str = "RsSineSrc";
|
||||
type Type = super::SineSrc;
|
||||
type ParentType = gst_base::PushSrc;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
// Called exactly once when registering the type. Used for
|
||||
// setting up metadata for all instances, e.g. the name and
|
||||
|
|
|
@ -614,10 +614,7 @@ impl<T: AggregatorImpl> AggregatorImplExt for T {
|
|||
}
|
||||
}
|
||||
|
||||
unsafe impl<T: AggregatorImpl> IsSubclassable<T> for Aggregator
|
||||
where
|
||||
<T as ObjectSubclass>::Instance: PanicPoison,
|
||||
{
|
||||
unsafe impl<T: AggregatorImpl> IsSubclassable<T> for Aggregator {
|
||||
fn class_init(klass: &mut glib::Class<Self>) {
|
||||
<gst::Element as IsSubclassable<T>>::class_init(klass);
|
||||
let klass = klass.as_mut();
|
||||
|
@ -643,19 +640,20 @@ where
|
|||
klass.negotiate = Some(aggregator_negotiate::<T>);
|
||||
}
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Element as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_flush<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> gst::ffi::GstFlowReturn
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstFlowReturn {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
|
||||
imp.flush(wrap.unsafe_cast_ref()).into()
|
||||
})
|
||||
.to_glib()
|
||||
|
@ -665,15 +663,12 @@ unsafe extern "C" fn aggregator_clip<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
buffer: *mut gst::ffi::GstBuffer,
|
||||
) -> *mut gst::ffi::GstBuffer
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> *mut gst::ffi::GstBuffer {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
let ret = gst::panic_to_error!(&wrap, &instance.panicked(), None, {
|
||||
let ret = gst::panic_to_error!(&wrap, &imp.panicked(), None, {
|
||||
imp.clip(
|
||||
wrap.unsafe_cast_ref(),
|
||||
&from_glib_borrow(aggregator_pad),
|
||||
|
@ -687,15 +682,12 @@ where
|
|||
unsafe extern "C" fn aggregator_finish_buffer<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
buffer: *mut gst::ffi::GstBuffer,
|
||||
) -> gst::ffi::GstFlowReturn
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstFlowReturn {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
|
||||
imp.finish_buffer(wrap.unsafe_cast_ref(), from_glib_full(buffer))
|
||||
.into()
|
||||
})
|
||||
|
@ -706,15 +698,12 @@ unsafe extern "C" fn aggregator_sink_event<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
event: *mut gst::ffi::GstEvent,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(wrap, &imp.panicked(), false, {
|
||||
imp.sink_event(
|
||||
wrap.unsafe_cast_ref(),
|
||||
&from_glib_borrow(aggregator_pad),
|
||||
|
@ -728,15 +717,12 @@ unsafe extern "C" fn aggregator_sink_event_pre_queue<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
event: *mut gst::ffi::GstEvent,
|
||||
) -> gst::ffi::GstFlowReturn
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstFlowReturn {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
|
||||
imp.sink_event_pre_queue(
|
||||
wrap.unsafe_cast_ref(),
|
||||
&from_glib_borrow(aggregator_pad),
|
||||
|
@ -751,15 +737,12 @@ unsafe extern "C" fn aggregator_sink_query<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
query: *mut gst::ffi::GstQuery,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
imp.sink_query(
|
||||
wrap.unsafe_cast_ref(),
|
||||
&from_glib_borrow(aggregator_pad),
|
||||
|
@ -773,15 +756,12 @@ unsafe extern "C" fn aggregator_sink_query_pre_queue<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
aggregator_pad: *mut ffi::GstAggregatorPad,
|
||||
query: *mut gst::ffi::GstQuery,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
imp.sink_query_pre_queue(
|
||||
wrap.unsafe_cast_ref(),
|
||||
&from_glib_borrow(aggregator_pad),
|
||||
|
@ -794,15 +774,12 @@ where
|
|||
unsafe extern "C" fn aggregator_src_event<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
event: *mut gst::ffi::GstEvent,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
imp.src_event(wrap.unsafe_cast_ref(), from_glib_full(event))
|
||||
})
|
||||
.to_glib()
|
||||
|
@ -811,15 +788,12 @@ where
|
|||
unsafe extern "C" fn aggregator_src_query<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
query: *mut gst::ffi::GstQuery,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
imp.src_query(wrap.unsafe_cast_ref(), gst::QueryRef::from_mut_ptr(query))
|
||||
})
|
||||
.to_glib()
|
||||
|
@ -829,15 +803,12 @@ unsafe extern "C" fn aggregator_src_activate<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
mode: gst::ffi::GstPadMode,
|
||||
active: glib::ffi::gboolean,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
match imp.src_activate(wrap.unsafe_cast_ref(), from_glib(mode), from_glib(active)) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
|
@ -852,15 +823,12 @@ where
|
|||
unsafe extern "C" fn aggregator_aggregate<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
timeout: glib::ffi::gboolean,
|
||||
) -> gst::ffi::GstFlowReturn
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstFlowReturn {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
|
||||
imp.aggregate(wrap.unsafe_cast_ref(), from_glib(timeout))
|
||||
.into()
|
||||
})
|
||||
|
@ -869,15 +837,12 @@ where
|
|||
|
||||
unsafe extern "C" fn aggregator_start<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
match imp.start(wrap.unsafe_cast_ref()) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
|
@ -891,15 +856,12 @@ where
|
|||
|
||||
unsafe extern "C" fn aggregator_stop<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
match imp.stop(wrap.unsafe_cast_ref()) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
|
@ -913,15 +875,12 @@ where
|
|||
|
||||
unsafe extern "C" fn aggregator_get_next_time<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> gst::ffi::GstClockTime
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstClockTime {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::CLOCK_TIME_NONE, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::CLOCK_TIME_NONE, {
|
||||
imp.get_next_time(wrap.unsafe_cast_ref())
|
||||
})
|
||||
.to_glib()
|
||||
|
@ -932,15 +891,12 @@ unsafe extern "C" fn aggregator_create_new_pad<T: AggregatorImpl>(
|
|||
templ: *mut gst::ffi::GstPadTemplate,
|
||||
req_name: *const libc::c_char,
|
||||
caps: *const gst::ffi::GstCaps,
|
||||
) -> *mut ffi::GstAggregatorPad
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> *mut ffi::GstAggregatorPad {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), None, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), None, {
|
||||
let req_name: Borrowed<Option<glib::GString>> = from_glib_borrow(req_name);
|
||||
|
||||
imp.create_new_pad(
|
||||
|
@ -959,17 +915,14 @@ unsafe extern "C" fn aggregator_update_src_caps<T: AggregatorImpl>(
|
|||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst::ffi::GstCaps,
|
||||
res: *mut *mut gst::ffi::GstCaps,
|
||||
) -> gst::ffi::GstFlowReturn
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> gst::ffi::GstFlowReturn {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
*res = ptr::null_mut();
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::FlowReturn::Error, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::FlowReturn::Error, {
|
||||
match imp.update_src_caps(wrap.unsafe_cast_ref(), &from_glib_borrow(caps)) {
|
||||
Ok(res_caps) => {
|
||||
*res = res_caps.into_ptr();
|
||||
|
@ -984,15 +937,12 @@ where
|
|||
unsafe extern "C" fn aggregator_fixate_src_caps<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst::ffi::GstCaps,
|
||||
) -> *mut gst::ffi::GstCaps
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> *mut gst::ffi::GstCaps {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), gst::Caps::new_empty(), {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), gst::Caps::new_empty(), {
|
||||
imp.fixate_src_caps(wrap.unsafe_cast_ref(), from_glib_full(caps))
|
||||
})
|
||||
.into_ptr()
|
||||
|
@ -1001,15 +951,12 @@ where
|
|||
unsafe extern "C" fn aggregator_negotiated_src_caps<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
caps: *mut gst::ffi::GstCaps,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
match imp.negotiated_src_caps(wrap.unsafe_cast_ref(), &from_glib_borrow(caps)) {
|
||||
Ok(()) => true,
|
||||
Err(err) => {
|
||||
|
@ -1023,15 +970,12 @@ where
|
|||
|
||||
unsafe extern "C" fn aggregator_negotiate<T: AggregatorImpl>(
|
||||
ptr: *mut ffi::GstAggregator,
|
||||
) -> glib::ffi::gboolean
|
||||
where
|
||||
T::Instance: PanicPoison,
|
||||
{
|
||||
) -> glib::ffi::gboolean {
|
||||
let instance = &*(ptr as *mut T::Instance);
|
||||
let imp = instance.get_impl();
|
||||
let wrap: Borrowed<Aggregator> = from_glib_borrow(ptr);
|
||||
|
||||
gst::panic_to_error!(&wrap, &instance.panicked(), false, {
|
||||
gst::panic_to_error!(&wrap, &imp.panicked(), false, {
|
||||
imp.negotiate(wrap.unsafe_cast_ref())
|
||||
})
|
||||
.to_glib()
|
||||
|
|
|
@ -108,6 +108,10 @@ unsafe impl<T: AggregatorPadImpl> IsSubclassable<T> for AggregatorPad {
|
|||
klass.flush = Some(aggregator_pad_flush::<T>);
|
||||
klass.skip_buffer = Some(aggregator_pad_skip_buffer::<T>);
|
||||
}
|
||||
|
||||
fn instance_init(instance: &mut glib::subclass::InitializingObject<T>) {
|
||||
<gst::Pad as IsSubclassable<T>>::instance_init(instance);
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn aggregator_pad_flush<T: AggregatorPadImpl>(
|
||||
|
|
|
@ -59,7 +59,6 @@ impl ObjectSubclass for CustomSource {
|
|||
const NAME: &'static str = "FallbackSrcCustomSource";
|
||||
type Type = super::CustomSource;
|
||||
type ParentType = gst::Bin;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for CustomSource {
|
||||
|
|
|
@ -182,7 +182,6 @@ impl ObjectSubclass for FallbackSrc {
|
|||
const NAME: &'static str = "FallbackSrc";
|
||||
type Type = super::FallbackSrc;
|
||||
type ParentType = gst::Bin;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for FallbackSrc {
|
||||
|
|
|
@ -66,7 +66,6 @@ impl ObjectSubclass for VideoFallbackSource {
|
|||
const NAME: &'static str = "FallbackSrcVideoFallbackSource";
|
||||
type Type = super::VideoFallbackSource;
|
||||
type ParentType = gst::Bin;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("src").unwrap();
|
||||
|
|
|
@ -647,7 +647,6 @@ impl ObjectSubclass for FallbackSwitch {
|
|||
const NAME: &'static str = "FallbackSwitch";
|
||||
type Type = super::FallbackSwitch;
|
||||
type ParentType = gst_base::Aggregator;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -1621,7 +1621,6 @@ impl ObjectSubclass for ToggleRecord {
|
|||
const NAME: &'static str = "RsToggleRecord";
|
||||
type Type = super::ToggleRecord;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -33,7 +33,6 @@ impl ObjectSubclass for CdgDec {
|
|||
const NAME: &'static str = "CdgDec";
|
||||
type Type = super::CdgDec;
|
||||
type ParentType = gst_video::VideoDecoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for CdgDec {}
|
||||
|
|
|
@ -40,7 +40,6 @@ impl ObjectSubclass for CdgParse {
|
|||
const NAME: &'static str = "CdgParse";
|
||||
type Type = super::CdgParse;
|
||||
type ParentType = gst_base::BaseParse;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for CdgParse {}
|
||||
|
|
|
@ -219,7 +219,6 @@ impl ObjectSubclass for CCDetect {
|
|||
const NAME: &'static str = "CCDetect";
|
||||
type Type = super::CCDetect;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for CCDetect {
|
||||
|
|
|
@ -545,7 +545,6 @@ impl ObjectSubclass for Cea608Overlay {
|
|||
const NAME: &'static str = "RsCea608Overlay";
|
||||
type Type = super::Cea608Overlay;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -375,7 +375,6 @@ impl ObjectSubclass for Cea608ToTt {
|
|||
const NAME: &'static str = "Cea608ToTt";
|
||||
type Type = super::Cea608ToTt;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -449,7 +449,6 @@ impl ObjectSubclass for MccEnc {
|
|||
const NAME: &'static str = "RsMccEnc";
|
||||
type Type = super::MccEnc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -1122,7 +1122,6 @@ impl ObjectSubclass for MccParse {
|
|||
const NAME: &'static str = "RsMccParse";
|
||||
type Type = super::MccParse;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -337,7 +337,6 @@ impl ObjectSubclass for SccEnc {
|
|||
const NAME: &'static str = "RsSccEnc";
|
||||
type Type = super::SccEnc;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -1002,7 +1002,6 @@ impl ObjectSubclass for SccParse {
|
|||
const NAME: &'static str = "RsSccParse";
|
||||
type Type = super::SccParse;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -979,7 +979,6 @@ impl ObjectSubclass for TtToCea608 {
|
|||
const NAME: &'static str = "TtToCea608";
|
||||
type Type = super::TtToCea608;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -192,7 +192,6 @@ impl ObjectSubclass for TtToJson {
|
|||
const NAME: &'static str = "RsTtToJson";
|
||||
type Type = super::TtToJson;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -351,7 +351,6 @@ impl ObjectSubclass for Dav1dDec {
|
|||
const NAME: &'static str = "RsDav1dDec";
|
||||
type Type = super::Dav1dDec;
|
||||
type ParentType = gst_video::VideoDecoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for Dav1dDec {}
|
||||
|
|
|
@ -124,7 +124,6 @@ impl ObjectSubclass for FlvDemux {
|
|||
const NAME: &'static str = "RsFlvDemux";
|
||||
type Type = super::FlvDemux;
|
||||
type ParentType = gst::Element;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
|
||||
fn with_class(klass: &Self::Class) -> Self {
|
||||
let templ = klass.get_pad_template("sink").unwrap();
|
||||
|
|
|
@ -135,7 +135,6 @@ impl ObjectSubclass for GifEnc {
|
|||
const NAME: &'static str = "GifEnc";
|
||||
type Type = super::GifEnc;
|
||||
type ParentType = gst_video::VideoEncoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for GifEnc {
|
||||
|
|
|
@ -80,7 +80,6 @@ impl ObjectSubclass for HsvDetector {
|
|||
const NAME: &'static str = "HsvDetector";
|
||||
type Type = super::HsvDetector;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for HsvDetector {
|
||||
|
|
|
@ -75,7 +75,6 @@ impl ObjectSubclass for HsvFilter {
|
|||
const NAME: &'static str = "HsvFilter";
|
||||
type Type = super::HsvFilter;
|
||||
type ParentType = gst_base::BaseTransform;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for HsvFilter {
|
||||
|
|
|
@ -209,7 +209,6 @@ impl ObjectSubclass for Rav1Enc {
|
|||
const NAME: &'static str = "Rav1Enc";
|
||||
type Type = super::Rav1Enc;
|
||||
type ParentType = gst_video::VideoEncoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for Rav1Enc {
|
||||
|
|
|
@ -170,7 +170,6 @@ impl ObjectSubclass for PngEncoder {
|
|||
const NAME: &'static str = "PngEncoder";
|
||||
type Type = super::PngEncoder;
|
||||
type ParentType = gst_video::VideoEncoder;
|
||||
type Instance = gst::subclass::ElementInstanceStruct<Self>;
|
||||
}
|
||||
|
||||
impl ObjectImpl for PngEncoder {
|
||||
|
|
Loading…
Reference in a new issue