diff --git a/audio/audiofx/src/ebur128level/imp.rs b/audio/audiofx/src/ebur128level/imp.rs index 8228f68b..41ba5791 100644 --- a/audio/audiofx/src/ebur128level/imp.rs +++ b/audio/audiofx/src/ebur128level/imp.rs @@ -130,7 +130,7 @@ impl ObjectImpl for EbuR128Level { .action() .class_handler(|_token, args| { let this = args[0].get::().unwrap(); - let imp = EbuR128Level::from_instance(&this); + let imp = this.imp(); gst_info!(CAT, obj: &this, "Resetting measurements",); imp.reset.store(true, atomic::Ordering::SeqCst); diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index ec21fef6..547c9375 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -586,7 +586,7 @@ impl ObjectImpl for AppSrc { .class_handler(|_, args| { let element = args[0].get::().expect("signal arg"); let buffer = args[1].get::().expect("signal arg"); - let appsrc = AppSrc::from_instance(&element); + let appsrc = element.imp(); Some(appsrc.push_buffer(&element, buffer).to_value()) }) @@ -595,7 +595,7 @@ impl ObjectImpl for AppSrc { .action() .class_handler(|_, args| { let element = args[0].get::().expect("signal arg"); - let appsrc = AppSrc::from_instance(&element); + let appsrc = element.imp(); Some(appsrc.end_of_stream(&element).to_value()) }) diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index 3d5b48e0..8c75248d 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -95,7 +95,7 @@ impl InputSelectorPadSinkHandler { element: &super::InputSelector, mut buffer: gst::Buffer, ) -> Result { - let inputselector = InputSelector::from_instance(element); + let inputselector = element.imp(); let (stickies, is_active, sync_future, switched_pad) = { let mut state = inputselector.state.lock().unwrap(); diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index d5800894..084d1f5d 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -304,7 +304,7 @@ impl SinkHandler { element: &super::JitterBuffer, buffer: gst::Buffer, ) -> Result { - let jb = JitterBuffer::from_instance(element); + let jb = element.imp(); let mut state = jb.state.lock().unwrap(); let (max_misorder_time, max_dropout_time) = { @@ -499,7 +499,7 @@ impl SinkHandler { if let Err(err) = self.store(&mut inner, pad, element, buf) { match err { gst::FlowError::CustomError => { - let jb = JitterBuffer::from_instance(element); + let jb = element.imp(); let mut state = jb.state.lock().unwrap(); for gap_packet in self.reset(&mut inner, &mut state, element) { buffers.push_back(gap_packet.buffer); @@ -510,7 +510,7 @@ impl SinkHandler { } } - let jb = JitterBuffer::from_instance(element); + let jb = element.imp(); let mut state = jb.state.lock().unwrap(); let (latency, context_wait) = { @@ -611,7 +611,7 @@ impl PadSinkHandler for SinkHandler { gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", event); - let jb = JitterBuffer::from_instance(&element); + let jb = element.imp(); let mut forward = true; match event.view() { @@ -669,7 +669,7 @@ impl SrcHandler { discont: &mut bool, ) -> Vec { let (latency, do_lost) = { - let jb = JitterBuffer::from_instance(element); + let jb = element.imp(); let settings = jb.settings.lock().unwrap(); (settings.latency, settings.do_lost) }; @@ -755,7 +755,7 @@ impl SrcHandler { &self, element: &super::JitterBuffer, ) -> Result { - let jb = JitterBuffer::from_instance(element); + let jb = element.imp(); let (lost_events, buffer, seq) = { let mut state = jb.state.lock().unwrap(); @@ -1061,7 +1061,7 @@ impl TaskImpl for JitterBufferTask { self.src_pad_handler.clear(); self.sink_pad_handler.clear(); - let jb = JitterBuffer::from_instance(&self.element); + let jb = self.element.imp(); *jb.state.lock().unwrap() = State::default(); gst_log!(CAT, obj: &self.element, "Task started"); @@ -1072,7 +1072,7 @@ impl TaskImpl for JitterBufferTask { fn iterate(&mut self) -> BoxFuture<'_, Result<(), gst::FlowError>> { async move { - let jb = JitterBuffer::from_instance(&self.element); + let jb = self.element.imp(); let (latency, context_wait) = { let settings = jb.settings.lock().unwrap(); (settings.latency, settings.context_wait) @@ -1208,7 +1208,7 @@ impl TaskImpl for JitterBufferTask { async move { gst_log!(CAT, obj: &self.element, "Stopping task"); - let jb = JitterBuffer::from_instance(&self.element); + let jb = self.element.imp(); let mut jb_state = jb.state.lock().unwrap(); if let Some((_, abort_handle)) = jb_state.wait_handle.take() { @@ -1405,7 +1405,7 @@ impl ObjectImpl for JitterBuffer { .action() .class_handler(|_, args| { let element = args[0].get::().expect("signal arg"); - let jb = JitterBuffer::from_instance(&element); + let jb = element.imp(); jb.clear_pt_map(&element); None }) diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index dcde7fa1..de1b581b 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -228,7 +228,7 @@ impl PadSinkHandler for ProxySinkPadHandler { async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); gst_log!(SINK_CAT, obj: pad.gst_pad(), "Handling {:?}", buffer); - let proxysink = ProxySink::from_instance(&element); + let proxysink = element.imp(); proxysink .enqueue_item(&element, DataQueueItem::Buffer(buffer)) .await @@ -248,7 +248,7 @@ impl PadSinkHandler for ProxySinkPadHandler { async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); gst_log!(SINK_CAT, obj: pad.gst_pad(), "Handling {:?}", list); - let proxysink = ProxySink::from_instance(&element); + let proxysink = element.imp(); proxysink .enqueue_item(&element, DataQueueItem::BufferList(list)) .await @@ -306,7 +306,7 @@ impl PadSinkHandler for ProxySinkPadHandler { let element = element.clone().downcast::().unwrap(); async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); - let proxysink = ProxySink::from_instance(&element); + let proxysink = element.imp(); match event.view() { EventView::Eos(..) => { @@ -873,7 +873,7 @@ impl TaskImpl for ProxySrcTask { async move { gst_log!(SRC_CAT, obj: &self.element, "Starting task"); - let proxysrc = ProxySrc::from_instance(&self.element); + let proxysrc = self.element.imp(); let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap(); let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared(); @@ -904,7 +904,7 @@ impl TaskImpl for ProxySrcTask { }; let pad = self.src_pad.upgrade().expect("PadSrc no longer exists"); - let proxysrc = ProxySrc::from_instance(&self.element); + let proxysrc = self.element.imp(); let res = ProxySrcPadHandler::push_item(&pad, proxysrc, item).await; match res { Ok(()) => { @@ -948,7 +948,7 @@ impl TaskImpl for ProxySrcTask { async move { gst_log!(SRC_CAT, obj: &self.element, "Stopping task"); - let proxysrc = ProxySrc::from_instance(&self.element); + let proxysrc = self.element.imp(); let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap(); let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared(); @@ -971,7 +971,7 @@ impl TaskImpl for ProxySrcTask { async move { gst_log!(SRC_CAT, obj: &self.element, "Starting task flush"); - let proxysrc = ProxySrc::from_instance(&self.element); + let proxysrc = self.element.imp(); let proxy_ctx = proxysrc.proxy_ctx.lock().unwrap(); let mut shared_ctx = proxy_ctx.as_ref().unwrap().lock_shared(); diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index a9d01e28..9742f485 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -96,7 +96,7 @@ impl PadSinkHandler for QueuePadSinkHandler { async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", buffer); - let queue = Queue::from_instance(&element); + let queue = element.imp(); queue .enqueue_item(&element, DataQueueItem::Buffer(buffer)) .await @@ -116,7 +116,7 @@ impl PadSinkHandler for QueuePadSinkHandler { async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", list); - let queue = Queue::from_instance(&element); + let queue = element.imp(); queue .enqueue_item(&element, DataQueueItem::BufferList(list)) .await @@ -167,7 +167,7 @@ impl PadSinkHandler for QueuePadSinkHandler { let element = element.clone().downcast::().unwrap(); async move { let pad = pad_weak.upgrade().expect("PadSink no longer exists"); - let queue = Queue::from_instance(&element); + let queue = element.imp(); if let EventView::FlushStop(..) = event.view() { if let Err(err) = queue.task.flush_stop() { @@ -342,7 +342,7 @@ impl TaskImpl for QueueTask { async move { gst_log!(CAT, obj: &self.element, "Starting task"); - let queue = Queue::from_instance(&self.element); + let queue = self.element.imp(); let mut last_res = queue.last_res.lock().unwrap(); self.dataqueue.start(); @@ -368,7 +368,7 @@ impl TaskImpl for QueueTask { }; let pad = self.src_pad.upgrade().expect("PadSrc no longer exists"); - let queue = Queue::from_instance(&self.element); + let queue = self.element.imp(); let res = QueuePadSrcHandler::push_item(&pad, queue, item).await; match res { Ok(()) => { @@ -405,7 +405,7 @@ impl TaskImpl for QueueTask { async move { gst_log!(CAT, obj: &self.element, "Stopping task"); - let queue = Queue::from_instance(&self.element); + let queue = self.element.imp(); let mut last_res = queue.last_res.lock().unwrap(); self.dataqueue.stop(); @@ -427,7 +427,7 @@ impl TaskImpl for QueueTask { async move { gst_log!(CAT, obj: &self.element, "Starting task flush"); - let queue = Queue::from_instance(&self.element); + let queue = self.element.imp(); let mut last_res = queue.last_res.lock().unwrap(); self.dataqueue.clear(); diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index d994de95..1d8ae9ed 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -617,7 +617,7 @@ impl PadSinkHandler for UdpSinkPadHandler { async move { if let EventView::FlushStop(_) = event.view() { - let udpsink = UdpSink::from_instance(&element); + let udpsink = element.imp(); return udpsink.task.flush_stop().is_ok(); } else if let Some(sender) = sender.lock().await.as_mut() { if sender.send(TaskItem::Event(event)).await.is_err() { @@ -1128,7 +1128,7 @@ impl ObjectImpl for UdpSink { let port = args[2].get::().expect("signal arg"); if let Ok(addr) = try_into_socket_addr(&element, &host, port) { - let udpsink = UdpSink::from_instance(&element); + let udpsink = element.imp(); udpsink.add_client(addr); } @@ -1147,7 +1147,7 @@ impl ObjectImpl for UdpSink { let port = args[2].get::().expect("signal arg"); if let Ok(addr) = try_into_socket_addr(&element, &host, port) { - let udpsink = UdpSink::from_instance(&element); + let udpsink = element.imp(); udpsink.remove_client(addr); } @@ -1159,7 +1159,7 @@ impl ObjectImpl for UdpSink { .class_handler(|_, args| { let element = args[0].get::().expect("signal arg"); - let udpsink = UdpSink::from_instance(&element); + let udpsink = element.imp(); udpsink.clear_clients(std::iter::empty()); None diff --git a/generic/threadshare/tests/pad.rs b/generic/threadshare/tests/pad.rs index 30c7fd2b..09c1279a 100644 --- a/generic/threadshare/tests/pad.rs +++ b/generic/threadshare/tests/pad.rs @@ -488,7 +488,7 @@ mod imp_sink { .downcast::() .unwrap(); async move { - let elem_sink_test = ElementSinkTest::from_instance(&element); + let elem_sink_test = element.imp(); elem_sink_test .forward_item(&element, Item::Buffer(buffer)) .await @@ -508,7 +508,7 @@ mod imp_sink { .downcast::() .unwrap(); async move { - let elem_sink_test = ElementSinkTest::from_instance(&element); + let elem_sink_test = element.imp(); elem_sink_test .forward_item(&element, Item::BufferList(list)) .await @@ -548,7 +548,7 @@ mod imp_sink { .downcast::() .unwrap(); async move { - let elem_sink_test = ElementSinkTest::from_instance(&element); + let elem_sink_test = element.imp(); if let EventView::FlushStop(..) = event.view() { elem_sink_test.start(&element); @@ -806,7 +806,7 @@ fn nominal_scenario( src_element: ElementSrcTest, mut receiver: mpsc::Receiver, ) { - let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element); + let elem_src_test = src_element.imp(); pipeline.set_state(gst::State::Playing).unwrap(); @@ -1018,7 +1018,7 @@ fn start_pause_start() { let (pipeline, src_element, _sink_element, mut receiver) = setup(scenario_name, None, None); - let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element); + let elem_src_test = src_element.imp(); pipeline.set_state(gst::State::Playing).unwrap(); @@ -1096,7 +1096,7 @@ fn start_stop_start() { let (pipeline, src_element, _sink_element, mut receiver) = setup(scenario_name, None, None); - let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element); + let elem_src_test = src_element.imp(); pipeline.set_state(gst::State::Playing).unwrap(); @@ -1209,7 +1209,7 @@ fn start_flush() { let (pipeline, src_element, sink_element, mut receiver) = setup(scenario_name, None, None); - let elem_src_test = imp_src::ElementSrcTest::from_instance(&src_element); + let elem_src_test = src_element.imp(); pipeline.set_state(gst::State::Playing).unwrap(); @@ -1249,7 +1249,7 @@ fn start_flush() { .try_push(Item::Buffer(gst::Buffer::from_slice(vec![1, 2, 3, 4]))) .unwrap(); - let elem_sink_test = imp_sink::ElementSinkTest::from_instance(&sink_element); + let elem_sink_test = sink_element.imp(); elem_sink_test.push_flush_start(&sink_element); diff --git a/net/hlssink3/src/imp.rs b/net/hlssink3/src/imp.rs index 7c51b006..44021465 100644 --- a/net/hlssink3/src/imp.rs +++ b/net/hlssink3/src/imp.rs @@ -577,7 +577,7 @@ impl ObjectImpl for HlsSink3 { .expect("playlist-stream signal arg"); let playlist_location = args[1].get::().expect("playlist-stream signal arg"); - let hlssink3 = HlsSink3::from_instance(&element); + let hlssink3 = element.imp(); Some( hlssink3 @@ -603,7 +603,7 @@ impl ObjectImpl for HlsSink3 { .expect("fragment-stream signal arg"); let fragment_location = args[1].get::().expect("fragment-stream signal arg"); - let hlssink3 = HlsSink3::from_instance(&element); + let hlssink3 = element.imp(); Some( hlssink3 @@ -626,7 +626,7 @@ impl ObjectImpl for HlsSink3 { .class_handler(|_, args| { let element = args[0].get::().expect("signal arg"); let fragment_location = args[1].get::().expect("signal arg"); - let hlssink3 = HlsSink3::from_instance(&element); + let hlssink3 = element.imp(); hlssink3.delete_fragment(&element, &fragment_location); Some(true.to_value()) @@ -676,7 +676,7 @@ impl ObjectImpl for HlsSink3 { Some(element) => element, None => return Some(None::.to_value()), }; - let hlssink3 = HlsSink3::from_instance(&element); + let hlssink3 = element.imp(); let fragment_id = args[1].get::().unwrap(); diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs index b09d03c8..16b006f2 100644 --- a/net/rusoto/src/aws_transcriber/imp.rs +++ b/net/rusoto/src/aws_transcriber/imp.rs @@ -599,7 +599,7 @@ impl Transcriber { } }; - let transcribe = Self::from_instance(&element); + let transcribe = element.imp(); if let Err(err) = transcribe.loop_fn(&element, &mut receiver) { element_error!( &element, @@ -963,7 +963,7 @@ impl Transcriber { let element_weak = element.downgrade(); let future = async move { while let Some(element) = element_weak.upgrade() { - let transcribe = Self::from_instance(&element); + let transcribe = element.imp(); let msg = match ws_stream.next().await { Some(msg) => msg, None => { diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index 92e49285..3618d55f 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -394,7 +394,7 @@ impl JsonGstParse { } }; - let parse = Self::from_instance(&element); + let parse = element.imp(); parse.loop_fn(&element); }); if res.is_err() { diff --git a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs index dea3ee6b..c552a1c5 100644 --- a/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/custom_source/imp.rs @@ -208,7 +208,7 @@ impl CustomSource { None => return, Some(element) => element, }; - let src = CustomSource::from_instance(&element); + let src = element.imp(); if let Err(msg) = src.handle_source_pad_added(&element, pad) { element.post_error_message(msg); @@ -220,7 +220,7 @@ impl CustomSource { None => return, Some(element) => element, }; - let src = CustomSource::from_instance(&element); + let src = element.imp(); src.handle_source_pad_removed(&element, pad); }); @@ -231,7 +231,7 @@ impl CustomSource { None => return, Some(element) => element, }; - let src = CustomSource::from_instance(&element); + let src = element.imp(); src.handle_source_no_more_pads(&element); }); diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index c1c006de..b4e68190 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -612,7 +612,7 @@ impl ObjectImpl for FallbackSrc { .action() .class_handler(|_token, args| { let element = args[0].get::().expect("signal arg"); - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); let mut state_guard = src.state.lock().unwrap(); let state = match &mut *state_guard { None => { @@ -840,7 +840,7 @@ impl FallbackSrc { None => return, Some(element) => element, }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); if let Err(msg) = src.handle_source_pad_added(&element, pad) { element.post_error_message(msg); @@ -852,7 +852,7 @@ impl FallbackSrc { None => return, Some(element) => element, }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); src.handle_source_pad_removed(&element, pad); }); @@ -936,7 +936,7 @@ impl FallbackSrc { Some(element) => element, }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); src.handle_switch_active_pad_change(&element); }); switch.set_property("timeout", timeout.nseconds()); @@ -962,7 +962,7 @@ impl FallbackSrc { Some(element) => element, }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); src.proxy_pad_chain(&element, pad, buffer) } }) @@ -1350,7 +1350,7 @@ impl FallbackSrc { Some(element) => element, }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); match info.data { Some(gst::PadProbeData::Event(ref ev)) if ev.type_() == gst::EventType::Eos => { @@ -1446,7 +1446,7 @@ impl FallbackSrc { _ => unreachable!(), }; - let src = FallbackSrc::from_instance(&element); + let src = element.imp(); if let Err(msg) = src.handle_pad_blocked(&element, pad, pts) { element.post_error_message(msg); @@ -2066,7 +2066,7 @@ impl FallbackSrc { let source_weak = state.source.downgrade(); element.call_async(move |element| { - let src = FallbackSrc::from_instance(element); + let src = element.imp(); let source = match source_weak.upgrade() { None => return, @@ -2150,7 +2150,7 @@ impl FallbackSrc { gst_debug!(CAT, obj: &element, "Woke up, retrying"); element.call_async(|element| { - let src = FallbackSrc::from_instance(element); + let src = element.imp(); let mut state_guard = src.state.lock().unwrap(); let state = match &mut *state_guard { @@ -2288,7 +2288,7 @@ impl FallbackSrc { }; element.call_async(move |element| { - let src = FallbackSrc::from_instance(element); + let src = element.imp(); gst_debug!(CAT, obj: element, "Source restart timeout triggered"); let mut state_guard = src.state.lock().unwrap(); diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index 7b142f56..05a12e73 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -840,7 +840,7 @@ impl BinImpl for UriPlaylistBin { } gst::MessageView::Error(error) => { // find item which raised the error - let self_ = UriPlaylistBin::from_instance(element); + let self_ = element.imp(); let mut state_guard = self_.state.lock().unwrap(); let state = state_guard.as_mut().unwrap(); @@ -1050,7 +1050,7 @@ impl UriPlaylistBin { Some(element) => element, None => return, }; - let self_ = UriPlaylistBin::from_instance(&element); + let self_ = element.imp(); let item = { let mut state_guard = self_.state.lock().unwrap(); @@ -1289,7 +1289,7 @@ impl UriPlaylistBin { Some(element) => element, None => return gst::PadProbeReturn::Remove, }; - let self_ = UriPlaylistBin::from_instance(&element); + let self_ = element.imp(); let item = { let mut state_guard = self_.state.lock().unwrap(); @@ -1427,7 +1427,7 @@ impl UriPlaylistBin { item.index() ); - let self_ = UriPlaylistBin::from_instance(&element); + let self_ = element.imp(); { let mut state_guard = self_.state.lock().unwrap(); let state = state_guard.as_mut().unwrap(); diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index b48221c1..854f0be4 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -626,7 +626,7 @@ impl MccParse { } }; - let parse = Self::from_instance(&element); + let parse = element.imp(); parse.loop_fn(&element); }); if res.is_err() { diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index b4ac750c..d1421bce 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -514,7 +514,7 @@ impl SccParse { } }; - let parse = Self::from_instance(&element); + let parse = element.imp(); parse.loop_fn(&element); }); if res.is_err() { diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 62e6dad9..34056002 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -302,7 +302,7 @@ impl TranscriberBin { Some(element) => element, }; - let this = TranscriberBin::from_instance(&element); + let this = element.imp(); this.disable_transcription_bin(&element); @@ -858,7 +858,7 @@ impl BinImpl for TranscriberBin { bin.notify("passthrough"); drop(settings); bin.call_async(move |bin| { - let thiz = TranscriberBin::from_instance(bin); + let thiz = bin.imp(); thiz.block_and_update(bin, true); }); } else { diff --git a/video/gtk4/src/sink/mod.rs b/video/gtk4/src/sink/mod.rs index 5eca6444..6eb8c1d5 100644 --- a/video/gtk4/src/sink/mod.rs +++ b/video/gtk4/src/sink/mod.rs @@ -46,7 +46,7 @@ impl PaintableSink { } fn pending_frame(&self) -> Option { - let self_ = imp::PaintableSink::from_instance(self); + let self_ = self.imp(); self_.pending_frame.lock().unwrap().take() } @@ -84,12 +84,12 @@ impl PaintableSink { **paintable_storage = Some(paintable); - let self_ = imp::PaintableSink::from_instance(self); + let self_ = self.imp(); *self_.sender.lock().unwrap() = Some(sender); } fn do_action(&self, action: SinkEvent) -> glib::Continue { - let self_ = imp::PaintableSink::from_instance(self); + let self_ = self.imp(); let paintable = self_.paintable.lock().unwrap().clone(); let paintable = match paintable { Some(paintable) => paintable, diff --git a/video/gtk4/src/sink/paintable/mod.rs b/video/gtk4/src/sink/paintable/mod.rs index 8f15eb92..7e3eb263 100644 --- a/video/gtk4/src/sink/paintable/mod.rs +++ b/video/gtk4/src/sink/paintable/mod.rs @@ -35,7 +35,7 @@ impl Default for SinkPaintable { impl SinkPaintable { pub(crate) fn handle_frame_changed(&self, frame: Option) { - let self_ = imp::SinkPaintable::from_instance(self); + let self_ = self.imp(); self_.handle_frame_changed(self, frame); } }