From 65fcd55160d126c549a89b613cdf84714a5b346e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 19 Jan 2022 15:07:45 +0200 Subject: Update for event/message/query view API changes --- audio/audiofx/src/audioloudnorm/imp.rs | 4 ++-- audio/audiofx/src/audiornnoise/imp.rs | 2 +- generic/fmp4/src/fmp4mux/imp.rs | 10 +++++----- generic/sodium/src/decrypter/imp.rs | 6 +++--- generic/sodium/src/encrypter/imp.rs | 6 +++--- generic/threadshare/src/appsrc/imp.rs | 8 ++++---- generic/threadshare/src/inputselector/imp.rs | 4 ++-- generic/threadshare/src/jitterbuffer/imp.rs | 6 +++--- generic/threadshare/src/proxy/imp.rs | 8 ++++---- generic/threadshare/src/queue/imp.rs | 4 ++-- generic/threadshare/src/tcpclientsrc/imp.rs | 8 ++++---- generic/threadshare/src/udpsrc/imp.rs | 8 ++++---- net/hlssink3/src/imp.rs | 2 +- net/reqwest/src/reqwesthttpsrc/imp.rs | 4 ++-- net/rusoto/src/aws_transcriber/imp.rs | 6 +++--- net/rusoto/src/s3src/imp.rs | 2 +- text/json/src/jsongstparse/imp.rs | 12 ++++++------ text/wrap/src/gsttextwrap/imp.rs | 4 ++-- tutorial/src/progressbin/imp.rs | 2 +- tutorial/src/sinesrc/imp.rs | 4 ++-- tutorial/tutorial-2.md | 4 ++-- utils/fallbackswitch/src/fallbacksrc/imp.rs | 8 ++++---- utils/togglerecord/src/togglerecord/imp.rs | 10 +++++----- utils/togglerecord/tests/tests.rs | 4 ++-- utils/uriplaylistbin/src/uriplaylistbin/imp.rs | 8 ++++---- video/cdg/src/cdgdec/imp.rs | 2 +- video/closedcaption/src/jsontovtt/imp.rs | 4 ++-- video/closedcaption/src/mcc_enc/imp.rs | 4 ++-- video/closedcaption/src/mcc_parse/imp.rs | 12 ++++++------ video/closedcaption/src/scc_enc/imp.rs | 4 ++-- video/closedcaption/src/scc_parse/imp.rs | 12 ++++++------ video/closedcaption/src/transcriberbin/imp.rs | 6 +++--- video/dav1d/src/dav1ddec/imp.rs | 2 +- video/ffv1/src/ffv1dec/imp.rs | 2 +- video/flavors/src/flvdemux/imp.rs | 6 +++--- video/gif/src/gifenc/imp.rs | 2 +- video/gtk4/src/sink/imp.rs | 2 +- video/rav1e/src/rav1enc/imp.rs | 2 +- video/videofx/src/border/roundedcorners.rs | 4 ++-- 39 files changed, 104 insertions(+), 104 deletions(-) diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index 6c2fbdaf6..e08d3231d 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -1689,11 +1689,11 @@ impl AudioLoudNorm { element: &super::AudioLoudNorm, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut peer_query = gst::query::Latency::new(); if self.sinkpad.peer_query(&mut peer_query) { let (live, min_latency, max_latency) = peer_query.result(); diff --git a/audio/audiofx/src/audiornnoise/imp.rs b/audio/audiofx/src/audiornnoise/imp.rs index 1e865414e..ea12101c9 100644 --- a/audio/audiofx/src/audiornnoise/imp.rs +++ b/audio/audiofx/src/audiornnoise/imp.rs @@ -352,7 +352,7 @@ impl BaseTransformImpl for AudioRNNoise { query: &mut gst::QueryRef, ) -> bool { if direction == gst::PadDirection::Src { - if let gst::QueryView::Latency(ref mut q) = query.view_mut() { + if let gst::QueryViewMut::Latency(q) = query.view_mut() { let sink_pad = element.static_pad("sink").expect("Sink pad not found"); let mut upstream_query = gst::query::Latency::new(); if sink_pad.peer_query(&mut upstream_query) { diff --git a/generic/fmp4/src/fmp4mux/imp.rs b/generic/fmp4/src/fmp4mux/imp.rs index 069046371..740e6b980 100644 --- a/generic/fmp4/src/fmp4mux/imp.rs +++ b/generic/fmp4/src/fmp4mux/imp.rs @@ -950,12 +950,12 @@ impl FMP4Mux { element: &super::FMP4Mux, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_trace!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Caps(mut q) => { + QueryViewMut::Caps(q) => { let state = self.state.lock().unwrap(); let allowed_caps = if let Some(ref caps) = state.caps { @@ -996,17 +996,17 @@ impl FMP4Mux { element: &super::FMP4Mux, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_trace!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { // We can't really handle seeking, it would break everything q.set(false, gst::ClockTime::ZERO.into(), gst::ClockTime::NONE); true } - QueryView::Latency(mut q) => { + QueryViewMut::Latency(q) => { if !self.sinkpad.peer_query(q.query_mut()) { return false; } diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index 02e0faa00..10cfd80e9 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -285,12 +285,12 @@ impl Decrypter { element: &super::Decrypter, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Scheduling(mut q) => { + QueryViewMut::Scheduling(q) => { let mut peer_query = gst::query::Scheduling::new(); let res = self.sinkpad.peer_query(&mut peer_query); if !res { @@ -305,7 +305,7 @@ impl Decrypter { gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut()); true } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } diff --git a/generic/sodium/src/encrypter/imp.rs b/generic/sodium/src/encrypter/imp.rs index fe57cf485..35c2c60cc 100644 --- a/generic/sodium/src/encrypter/imp.rs +++ b/generic/sodium/src/encrypter/imp.rs @@ -268,12 +268,12 @@ impl Encrypter { element: &super::Encrypter, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { let format = q.format(); q.set( false, @@ -283,7 +283,7 @@ impl Encrypter { gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut()); true } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { if q.format() != gst::Format::Bytes { return pad.query_default(Some(element), query); } diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 547c93757..736ea24eb 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -220,20 +220,20 @@ impl PadSrcHandler for AppSrcPadHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); let ret = match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { q.set(true, gst::ClockTime::ZERO, gst::ClockTime::NONE); true } - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { q.set(gst::SchedulingFlags::SEQUENTIAL, 1, -1, 0); q.add_scheduling_modes(&[gst::PadMode::Push]); true } - QueryView::Caps(ref mut q) => { + QueryViewMut::Caps(q) => { let caps = if let Some(caps) = self.0.configured_caps.lock().unwrap().as_ref() { q.filter() .map(|f| f.intersect_with_mode(caps, gst::CapsIntersectMode::First)) diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index 8c75248d0..27f921981 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -287,12 +287,12 @@ impl PadSrcHandler for InputSelectorPadSrcHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut ret = true; let mut min_latency = gst::ClockTime::ZERO; let mut max_latency = gst::ClockTime::NONE; diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 084d1f5d6..2e50d864b 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -933,12 +933,12 @@ impl PadSrcHandler for SrcHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Forwarding {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut peer_query = gst::query::Latency::new(); let ret = jb.sink_pad.gst_pad().peer_query(&mut peer_query); @@ -954,7 +954,7 @@ impl PadSrcHandler for SrcHandler { ret } - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { if q.format() != gst::Format::Time { jb.sink_pad.gst_pad().peer_query(query) } else { diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index de1b581be..6560b5229 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -810,20 +810,20 @@ impl PadSrcHandler for ProxySrcPadHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(SRC_CAT, obj: pad.gst_pad(), "Handling {:?}", query); let ret = match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { q.set(true, gst::ClockTime::ZERO, gst::ClockTime::NONE); true } - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { q.set(gst::SchedulingFlags::SEQUENTIAL, 1, -1, 0); q.add_scheduling_modes(&[gst::PadMode::Push]); true } - QueryView::Caps(ref mut q) => { + QueryViewMut::Caps(q) => { let caps = if let Some(ref caps) = pad.gst_pad().current_caps() { q.filter() .map(|f| f.intersect_with_mode(caps, gst::CapsIntersectMode::First)) diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index 9742f4855..c0f1130fe 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -288,11 +288,11 @@ impl PadSrcHandler for QueuePadSrcHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); - if let QueryView::Scheduling(ref mut q) = query.view_mut() { + if let QueryViewMut::Scheduling(q) = query.view_mut() { let mut new_query = gst::query::Scheduling::new(); let res = queue.sink_pad.gst_pad().peer_query(&mut new_query); if !res { diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index 52ad7d491..5def35cb3 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -221,20 +221,20 @@ impl PadSrcHandler for TcpClientSrcPadHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); let ret = match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { q.set(false, gst::ClockTime::ZERO, gst::ClockTime::NONE); true } - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { q.set(gst::SchedulingFlags::SEQUENTIAL, 1, -1, 0); q.add_scheduling_modes(&[gst::PadMode::Push]); true } - QueryView::Caps(ref mut q) => { + QueryViewMut::Caps(q) => { let caps = if let Some(caps) = self.0.configured_caps.lock().unwrap().as_ref() { q.filter() .map(|f| f.intersect_with_mode(caps, gst::CapsIntersectMode::First)) diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index 2c7b16b85..ba2ef0cdb 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -234,21 +234,21 @@ impl PadSrcHandler for UdpSrcPadHandler { _element: &gst::Element, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad.gst_pad(), "Handling {:?}", query); let ret = match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { q.set(true, gst::ClockTime::ZERO, gst::ClockTime::NONE); true } - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { q.set(gst::SchedulingFlags::SEQUENTIAL, 1, -1, 0); q.add_scheduling_modes(&[gst::PadMode::Push]); true } - QueryView::Caps(ref mut q) => { + QueryViewMut::Caps(q) => { let caps = if let Some(caps) = self.0.configured_caps.lock().unwrap().as_ref() { q.filter() .map(|f| f.intersect_with_mode(caps, gst::CapsIntersectMode::First)) diff --git a/net/hlssink3/src/imp.rs b/net/hlssink3/src/imp.rs index 44021465f..9678324c9 100644 --- a/net/hlssink3/src/imp.rs +++ b/net/hlssink3/src/imp.rs @@ -362,7 +362,7 @@ impl BinImpl for HlsSink3 { use gst::MessageView; match msg.view() { - MessageView::Element(ref msg) => { + MessageView::Element(msg) => { let event_is_from_splitmuxsink = { let settings = self.settings.lock().unwrap(); diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index 2622a26ef..97e8138e7 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -1077,10 +1077,10 @@ impl BaseSrcImpl for ReqwestHttpSrc { } fn query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { - use gst::QueryView; + use gst::QueryViewMut; match query.view_mut() { - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { q.set( gst::SchedulingFlags::SEQUENTIAL | gst::SchedulingFlags::BANDWIDTH_LIMITED, 1, diff --git a/net/rusoto/src/aws_transcriber/imp.rs b/net/rusoto/src/aws_transcriber/imp.rs index 16b006f23..b30085b22 100644 --- a/net/rusoto/src/aws_transcriber/imp.rs +++ b/net/rusoto/src/aws_transcriber/imp.rs @@ -642,12 +642,12 @@ impl Transcriber { element: &super::Transcriber, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut peer_query = gst::query::Latency::new(); let ret = self.sinkpad.peer_query(&mut peer_query); @@ -659,7 +659,7 @@ impl Transcriber { } ret } - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); q.set( diff --git a/net/rusoto/src/s3src/imp.rs b/net/rusoto/src/s3src/imp.rs index 9e2dd939c..fe49429d3 100644 --- a/net/rusoto/src/s3src/imp.rs +++ b/net/rusoto/src/s3src/imp.rs @@ -426,7 +426,7 @@ impl BaseSrcImpl for S3Src { } fn query(&self, src: &Self::Type, query: &mut gst::QueryRef) -> bool { - if let gst::QueryView::Scheduling(ref mut q) = query.view_mut() { + if let gst::QueryViewMut::Scheduling(q) = query.view_mut() { q.set( gst::SchedulingFlags::SEQUENTIAL | gst::SchedulingFlags::BANDWIDTH_LIMITED, 1, diff --git a/text/json/src/jsongstparse/imp.rs b/text/json/src/jsongstparse/imp.rs index 3618d55f7..49a827de8 100644 --- a/text/json/src/jsongstparse/imp.rs +++ b/text/json/src/jsongstparse/imp.rs @@ -683,7 +683,7 @@ impl JsonGstParse { fn perform_seek( &self, - event: &gst::event::Seek<&gst::EventRef>, + event: &gst::event::Seek, element: &super::JsonGstParse, ) -> bool { if self.state.lock().unwrap().pull.is_none() { @@ -783,7 +783,7 @@ impl JsonGstParse { gst_log!(CAT, obj: pad, "Handling event {:?}", event); match event.view() { - EventView::Seek(e) => self.perform_seek(&e, element), + EventView::Seek(e) => self.perform_seek(e, element), _ => pad.event_default(Some(element), event), } } @@ -794,12 +794,12 @@ impl JsonGstParse { element: &super::JsonGstParse, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { let state = self.state.lock().unwrap(); let fmt = q.format(); @@ -819,7 +819,7 @@ impl JsonGstParse { false } } - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { // For Time answer ourselfs, otherwise forward if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); @@ -829,7 +829,7 @@ impl JsonGstParse { self.sinkpad.peer_query(query) } } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { // For Time answer ourselfs, otherwise forward let state = self.state.lock().unwrap(); if q.format() == gst::Format::Time { diff --git a/text/wrap/src/gsttextwrap/imp.rs b/text/wrap/src/gsttextwrap/imp.rs index 32ab807b4..2c8423232 100644 --- a/text/wrap/src/gsttextwrap/imp.rs +++ b/text/wrap/src/gsttextwrap/imp.rs @@ -406,12 +406,12 @@ impl TextWrap { element: &super::TextWrap, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut peer_query = gst::query::Latency::new(); let ret = self.sinkpad.peer_query(&mut peer_query); diff --git a/tutorial/src/progressbin/imp.rs b/tutorial/src/progressbin/imp.rs index 38a654005..2dee9d1af 100644 --- a/tutorial/src/progressbin/imp.rs +++ b/tutorial/src/progressbin/imp.rs @@ -225,7 +225,7 @@ impl BinImpl for ProgressBin { // to stdout. Otherwise we pass through to the default message // handling of the parent class, i.e. forwarding to the parent // bins and the application. - MessageView::Element(ref msg) + MessageView::Element(msg) if msg.src().as_ref() == Some(self.progress.upcast_ref()) && msg .structure() diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 91c5da60e..377cd5c31 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -488,13 +488,13 @@ impl BaseSrcImpl for SineSrc { } fn query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { - use gst::QueryView; + use gst::QueryViewMut; match query.view_mut() { // In Live mode we will have a latency equal to the number of samples in each buffer. // We can't output samples before they were produced, and the last sample of a buffer // is produced that much after the beginning, leading to this latency calculation - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let settings = *self.settings.lock().unwrap(); let state = self.state.lock().unwrap(); diff --git a/tutorial/tutorial-2.md b/tutorial/tutorial-2.md index d3615195f..3b633c53e 100644 --- a/tutorial/tutorial-2.md +++ b/tutorial/tutorial-2.md @@ -769,13 +769,13 @@ This querying is done with the `LATENCY` query, which we will have to handle i ```rust fn query(&self, element: &Self::Type, query: &mut gst::QueryRef) -> bool { - use gst::QueryView; + use gst::QueryViewMut; match query.view_mut() { // In Live mode we will have a latency equal to the number of samples in each buffer. // We can't output samples before they were produced, and the last sample of a buffer // is produced that much after the beginning, leading to this latency calculation - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let settings = *self.settings.lock().unwrap(); let state = self.state.lock().unwrap(); diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index b4e68190c..ec78d8f0a 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -783,18 +783,18 @@ impl BinImpl for FallbackSrc { use gst::MessageView; match msg.view() { - MessageView::Buffering(ref m) => { + MessageView::Buffering(m) => { // Don't forward upwards, we handle this internally self.handle_buffering(bin, m); } - MessageView::StreamsSelected(ref m) => { + MessageView::StreamsSelected(m) => { // Don't forward upwards, we are exposing streams based on properties // TODO: Do stream configuration via our own stream collection and handling // of stream select events // TODO: Also needs updating of StreamCollection handling in CustomSource self.handle_streams_selected(bin, m); } - MessageView::Error(ref m) => { + MessageView::Error(m) => { if !self.handle_error(bin, m) { self.parent_handle_message(bin, msg); } @@ -1440,7 +1440,7 @@ impl FallbackSrc { let pts = match info.data { Some(gst::PadProbeData::Buffer(ref buffer)) => buffer.pts(), Some(gst::PadProbeData::Event(ref ev)) => match ev.view() { - gst::EventView::Gap(ref ev) => Some(ev.get().0), + gst::EventView::Gap(ev) => Some(ev.get().0), _ => return gst::PadProbeReturn::Pass, }, _ => unreachable!(), diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 78a607654..57ec1e0a1 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -1578,7 +1578,7 @@ impl ToggleRecord { element: &super::ToggleRecord, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; let stream = match self.pads.lock().get(pad) { None => { @@ -1594,7 +1594,7 @@ impl ToggleRecord { gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Scheduling(ref mut q) => { + QueryViewMut::Scheduling(q) => { let mut new_query = gst::query::Scheduling::new(); let res = stream.sinkpad.peer_query(&mut new_query); if !res { @@ -1616,7 +1616,7 @@ impl ToggleRecord { gst_log!(CAT, obj: pad, "Returning {:?}", q.query_mut()); true } - QueryView::Seeking(ref mut q) => { + QueryViewMut::Seeking(q) => { // Seeking is not possible here let format = q.format(); q.set( @@ -1629,7 +1629,7 @@ impl ToggleRecord { true } // Position and duration is always the current recording position - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { if q.format() == gst::Format::Time { let state = stream.state.lock(); let rec_state = self.state.lock(); @@ -1663,7 +1663,7 @@ impl ToggleRecord { false } } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { if q.format() == gst::Format::Time { let state = stream.state.lock(); let rec_state = self.state.lock(); diff --git a/utils/togglerecord/tests/tests.rs b/utils/togglerecord/tests/tests.rs index 18c3df7dd..a0a7e03fa 100644 --- a/utils/togglerecord/tests/tests.rs +++ b/utils/togglerecord/tests/tests.rs @@ -229,7 +229,7 @@ fn recv_buffers( use gst::EventView; match event.view() { - EventView::Gap(ref e) => { + EventView::Gap(e) => { let (ts, duration) = e.get(); res.push((segment.to_running_time(ts), Some(ts), duration)); @@ -242,7 +242,7 @@ fn recv_buffers( saw_eos = true; return (res, saw_eos); } - EventView::Segment(ref e) => { + EventView::Segment(e) => { *segment = e.segment().clone().downcast().unwrap(); } _ => (), diff --git a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs index e4f4091e3..33c953c46 100644 --- a/utils/uriplaylistbin/src/uriplaylistbin/imp.rs +++ b/utils/uriplaylistbin/src/uriplaylistbin/imp.rs @@ -436,7 +436,7 @@ impl Item { // from the WaitingForStreamCollection state, called when we received the item stream collection // and its stream topology matches what is currently being processed by the element. - fn set_waiting_for_pads(&self, n_streams: u32, msg: gst::message::StreamCollection) { + fn set_waiting_for_pads(&self, n_streams: u32, msg: &gst::message::StreamCollection) { let mut inner = self.inner.lock().unwrap(); assert!(matches!( inner.state, @@ -463,7 +463,7 @@ impl Item { // from the WaitingForStreamCollection state, called when we received the item stream collection // but its stream topology does not match what is currently being processed by the element, // having to wait until streamsynchronizer is flushed to internally reorganize the element. - fn set_waiting_for_ss_eos(&self, waiting_eos: u32, msg: gst::message::StreamCollection) { + fn set_waiting_for_ss_eos(&self, waiting_eos: u32, msg: &gst::message::StreamCollection) { let mut inner = self.inner.lock().unwrap(); let (sender, receiver) = crossbeam_channel::unbounded::(); @@ -1111,7 +1111,7 @@ impl UriPlaylistBin { fn handle_stream_collection( &self, element: &super::UriPlaylistBin, - stream_collection_msg: gst::message::StreamCollection, + stream_collection_msg: &gst::message::StreamCollection, ) -> Result<(), PlaylistError> { let mut state_guard = self.state.lock().unwrap(); let state = state_guard.as_mut().unwrap(); @@ -1168,7 +1168,7 @@ impl UriPlaylistBin { fn handle_stream_selected( &self, element: &super::UriPlaylistBin, - stream_selected_msg: gst::message::StreamsSelected, + stream_selected_msg: &gst::message::StreamsSelected, ) -> bool { let mut state_guard = self.state.lock().unwrap(); let state = state_guard.as_mut().unwrap(); diff --git a/video/cdg/src/cdgdec/imp.rs b/video/cdg/src/cdgdec/imp.rs index 7b4c85107..eff413732 100644 --- a/video/cdg/src/cdgdec/imp.rs +++ b/video/cdg/src/cdgdec/imp.rs @@ -202,7 +202,7 @@ impl VideoDecoderImpl for CdgDec { fn decide_allocation( &self, element: &Self::Type, - query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { if query .find_allocation_meta::() diff --git a/video/closedcaption/src/jsontovtt/imp.rs b/video/closedcaption/src/jsontovtt/imp.rs index 554898800..d38b336e5 100644 --- a/video/closedcaption/src/jsontovtt/imp.rs +++ b/video/closedcaption/src/jsontovtt/imp.rs @@ -299,7 +299,7 @@ impl State { Ok(ret) } - fn handle_gap(&mut self, gap: gst::event::Gap<&gst::EventRef>) -> Vec { + fn handle_gap(&mut self, gap: &gst::event::Gap) -> Vec { let mut ret = vec![]; let (pts, duration) = gap.get(); @@ -362,7 +362,7 @@ impl JsonToVtt { gst_log!(CAT, obj: pad, "Handling event {:?}", event); match event.view() { - EventView::CustomUpstream(ref ev) => { + EventView::CustomUpstream(ev) => { if gst_video::ForceKeyUnitEvent::is(ev) { match gst_video::UpstreamForceKeyUnitEvent::parse(ev) { Ok(fku_event) => { diff --git a/video/closedcaption/src/mcc_enc/imp.rs b/video/closedcaption/src/mcc_enc/imp.rs index 5bce00598..1203d45e4 100644 --- a/video/closedcaption/src/mcc_enc/imp.rs +++ b/video/closedcaption/src/mcc_enc/imp.rs @@ -401,12 +401,12 @@ impl MccEnc { element: &super::MccEnc, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { // We don't support any seeking at all let fmt = q.format(); q.set( diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index 854f0be42..ec22450ef 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -945,7 +945,7 @@ impl MccParse { fn perform_seek( &self, - event: &gst::event::Seek<&gst::EventRef>, + event: &gst::event::Seek, element: &super::MccParse, ) -> bool { if self.state.lock().unwrap().pull.is_none() { @@ -1045,7 +1045,7 @@ impl MccParse { gst_log!(CAT, obj: pad, "Handling event {:?}", event); match event.view() { - EventView::Seek(e) => self.perform_seek(&e, element), + EventView::Seek(e) => self.perform_seek(e, element), _ => pad.event_default(Some(element), event), } } @@ -1056,12 +1056,12 @@ impl MccParse { element: &super::MccParse, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { let state = self.state.lock().unwrap(); let fmt = q.format(); @@ -1081,7 +1081,7 @@ impl MccParse { false } } - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { // For Time answer ourselfs, otherwise forward if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); @@ -1091,7 +1091,7 @@ impl MccParse { self.sinkpad.peer_query(query) } } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { // For Time answer ourselfs, otherwise forward let state = self.state.lock().unwrap(); if q.format() == gst::Format::Time { diff --git a/video/closedcaption/src/scc_enc/imp.rs b/video/closedcaption/src/scc_enc/imp.rs index 60598d701..3d51439f8 100644 --- a/video/closedcaption/src/scc_enc/imp.rs +++ b/video/closedcaption/src/scc_enc/imp.rs @@ -337,12 +337,12 @@ impl SccEnc { element: &super::SccEnc, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { // We don't support any seeking at all let fmt = q.format(); q.set( diff --git a/video/closedcaption/src/scc_parse/imp.rs b/video/closedcaption/src/scc_parse/imp.rs index d1421bce7..5163e0151 100644 --- a/video/closedcaption/src/scc_parse/imp.rs +++ b/video/closedcaption/src/scc_parse/imp.rs @@ -820,7 +820,7 @@ impl SccParse { fn perform_seek( &self, - event: &gst::event::Seek<&gst::EventRef>, + event: &gst::event::Seek, element: &super::SccParse, ) -> bool { if self.state.lock().unwrap().pull.is_none() { @@ -920,7 +920,7 @@ impl SccParse { gst_log!(CAT, obj: pad, "Handling event {:?}", event); match event.view() { - EventView::Seek(e) => self.perform_seek(&e, element), + EventView::Seek(e) => self.perform_seek(e, element), _ => pad.event_default(Some(element), event), } } @@ -931,12 +931,12 @@ impl SccParse { element: &super::SccParse, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Seeking(mut q) => { + QueryViewMut::Seeking(q) => { let state = self.state.lock().unwrap(); let fmt = q.format(); @@ -956,7 +956,7 @@ impl SccParse { false } } - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { // For Time answer ourselfs, otherwise forward if q.format() == gst::Format::Time { let state = self.state.lock().unwrap(); @@ -966,7 +966,7 @@ impl SccParse { self.sinkpad.peer_query(query) } } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { // For Time answer ourselfs, otherwise forward let state = self.state.lock().unwrap(); if q.format() == gst::Format::Time { diff --git a/video/closedcaption/src/transcriberbin/imp.rs b/video/closedcaption/src/transcriberbin/imp.rs index 340560025..0b804eb4c 100644 --- a/video/closedcaption/src/transcriberbin/imp.rs +++ b/video/closedcaption/src/transcriberbin/imp.rs @@ -384,12 +384,12 @@ impl TranscriberBin { element: &super::TranscriberBin, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; gst_log!(CAT, obj: pad, "Handling query {:?}", query); match query.view_mut() { - QueryView::Latency(ref mut q) => { + QueryViewMut::Latency(q) => { let mut upstream_query = gst::query::Latency::new(); let ret = pad.query_default(Some(element), &mut upstream_query); @@ -840,7 +840,7 @@ impl BinImpl for TranscriberBin { use gst::MessageView; match msg.view() { - MessageView::Error(ref m) => { + MessageView::Error(m) => { /* We must have a state here */ let s = self.state.lock().unwrap(); diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index de06b9bd3..9ce371d90 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -463,7 +463,7 @@ impl VideoDecoderImpl for Dav1dDec { fn decide_allocation( &self, element: &Self::Type, - query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { self.negotiation_infos.lock().unwrap().video_meta_supported = query .find_allocation_meta::() diff --git a/video/ffv1/src/ffv1dec/imp.rs b/video/ffv1/src/ffv1dec/imp.rs index 81a31e245..da359954f 100644 --- a/video/ffv1/src/ffv1dec/imp.rs +++ b/video/ffv1/src/ffv1dec/imp.rs @@ -458,7 +458,7 @@ impl VideoDecoderImpl for Ffv1Dec { fn decide_allocation( &self, element: &Self::Type, - query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { let supported = query .find_allocation_meta::() diff --git a/video/flavors/src/flvdemux/imp.rs b/video/flavors/src/flvdemux/imp.rs index b210ed1e9..e71e67c18 100644 --- a/video/flavors/src/flvdemux/imp.rs +++ b/video/flavors/src/flvdemux/imp.rs @@ -406,10 +406,10 @@ impl FlvDemux { element: &super::FlvDemux, query: &mut gst::QueryRef, ) -> bool { - use gst::QueryView; + use gst::QueryViewMut; match query.view_mut() { - QueryView::Position(ref mut q) => { + QueryViewMut::Position(q) => { let fmt = q.format(); if fmt == gst::Format::Time { if self.sinkpad.peer_query(q.query_mut()) { @@ -428,7 +428,7 @@ impl FlvDemux { false } } - QueryView::Duration(ref mut q) => { + QueryViewMut::Duration(q) => { let fmt = q.format(); if fmt == gst::Format::Time { if self.sinkpad.peer_query(q.query_mut()) { diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index 39b64cfe6..048dc62f3 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -275,7 +275,7 @@ impl VideoEncoderImpl for GifEnc { fn propose_allocation( &self, element: &Self::Type, - mut query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { query.add_allocation_meta::(None); self.parent_propose_allocation(element, query) diff --git a/video/gtk4/src/sink/imp.rs b/video/gtk4/src/sink/imp.rs index bb9634024..90c0b96fb 100644 --- a/video/gtk4/src/sink/imp.rs +++ b/video/gtk4/src/sink/imp.rs @@ -225,7 +225,7 @@ impl BaseSinkImpl for PaintableSink { fn propose_allocation( &self, element: &Self::Type, - mut query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { query.add_allocation_meta::(None); diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs index 80f15bf0c..286d87e69 100644 --- a/video/rav1e/src/rav1enc/imp.rs +++ b/video/rav1e/src/rav1enc/imp.rs @@ -488,7 +488,7 @@ impl VideoEncoderImpl for Rav1Enc { fn propose_allocation( &self, element: &Self::Type, - mut query: gst::query::Allocation<&mut gst::QueryRef>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { query.add_allocation_meta::(None); self.parent_propose_allocation(element, query) diff --git a/video/videofx/src/border/roundedcorners.rs b/video/videofx/src/border/roundedcorners.rs index d3f4819af..348569bf2 100644 --- a/video/videofx/src/border/roundedcorners.rs +++ b/video/videofx/src/border/roundedcorners.rs @@ -610,8 +610,8 @@ impl BaseTransformImpl for RoundedCorners { fn propose_allocation( &self, element: &Self::Type, - decide_query: Option>, - mut query: gst::query::Allocation<&mut gst::QueryRef>, + decide_query: Option<&gst::query::Allocation>, + query: &mut gst::query::Allocation, ) -> Result<(), gst::LoggableError> { query.add_allocation_meta::(None); self.parent_propose_allocation(element, decide_query, query) -- cgit v1.2.3