diff --git a/generic/threadshare/examples/standalone/sink/imp.rs b/generic/threadshare/examples/standalone/sink/imp.rs index 88cd2aef..5ef839c0 100644 --- a/generic/threadshare/examples/standalone/sink/imp.rs +++ b/generic/threadshare/examples/standalone/sink/imp.rs @@ -133,7 +133,7 @@ impl PadSinkHandler for TestSinkPadHandler { .boxed() } - fn sink_event(&self, _pad: &PadSinkRef, imp: &TestSink, event: gst::Event) -> bool { + fn sink_event(self, _pad: &PadSinkRef, imp: &TestSink, event: gst::Event) -> bool { if let EventView::FlushStart(..) = event.view() { return imp.task.flush_start().await_maybe_on_context().is_ok(); } diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index fb32ddf7..ff4a8b98 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -82,7 +82,7 @@ struct AppSrcPadHandler; impl PadSrcHandler for AppSrcPadHandler { type ElementImpl = AppSrc; - fn src_event(&self, pad: &PadSrcRef, imp: &AppSrc, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &AppSrc, event: gst::Event) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); use gst::EventView; @@ -103,7 +103,7 @@ impl PadSrcHandler for AppSrcPadHandler { ret } - fn src_query(&self, pad: &PadSrcRef, imp: &AppSrc, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, imp: &AppSrc, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); use gst::QueryViewMut; diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index e16c52cc..f8618dbb 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -219,7 +219,7 @@ impl PadSinkHandler for InputSelectorPadSinkHandler { .boxed() } - fn sink_event(&self, _pad: &PadSinkRef, imp: &InputSelector, event: gst::Event) -> bool { + fn sink_event(self, _pad: &PadSinkRef, imp: &InputSelector, event: gst::Event) -> bool { /* Drop all events for now */ if let gst::EventView::FlushStart(..) = event.view() { /* Unblock downstream */ @@ -234,7 +234,7 @@ impl PadSinkHandler for InputSelectorPadSinkHandler { true } - fn sink_query(&self, pad: &PadSinkRef, imp: &InputSelector, query: &mut gst::QueryRef) -> bool { + fn sink_query(self, pad: &PadSinkRef, imp: &InputSelector, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling query {:?}", query); if query.is_serialized() { @@ -254,7 +254,7 @@ struct InputSelectorPadSrcHandler; impl PadSrcHandler for InputSelectorPadSrcHandler { type ElementImpl = InputSelector; - fn src_query(&self, pad: &PadSrcRef, imp: &InputSelector, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, imp: &InputSelector, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); use gst::QueryViewMut; diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 44fd54de..5dbd855f 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -562,7 +562,7 @@ impl PadSinkHandler for SinkHandler { .boxed() } - fn sink_event(&self, pad: &PadSinkRef, jb: &JitterBuffer, event: gst::Event) -> bool { + fn sink_event(self, pad: &PadSinkRef, jb: &JitterBuffer, event: gst::Event) -> bool { use gst::EventView; gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); @@ -870,7 +870,7 @@ impl SrcHandler { impl PadSrcHandler for SrcHandler { type ElementImpl = JitterBuffer; - fn src_event(&self, pad: &PadSrcRef, jb: &JitterBuffer, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, jb: &JitterBuffer, event: gst::Event) -> bool { use gst::EventView; gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); @@ -907,7 +907,7 @@ impl PadSrcHandler for SrcHandler { jb.sink_pad.gst_pad().push_event(event) } - fn src_query(&self, pad: &PadSrcRef, jb: &JitterBuffer, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, jb: &JitterBuffer, query: &mut gst::QueryRef) -> bool { use gst::QueryViewMut; gst::log!(CAT, obj: pad.gst_pad(), "Forwarding {:?}", query); diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index 177d9350..7a94da0b 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -243,7 +243,7 @@ impl PadSinkHandler for ProxySinkPadHandler { .boxed() } - fn sink_event(&self, pad: &PadSinkRef, imp: &ProxySink, event: gst::Event) -> bool { + fn sink_event(self, pad: &PadSinkRef, imp: &ProxySink, event: gst::Event) -> bool { gst::debug!(SINK_CAT, obj: pad.gst_pad(), "Handling non-serialized {:?}", event); let src_pad = { @@ -666,7 +666,7 @@ struct ProxySrcPadHandler; impl PadSrcHandler for ProxySrcPadHandler { type ElementImpl = ProxySrc; - fn src_event(&self, pad: &PadSrcRef, imp: &ProxySrc, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &ProxySrc, event: gst::Event) -> bool { gst::log!(SRC_CAT, obj: pad.gst_pad(), "Handling {:?}", event); let sink_pad = { @@ -718,7 +718,7 @@ impl PadSrcHandler for ProxySrcPadHandler { } } - fn src_query(&self, pad: &PadSrcRef, _proxysrc: &ProxySrc, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, _proxysrc: &ProxySrc, query: &mut gst::QueryRef) -> bool { gst::log!(SRC_CAT, obj: pad.gst_pad(), "Handling {:?}", query); use gst::QueryViewMut; diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index 826ca324..2ca02f9c 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -113,7 +113,7 @@ impl PadSinkHandler for QueuePadSinkHandler { .boxed() } - fn sink_event(&self, pad: &PadSinkRef, imp: &Queue, event: gst::Event) -> bool { + fn sink_event(self, pad: &PadSinkRef, imp: &Queue, event: gst::Event) -> bool { gst::debug!(CAT, obj: pad.gst_pad(), "Handling non-serialized {:?}", event); if let gst::EventView::FlushStart(..) = event.view() { @@ -164,7 +164,7 @@ impl PadSinkHandler for QueuePadSinkHandler { .boxed() } - fn sink_query(&self, pad: &PadSinkRef, imp: &Queue, query: &mut gst::QueryRef) -> bool { + fn sink_query(self, pad: &PadSinkRef, imp: &Queue, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); if query.is_serialized() { @@ -184,7 +184,7 @@ struct QueuePadSrcHandler; impl PadSrcHandler for QueuePadSrcHandler { type ElementImpl = Queue; - fn src_event(&self, pad: &PadSrcRef, imp: &Queue, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &Queue, event: gst::Event) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); use gst::EventView; @@ -213,7 +213,7 @@ impl PadSrcHandler for QueuePadSrcHandler { imp.sink_pad.gst_pad().push_event(event) } - fn src_query(&self, pad: &PadSrcRef, imp: &Queue, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, imp: &Queue, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); if let gst::QueryViewMut::Scheduling(q) = query.view_mut() { diff --git a/generic/threadshare/src/runtime/pad.rs b/generic/threadshare/src/runtime/pad.rs index d5318722..857f15a1 100644 --- a/generic/threadshare/src/runtime/pad.rs +++ b/generic/threadshare/src/runtime/pad.rs @@ -122,7 +122,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static { type ElementImpl: ElementImpl + ObjectSubclass; fn src_activate( - &self, + self, pad: &PadSrcRef, _imp: &Self::ElementImpl, ) -> Result<(), gst::LoggableError> { @@ -151,7 +151,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static { } fn src_activatemode( - &self, + self, _pad: &PadSrcRef, _imp: &Self::ElementImpl, _mode: gst::PadMode, @@ -160,7 +160,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static { Ok(()) } - fn src_event(&self, pad: &PadSrcRef, imp: &Self::ElementImpl, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &Self::ElementImpl, event: gst::Event) -> bool { gst::log!(RUNTIME_CAT, obj: pad.gst_pad(), "Handling {:?}", event); let elem = imp.obj(); @@ -174,7 +174,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static { } fn src_event_full( - &self, + self, pad: &PadSrcRef, imp: &Self::ElementImpl, event: gst::Event, @@ -186,7 +186,7 @@ pub trait PadSrcHandler: Clone + Send + Sync + 'static { } fn src_query( - &self, + self, pad: &PadSrcRef, imp: &Self::ElementImpl, query: &mut gst::QueryRef, @@ -406,7 +406,7 @@ impl PadSrc { "Panic in PadSrc activate" )) }, - move |imp| handler.src_activate(&PadSrcRef::new(inner_arc), imp), + move |imp| H::src_activate(handler, &PadSrcRef::new(inner_arc), imp), ) }); @@ -428,7 +428,7 @@ impl PadSrc { move |imp| { let this_ref = PadSrcRef::new(inner_arc); this_ref.activate_mode_hook(mode, active)?; - handler.src_activatemode(&this_ref, imp, mode, active) + H::src_activatemode(handler, &this_ref, imp, mode, active) }, ) }); @@ -444,7 +444,9 @@ impl PadSrc { H::ElementImpl::catch_panic_pad_function( parent, || Err(FlowError::Error), - move |imp| handler.src_event_full(&PadSrcRef::new(inner_arc), imp, event), + move |imp| { + H::src_event_full(handler, &PadSrcRef::new(inner_arc), imp, event) + }, ) }); @@ -458,7 +460,7 @@ impl PadSrc { || false, move |imp| { if !query.is_serialized() { - handler.src_query(&PadSrcRef::new(inner_arc), imp, query) + H::src_query(handler, &PadSrcRef::new(inner_arc), imp, query) } else { gst::fixme!(RUNTIME_CAT, obj: inner_arc.gst_pad(), "Serialized Query not supported"); false @@ -511,7 +513,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static { type ElementImpl: ElementImpl + ObjectSubclass; fn sink_activate( - &self, + self, pad: &PadSinkRef, _imp: &Self::ElementImpl, ) -> Result<(), gst::LoggableError> { @@ -540,7 +542,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static { } fn sink_activatemode( - &self, + self, _pad: &PadSinkRef, _imp: &Self::ElementImpl, _mode: gst::PadMode, @@ -567,7 +569,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static { future::err(FlowError::NotSupported).boxed() } - fn sink_event(&self, pad: &PadSinkRef, imp: &Self::ElementImpl, event: gst::Event) -> bool { + fn sink_event(self, pad: &PadSinkRef, imp: &Self::ElementImpl, event: gst::Event) -> bool { assert!(!event.is_serialized()); gst::log!(RUNTIME_CAT, obj: pad.gst_pad(), "Handling {:?}", event); @@ -604,7 +606,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static { } fn sink_event_full( - &self, + self, pad: &PadSinkRef, imp: &Self::ElementImpl, event: gst::Event, @@ -633,7 +635,7 @@ pub trait PadSinkHandler: Clone + Send + Sync + 'static { } fn sink_query( - &self, + self, pad: &PadSinkRef, imp: &Self::ElementImpl, query: &mut gst::QueryRef, @@ -807,7 +809,7 @@ impl PadSink { "Panic in PadSink activate" )) }, - move |imp| handler.sink_activate(&PadSinkRef::new(inner_arc), imp), + move |imp| H::sink_activate(handler, &PadSinkRef::new(inner_arc), imp), ) }); @@ -829,7 +831,7 @@ impl PadSink { move |imp| { let this_ref = PadSinkRef::new(inner_arc); this_ref.activate_mode_hook(mode, active)?; - handler.sink_activatemode(&this_ref, imp, mode, active) + H::sink_activatemode(handler, &this_ref, imp, mode, active) }, ) }); @@ -945,7 +947,7 @@ impl PadSink { || false, move |imp| { if !query.is_serialized() { - handler.sink_query(&PadSinkRef::new(inner_arc), imp, query) + H::sink_query(handler, &PadSinkRef::new(inner_arc), imp, query) } else { gst::fixme!(RUNTIME_CAT, obj: inner_arc.gst_pad(), "Serialized Query not supported"); false diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index ebc2f86b..96d105e3 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -96,7 +96,7 @@ struct TcpClientSrcPadHandler; impl PadSrcHandler for TcpClientSrcPadHandler { type ElementImpl = TcpClientSrc; - fn src_event(&self, pad: &PadSrcRef, imp: &TcpClientSrc, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &TcpClientSrc, event: gst::Event) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); use gst::EventView; @@ -117,7 +117,7 @@ impl PadSrcHandler for TcpClientSrcPadHandler { ret } - fn src_query(&self, pad: &PadSrcRef, imp: &TcpClientSrc, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, imp: &TcpClientSrc, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); use gst::QueryViewMut; diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index bb1825d0..2b45f7ff 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -190,7 +190,7 @@ impl PadSinkHandler for UdpSinkPadHandler { .boxed() } - fn sink_event(&self, _pad: &PadSinkRef, imp: &UdpSink, event: gst::Event) -> bool { + fn sink_event(self, _pad: &PadSinkRef, imp: &UdpSink, event: gst::Event) -> bool { if let EventView::FlushStart(..) = event.view() { return imp.task.flush_start().await_maybe_on_context().is_ok(); } diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index c3079c24..e9b6fcdc 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -113,7 +113,7 @@ struct UdpSrcPadHandler; impl PadSrcHandler for UdpSrcPadHandler { type ElementImpl = UdpSrc; - fn src_event(&self, pad: &PadSrcRef, imp: &UdpSrc, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &UdpSrc, event: gst::Event) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); use gst::EventView; @@ -134,7 +134,7 @@ impl PadSrcHandler for UdpSrcPadHandler { ret } - fn src_query(&self, pad: &PadSrcRef, imp: &UdpSrc, query: &mut gst::QueryRef) -> bool { + fn src_query(self, pad: &PadSrcRef, imp: &UdpSrc, query: &mut gst::QueryRef) -> bool { gst::log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); use gst::QueryViewMut; diff --git a/generic/threadshare/tests/pad.rs b/generic/threadshare/tests/pad.rs index dcb41579..78f32fb9 100644 --- a/generic/threadshare/tests/pad.rs +++ b/generic/threadshare/tests/pad.rs @@ -89,7 +89,7 @@ mod imp_src { impl PadSrcHandler for PadSrcTestHandler { type ElementImpl = ElementSrcTest; - fn src_event(&self, pad: &PadSrcRef, imp: &ElementSrcTest, event: gst::Event) -> bool { + fn src_event(self, pad: &PadSrcRef, imp: &ElementSrcTest, event: gst::Event) -> bool { gst::log!(SRC_CAT, obj: pad.gst_pad(), "Handling {:?}", event); let ret = match event.view() { @@ -465,7 +465,7 @@ mod imp_sink { .boxed() } - fn sink_event(&self, pad: &PadSinkRef, imp: &ElementSinkTest, event: gst::Event) -> bool { + fn sink_event(self, pad: &PadSinkRef, imp: &ElementSinkTest, event: gst::Event) -> bool { gst::debug!(SINK_CAT, obj: pad.gst_pad(), "Handling non-serialized {:?}", event); match event.view() {