diff --git a/audio/audiofx/src/audioecho/imp.rs b/audio/audiofx/src/audioecho/imp.rs index a3f9423c..c369a4ab 100644 --- a/audio/audiofx/src/audioecho/imp.rs +++ b/audio/audiofx/src/audioecho/imp.rs @@ -11,8 +11,8 @@ use gst::prelude::*; use gst::subclass::prelude::*; use gst_audio::subclass::prelude::*; +use std::cmp; use std::sync::Mutex; -use std::{cmp, u64}; use byte_slice_cast::*; diff --git a/audio/audiofx/src/audioloudnorm/imp.rs b/audio/audiofx/src/audioloudnorm/imp.rs index 5ba17ad5..2703cf32 100644 --- a/audio/audiofx/src/audioloudnorm/imp.rs +++ b/audio/audiofx/src/audioloudnorm/imp.rs @@ -18,7 +18,6 @@ use gst::subclass::prelude::*; use std::mem; use std::sync::Mutex; -use std::u64; use byte_slice_cast::*; diff --git a/audio/audiofx/src/ebur128level/imp.rs b/audio/audiofx/src/ebur128level/imp.rs index bb39445b..a2ec1b0f 100644 --- a/audio/audiofx/src/ebur128level/imp.rs +++ b/audio/audiofx/src/ebur128level/imp.rs @@ -12,7 +12,6 @@ use gst::subclass::prelude::*; use gst_audio::subclass::prelude::*; use gst_base::prelude::*; -use std::i32; use std::sync::atomic; use std::sync::Mutex; diff --git a/audio/audiofx/tests/audioloudnorm.rs b/audio/audiofx/tests/audioloudnorm.rs index e36055c4..4dc53014 100644 --- a/audio/audiofx/tests/audioloudnorm.rs +++ b/audio/audiofx/tests/audioloudnorm.rs @@ -198,7 +198,7 @@ fn basic_two_channels() { #[test] fn silence() { - run_test("wave=silence", None, 1000, 1024, 1, std::f64::NEG_INFINITY); + run_test("wave=silence", None, 1000, 1024, 1, f64::NEG_INFINITY); } #[test] @@ -228,7 +228,7 @@ fn below_threshold() { 1000, 1024, 1, - std::f64::NEG_INFINITY, + f64::NEG_INFINITY, ); } diff --git a/audio/csound/src/filter/imp.rs b/audio/csound/src/filter/imp.rs index ed2a3426..0121f27c 100644 --- a/audio/csound/src/filter/imp.rs +++ b/audio/csound/src/filter/imp.rs @@ -17,7 +17,6 @@ use gst_base::subclass::prelude::*; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::Mutex; -use std::{f64, i32}; use byte_slice_cast::*; diff --git a/generic/sodium/src/decrypter/imp.rs b/generic/sodium/src/decrypter/imp.rs index 794e0d5a..1ae81283 100644 --- a/generic/sodium/src/decrypter/imp.rs +++ b/generic/sodium/src/decrypter/imp.rs @@ -500,7 +500,7 @@ impl Decrypter { gst::debug!(CAT, obj: pad, "Stream Block index: {}", chunk_index); let pull_offset = offset - (chunk_index * block_size as u64); - assert!(pull_offset <= std::u32::MAX as u64); + assert!(pull_offset <= u32::MAX as u64); let pull_offset = pull_offset as u32; let pulled_buffer = diff --git a/generic/threadshare/src/appsrc/imp.rs b/generic/threadshare/src/appsrc/imp.rs index 10e5c963..a239e6a8 100644 --- a/generic/threadshare/src/appsrc/imp.rs +++ b/generic/threadshare/src/appsrc/imp.rs @@ -30,7 +30,6 @@ use once_cell::sync::Lazy; use std::sync::Mutex; use std::time::Duration; -use std::u32; use crate::runtime::prelude::*; use crate::runtime::{Context, PadSrc, Task, TaskState}; diff --git a/generic/threadshare/src/dataqueue.rs b/generic/threadshare/src/dataqueue.rs index 092cb381..289d2b8e 100644 --- a/generic/threadshare/src/dataqueue.rs +++ b/generic/threadshare/src/dataqueue.rs @@ -26,7 +26,6 @@ use once_cell::sync::Lazy; use std::collections::VecDeque; use std::sync::Arc; use std::sync::Mutex as StdMutex; -use std::u32; static DATA_QUEUE_CAT: Lazy = Lazy::new(|| { gst::DebugCategory::new( diff --git a/generic/threadshare/src/inputselector/imp.rs b/generic/threadshare/src/inputselector/imp.rs index 006feb74..8c78e54e 100644 --- a/generic/threadshare/src/inputselector/imp.rs +++ b/generic/threadshare/src/inputselector/imp.rs @@ -30,7 +30,6 @@ use once_cell::sync::Lazy; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use std::time::Duration; -use std::u32; use crate::runtime::prelude::*; use crate::runtime::{self, PadSink, PadSrc}; diff --git a/generic/threadshare/src/jitterbuffer/imp.rs b/generic/threadshare/src/jitterbuffer/imp.rs index 73528398..a02df801 100644 --- a/generic/threadshare/src/jitterbuffer/imp.rs +++ b/generic/threadshare/src/jitterbuffer/imp.rs @@ -266,7 +266,7 @@ impl SinkHandler { inner.gap_packets.insert(GapPacket::new(buffer)); if gap_packets_length > 0 { - let mut prev_gap_seq = std::u32::MAX; + let mut prev_gap_seq = u32::MAX; let mut all_consecutive = true; for gap_packet in inner.gap_packets.iter() { @@ -279,7 +279,7 @@ impl SinkHandler { all_consecutive = gap_packet.pt == pt; - if prev_gap_seq == std::u32::MAX { + if prev_gap_seq == u32::MAX { prev_gap_seq = gap_packet.seq as u32; } else if gst_rtp::compare_seqnum(gap_packet.seq, prev_gap_seq as u16) != -1 { all_consecutive = false; diff --git a/generic/threadshare/src/jitterbuffer/jitterbuffer.rs b/generic/threadshare/src/jitterbuffer/jitterbuffer.rs index 07068c6f..5b08b803 100644 --- a/generic/threadshare/src/jitterbuffer/jitterbuffer.rs +++ b/generic/threadshare/src/jitterbuffer/jitterbuffer.rs @@ -91,7 +91,7 @@ impl RTPJitterBufferItem { r#type: 0, dts: dts.into().into_glib(), pts: pts.into().into_glib(), - seqnum: seqnum.map(|s| s as u32).unwrap_or(std::u32::MAX), + seqnum: seqnum.map(|s| s as u32).unwrap_or(u32::MAX), count: 1, rtptime, }, @@ -138,7 +138,7 @@ impl RTPJitterBufferItem { pub fn seqnum(&self) -> Option { unsafe { let item = self.0.as_ref().expect("Invalid wrapper"); - if item.as_ref().seqnum == std::u32::MAX { + if item.as_ref().seqnum == u32::MAX { None } else { Some(item.as_ref().seqnum as u16) @@ -306,7 +306,7 @@ impl RTPJitterBuffer { let pts = from_glib(pts.assume_init()); let seqnum = seqnum.assume_init(); - let seqnum = if seqnum == std::u32::MAX { + let seqnum = if seqnum == u32::MAX { None } else { Some(seqnum as u16) @@ -339,7 +339,7 @@ impl RTPJitterBuffer { (None, None) } else { let seqnum = (*item).seqnum; - let seqnum = if seqnum == std::u32::MAX { + let seqnum = if seqnum == u32::MAX { None } else { Some(seqnum as u16) diff --git a/generic/threadshare/src/proxy/imp.rs b/generic/threadshare/src/proxy/imp.rs index 50537414..c2353907 100644 --- a/generic/threadshare/src/proxy/imp.rs +++ b/generic/threadshare/src/proxy/imp.rs @@ -31,7 +31,6 @@ use std::collections::{HashMap, VecDeque}; use std::sync::{Arc, Weak}; use std::sync::{Mutex, MutexGuard}; use std::time::Duration; -use std::{u32, u64}; use crate::runtime::prelude::*; use crate::runtime::{Context, PadSink, PadSinkWeak, PadSrc, PadSrcWeak, Task}; diff --git a/generic/threadshare/src/queue/imp.rs b/generic/threadshare/src/queue/imp.rs index cc528763..f44f0d74 100644 --- a/generic/threadshare/src/queue/imp.rs +++ b/generic/threadshare/src/queue/imp.rs @@ -30,7 +30,6 @@ use once_cell::sync::Lazy; use std::collections::VecDeque; use std::sync::Mutex; use std::time::Duration; -use std::{u32, u64}; use crate::runtime::prelude::*; use crate::runtime::{Context, PadSink, PadSrc, Task}; diff --git a/generic/threadshare/src/tcpclientsrc/imp.rs b/generic/threadshare/src/tcpclientsrc/imp.rs index 8058f48a..cc10b674 100644 --- a/generic/threadshare/src/tcpclientsrc/imp.rs +++ b/generic/threadshare/src/tcpclientsrc/imp.rs @@ -31,8 +31,6 @@ use std::io; use std::net::{IpAddr, SocketAddr, TcpStream}; use std::sync::Mutex; use std::time::Duration; -use std::u16; -use std::u32; use crate::runtime::prelude::*; use crate::runtime::task; diff --git a/generic/threadshare/src/udpsink/imp.rs b/generic/threadshare/src/udpsink/imp.rs index 25203086..6c0ab11a 100644 --- a/generic/threadshare/src/udpsink/imp.rs +++ b/generic/threadshare/src/udpsink/imp.rs @@ -37,8 +37,6 @@ use std::collections::BTreeSet; use std::net::{IpAddr, Ipv4Addr, SocketAddr, UdpSocket}; use std::sync::{Arc, Mutex}; use std::time::Duration; -use std::u16; -use std::u8; const DEFAULT_HOST: Option<&str> = Some("127.0.0.1"); const DEFAULT_PORT: i32 = 5004; diff --git a/generic/threadshare/src/udpsrc/imp.rs b/generic/threadshare/src/udpsrc/imp.rs index a347bf49..67af0f41 100644 --- a/generic/threadshare/src/udpsrc/imp.rs +++ b/generic/threadshare/src/udpsrc/imp.rs @@ -27,12 +27,10 @@ use gst_net::*; use once_cell::sync::Lazy; -use std::i32; use std::io; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, UdpSocket}; use std::sync::Mutex; use std::time::Duration; -use std::u16; use crate::runtime::prelude::*; use crate::runtime::{task, Async, Context, PadSrc, Task, TaskState}; diff --git a/net/hlssink3/examples/cmaf_live.rs b/net/hlssink3/examples/cmaf_live.rs index 4c7735cc..264ce6ab 100644 --- a/net/hlssink3/examples/cmaf_live.rs +++ b/net/hlssink3/examples/cmaf_live.rs @@ -107,7 +107,7 @@ fn setup_video_sink(pipeline: &gst::Pipeline, path: &Path, name: &str) -> Result let enc = gst::ElementFactory::make("x264enc") .property("bframes", 0u32) .property("bitrate", VIDEO_BITRATE / 1000u32) - .property("key-int-max", std::i32::MAX as u32) + .property("key-int-max", i32::MAX as u32) .property_from_str("tune", "zerolatency") .build()?; let h264_capsfilter = gst::ElementFactory::make("capsfilter") diff --git a/net/ndi/src/ndisink/imp.rs b/net/ndi/src/ndisink/imp.rs index c14c66e3..fb221457 100644 --- a/net/ndi/src/ndisink/imp.rs +++ b/net/ndi/src/ndisink/imp.rs @@ -135,13 +135,13 @@ impl ElementImpl for NdiSink { gst_video::VideoFormat::Rgbx.to_str(), ]), ) - .field("width", gst::IntRange::::new(1, std::i32::MAX)) - .field("height", gst::IntRange::::new(1, std::i32::MAX)) + .field("width", gst::IntRange::::new(1, i32::MAX)) + .field("height", gst::IntRange::::new(1, i32::MAX)) .field( "framerate", gst::FractionRange::new( gst::Fraction::new(0, 1), - gst::Fraction::new(std::i32::MAX, 1), + gst::Fraction::new(i32::MAX, 1), ), ) .build(), diff --git a/net/ndi/src/ndisrc/imp.rs b/net/ndi/src/ndisrc/imp.rs index 4f9dad46..727ab764 100644 --- a/net/ndi/src/ndisrc/imp.rs +++ b/net/ndi/src/ndisrc/imp.rs @@ -7,7 +7,6 @@ use gst_base::subclass::base_src::CreateSuccess; use gst_base::subclass::prelude::*; use std::sync::Mutex; -use std::u32; use once_cell::sync::Lazy; diff --git a/net/ndi/src/ndisrcmeta.rs b/net/ndi/src/ndisrcmeta.rs index 14727c2e..0b712d4d 100644 --- a/net/ndi/src/ndisrcmeta.rs +++ b/net/ndi/src/ndisrcmeta.rs @@ -27,7 +27,9 @@ pub enum Buffer { }, Metadata { frame: MetadataFrame, + #[allow(unused)] receive_time_gst: gst::ClockTime, + #[allow(unused)] receive_time_real: gst::ClockTime, }, } diff --git a/net/ndi/src/ndisys.rs b/net/ndi/src/ndisys.rs index e732e344..6336081d 100644 --- a/net/ndi/src/ndisys.rs +++ b/net/ndi/src/ndisys.rs @@ -226,8 +226,8 @@ pub enum NDIlib_frame_format_type_e { NDIlib_frame_format_type_field_1 = 3, } -pub const NDIlib_send_timecode_synthesize: i64 = ::std::i64::MAX; -pub const NDIlib_recv_timestamp_undefined: i64 = ::std::i64::MAX; +pub const NDIlib_send_timecode_synthesize: i64 = i64::MAX; +pub const NDIlib_recv_timestamp_undefined: i64 = i64::MAX; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/net/raptorq/src/raptorqenc/imp.rs b/net/raptorq/src/raptorqenc/imp.rs index cb37a0a2..50c5b269 100644 --- a/net/raptorq/src/raptorqenc/imp.rs +++ b/net/raptorq/src/raptorqenc/imp.rs @@ -872,7 +872,7 @@ impl ElementImpl for RaptorqEnc { fn pad_templates() -> &'static [gst::PadTemplate] { static PAD_TEMPLATES: Lazy> = Lazy::new(|| { let caps = gst::Caps::builder("application/x-rtp") - .field("clock-rate", gst::IntRange::new(0, std::i32::MAX)) + .field("clock-rate", gst::IntRange::new(0, i32::MAX)) .build(); let srcpad_template = gst::PadTemplate::new( diff --git a/net/reqwest/src/reqwesthttpsrc/imp.rs b/net/reqwest/src/reqwesthttpsrc/imp.rs index 98d94e91..77b5439f 100644 --- a/net/reqwest/src/reqwesthttpsrc/imp.rs +++ b/net/reqwest/src/reqwesthttpsrc/imp.rs @@ -9,7 +9,6 @@ // SPDX-License-Identifier: MIT OR Apache-2.0 use std::sync::{Arc, Mutex}; use std::time::Duration; -use std::u64; use futures::future; use futures::prelude::*; @@ -539,6 +538,8 @@ impl ReqwestHttpSrc { .unwrap_or(false); let seekable = size.is_some() && accept_byte_ranges; + #[allow(clippy::manual_unwrap_or_default)] + // https://github.com/rust-lang/rust-clippy/issues/12928 let position = if let Some((range_start, _)) = headers .typed_get::() .and_then(|range| range.bytes_range()) diff --git a/net/rtp/src/rtpbin2/jitterbuffer.rs b/net/rtp/src/rtpbin2/jitterbuffer.rs index d0a61a42..78a34282 100644 --- a/net/rtp/src/rtpbin2/jitterbuffer.rs +++ b/net/rtp/src/rtpbin2/jitterbuffer.rs @@ -153,7 +153,7 @@ impl JitterBuffer { }); // Maintain (and trim) our seqnum list for duplicate detection - while self.seqnums.len() >= std::u16::MAX as usize { + while self.seqnums.len() >= u16::MAX as usize { debug!("Trimming"); self.seqnums.pop_first(); } @@ -436,8 +436,8 @@ mod tests { let packet = RtpPacket::parse(&rtp_data).unwrap(); assert_eq!(jb.queue_packet(&packet, 0, now), QueueResult::Duplicate); - // We do accept future sequence numbers up to a distance of at least std::i16::MAX - let rtp_data = generate_rtp_packet(0x12345678, std::i16::MAX as u16 + 1, 0, 4); + // We do accept future sequence numbers up to a distance of at least i16::MAX + let rtp_data = generate_rtp_packet(0x12345678, i16::MAX as u16 + 1, 0, 4); let packet = RtpPacket::parse(&rtp_data).unwrap(); let QueueResult::Queued(id) = jb.queue_packet(&packet, 0, now) else { unreachable!() diff --git a/net/rtp/src/rtpbin2/source.rs b/net/rtp/src/rtpbin2/source.rs index 9f77d5a0..0201de06 100644 --- a/net/rtp/src/rtpbin2/source.rs +++ b/net/rtp/src/rtpbin2/source.rs @@ -129,6 +129,7 @@ impl Source { #[derive(Debug)] pub struct ReceivedRb { pub rb: Rb, + #[allow(unused)] pub receive_time: Instant, pub receive_ntp_time: NtpTime, } diff --git a/net/rtp/src/rtpbin2/sync.rs b/net/rtp/src/rtpbin2/sync.rs index ff2511ac..38424d6f 100644 --- a/net/rtp/src/rtpbin2/sync.rs +++ b/net/rtp/src/rtpbin2/sync.rs @@ -323,7 +323,7 @@ impl Context { .entry(cname.clone()) .or_insert_with(|| { let mut cname_largest_delay = CnameLargestDelay { - largest_delay: std::i64::MIN, + largest_delay: i64::MIN, all_sync: true, }; diff --git a/net/rtp/src/utils.rs b/net/rtp/src/utils.rs index b53f8e90..bd0ef8c0 100644 --- a/net/rtp/src/utils.rs +++ b/net/rtp/src/utils.rs @@ -325,7 +325,7 @@ impl ExtendedTimestamp { if ext < last_ext { let diff = last_ext - ext; - if diff > std::i32::MAX as u64 { + if diff > i32::MAX as u64 { // timestamp went backwards more than allowed, we wrap around and get // updated extended timestamp. ext += 1u64 << 32; @@ -333,7 +333,7 @@ impl ExtendedTimestamp { } else { let diff = ext - last_ext; - if diff > std::i32::MAX as u64 { + if diff > i32::MAX as u64 { if ext < 1u64 << 32 { // We can't ever get to such a case as our counter is opaque unreachable!() @@ -374,7 +374,7 @@ impl ExtendedSeqnum { if ext < last_ext { let diff = last_ext - ext; - if diff > std::i16::MAX as u64 { + if diff > i16::MAX as u64 { // timestamp went backwards more than allowed, we wrap around and get // updated extended timestamp. ext += 1u64 << 16; @@ -382,7 +382,7 @@ impl ExtendedSeqnum { } else { let diff = ext - last_ext; - if diff > std::i16::MAX as u64 { + if diff > i16::MAX as u64 { if ext < 1u64 << 16 { // We can't ever get to such a case as our counter is opaque unreachable!() @@ -644,8 +644,8 @@ mod tests { assert_eq!(ext_ts.next(10), (1 << 32) + 10); assert_eq!(ext_ts.next(10), (1 << 32) + 10); assert_eq!( - ext_ts.next(1 + std::i32::MAX as u32), - (1 << 32) + 1 + std::i32::MAX as u64 + ext_ts.next(1 + i32::MAX as u32), + (1 << 32) + 1 + i32::MAX as u64 ); // Even big bumps under G_MAXINT32 don't result in wrap-around @@ -659,14 +659,11 @@ mod tests { fn extended_timestamp_wraparound() { let mut ext_ts = ExtendedTimestamp::default(); assert_eq!( - ext_ts.next(std::u32::MAX - 90000 + 1), - (1 << 32) + std::u32::MAX as u64 - 90000 + 1 - ); - assert_eq!(ext_ts.next(0), (1 << 32) + std::u32::MAX as u64 + 1); - assert_eq!( - ext_ts.next(90000), - (1 << 32) + std::u32::MAX as u64 + 1 + 90000 + ext_ts.next(u32::MAX - 90000 + 1), + (1 << 32) + u32::MAX as u64 - 90000 + 1 ); + assert_eq!(ext_ts.next(0), (1 << 32) + u32::MAX as u64 + 1); + assert_eq!(ext_ts.next(90000), (1 << 32) + u32::MAX as u64 + 1 + 90000); } #[test] @@ -674,20 +671,17 @@ mod tests { let mut ext_ts = ExtendedTimestamp::default(); assert_eq!( - ext_ts.next(std::u32::MAX - 90000 + 1), - (1 << 32) + std::u32::MAX as u64 - 90000 + 1 + ext_ts.next(u32::MAX - 90000 + 1), + (1 << 32) + u32::MAX as u64 - 90000 + 1 ); - assert_eq!(ext_ts.next(0), (1 << 32) + std::u32::MAX as u64 + 1); + assert_eq!(ext_ts.next(0), (1 << 32) + u32::MAX as u64 + 1); // Unwrapping around assert_eq!( - ext_ts.next(std::u32::MAX - 90000 + 1), - (1 << 32) + std::u32::MAX as u64 - 90000 + 1 - ); - assert_eq!( - ext_ts.next(90000), - (1 << 32) + std::u32::MAX as u64 + 1 + 90000 + ext_ts.next(u32::MAX - 90000 + 1), + (1 << 32) + u32::MAX as u64 - 90000 + 1 ); + assert_eq!(ext_ts.next(90000), (1 << 32) + u32::MAX as u64 + 1 + 90000); } #[test] @@ -698,8 +692,8 @@ mod tests { // Wraps backwards assert_eq!( - ext_ts.next(std::u32::MAX - 90000 + 1), - std::u32::MAX as u64 - 90000 + 1 + ext_ts.next(u32::MAX - 90000 + 1), + u32::MAX as u64 - 90000 + 1 ); // Wraps again forwards @@ -715,8 +709,8 @@ mod tests { assert_eq!(ext_seq.next(10), (1 << 16) + 10); assert_eq!(ext_seq.next(10), (1 << 16) + 10); assert_eq!( - ext_seq.next(1 + std::i16::MAX as u16), - (1 << 16) + 1 + std::i16::MAX as u64 + ext_seq.next(1 + i16::MAX as u16), + (1 << 16) + 1 + i16::MAX as u64 ); // Even big bumps under MAXINT16 don't result in wrap-around @@ -730,14 +724,11 @@ mod tests { fn extended_seqnum_wraparound() { let mut ext_seq = ExtendedSeqnum::default(); assert_eq!( - ext_seq.next(std::u16::MAX - 9000 + 1), - (1 << 16) + std::u16::MAX as u64 - 9000 + 1 - ); - assert_eq!(ext_seq.next(0), (1 << 16) + std::u16::MAX as u64 + 1); - assert_eq!( - ext_seq.next(9000), - (1 << 16) + std::u16::MAX as u64 + 1 + 9000 + ext_seq.next(u16::MAX - 9000 + 1), + (1 << 16) + u16::MAX as u64 - 9000 + 1 ); + assert_eq!(ext_seq.next(0), (1 << 16) + u16::MAX as u64 + 1); + assert_eq!(ext_seq.next(9000), (1 << 16) + u16::MAX as u64 + 1 + 9000); } #[test] @@ -745,20 +736,17 @@ mod tests { let mut ext_seq = ExtendedSeqnum::default(); assert_eq!( - ext_seq.next(std::u16::MAX - 9000 + 1), - (1 << 16) + std::u16::MAX as u64 - 9000 + 1 + ext_seq.next(u16::MAX - 9000 + 1), + (1 << 16) + u16::MAX as u64 - 9000 + 1 ); - assert_eq!(ext_seq.next(0), (1 << 16) + std::u16::MAX as u64 + 1); + assert_eq!(ext_seq.next(0), (1 << 16) + u16::MAX as u64 + 1); // Unwrapping around assert_eq!( - ext_seq.next(std::u16::MAX - 9000 + 1), - (1 << 16) + std::u16::MAX as u64 - 9000 + 1 - ); - assert_eq!( - ext_seq.next(9000), - (1 << 16) + std::u16::MAX as u64 + 1 + 9000 + ext_seq.next(u16::MAX - 9000 + 1), + (1 << 16) + u16::MAX as u64 - 9000 + 1 ); + assert_eq!(ext_seq.next(9000), (1 << 16) + u16::MAX as u64 + 1 + 9000); } #[test] @@ -769,8 +757,8 @@ mod tests { // Wraps backwards assert_eq!( - ext_seq.next(std::u16::MAX - 9000 + 1), - std::u16::MAX as u64 - 9000 + 1 + ext_seq.next(u16::MAX - 9000 + 1), + u16::MAX as u64 - 9000 + 1 ); // Wraps again forwards diff --git a/net/rtp/src/vp8/frame_header.rs b/net/rtp/src/vp8/frame_header.rs index d63b1b74..c3849afd 100644 --- a/net/rtp/src/vp8/frame_header.rs +++ b/net/rtp/src/vp8/frame_header.rs @@ -19,6 +19,7 @@ use smallvec::SmallVec; use super::bool_decoder::BoolDecoder; #[derive(Debug)] +#[allow(unused)] pub struct UncompressedFrameHeader { pub first_partition_size: u32, pub is_keyframe: bool, @@ -83,6 +84,7 @@ impl FromByteStream for UncompressedFrameHeader { } #[derive(Debug)] +#[allow(unused)] pub struct FrameHeader { pub color_space: Option, pub clamping_type: Option, @@ -176,6 +178,7 @@ impl<'a> FromBitStreamWith<'a> for FrameHeader { } #[derive(Debug)] +#[allow(unused)] pub struct UpdateSegmentation { pub segment_feature_data: Option, pub mb_segmentation_map: Option, @@ -217,6 +220,7 @@ impl FromBitStream for UpdateSegmentation { } #[derive(Debug)] +#[allow(unused)] pub struct SegmentFeatureData { pub segment_feature_mode: u8, pub quantizer_update: SmallVec<[Option; 4]>, @@ -262,6 +266,7 @@ impl FromBitStream for SegmentFeatureData { } #[derive(Debug)] +#[allow(unused)] pub struct MbSegmentationMap { pub segment_probs: SmallVec<[Option; 3]>, } @@ -291,6 +296,7 @@ impl FromBitStream for MbSegmentationMap { } #[derive(Debug)] +#[allow(unused)] pub struct MbLfAdjustments { pub ref_frame_delta_update: SmallVec<[Option; 4]>, pub mb_mode_delta_update: SmallVec<[Option; 4]>, @@ -342,6 +348,7 @@ impl FromBitStream for MbLfAdjustments { } #[derive(Debug)] +#[allow(unused)] pub struct FrameInfo { pub uncompressed_frame_header: UncompressedFrameHeader, pub frame_header: FrameHeader, diff --git a/net/rtp/src/vp9/frame_header.rs b/net/rtp/src/vp9/frame_header.rs index ce80932a..905ca0db 100644 --- a/net/rtp/src/vp9/frame_header.rs +++ b/net/rtp/src/vp9/frame_header.rs @@ -11,6 +11,7 @@ use anyhow::{bail, Context as _}; use bitstream_io::{FromBitStream, FromBitStreamWith}; #[derive(Debug)] +#[allow(unused)] pub struct FrameHeader { pub profile: u8, pub show_existing_frame: bool, @@ -86,6 +87,7 @@ impl FromBitStream for FrameHeader { } #[derive(Debug)] +#[allow(unused)] pub struct KeyframeInfo { // sync code // color config @@ -162,6 +164,7 @@ impl KeyframeInfo { } #[derive(Debug)] +#[allow(unused)] pub struct ColorConfig { pub bit_depth: u8, pub color_space: u8, diff --git a/tutorial/src/sinesrc/imp.rs b/tutorial/src/sinesrc/imp.rs index 8e70e9ef..0ff2d8ef 100644 --- a/tutorial/src/sinesrc/imp.rs +++ b/tutorial/src/sinesrc/imp.rs @@ -19,7 +19,6 @@ use byte_slice_cast::*; use std::ops::Rem; use std::sync::Mutex; -use std::u32; use num_traits::cast::NumCast; use num_traits::float::Float; diff --git a/utils/fallbackswitch/src/fallbacksrc/imp.rs b/utils/fallbackswitch/src/fallbacksrc/imp.rs index 0d906a31..a5d8e8fb 100644 --- a/utils/fallbackswitch/src/fallbacksrc/imp.rs +++ b/utils/fallbackswitch/src/fallbacksrc/imp.rs @@ -262,21 +262,21 @@ impl ObjectImpl for FallbackSrc { glib::ParamSpecUInt64::builder("timeout") .nick("Timeout") .blurb("Timeout for switching to the fallback URI") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(5 * *gst::ClockTime::SECOND) .mutable_ready() .build(), glib::ParamSpecUInt64::builder("restart-timeout") .nick("Timeout") .blurb("Timeout for restarting an active source") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(5 * *gst::ClockTime::SECOND) .mutable_ready() .build(), glib::ParamSpecUInt64::builder("retry-timeout") .nick("Retry Timeout") .blurb("Timeout for stopping after repeated failure") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(60 * *gst::ClockTime::SECOND) .mutable_ready() .build(), @@ -296,14 +296,14 @@ impl ObjectImpl for FallbackSrc { .blurb("When the main source has a higher latency than the fallback source \ this allows to configure a minimum latency that would be configured \ if initially the fallback is enabled") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .mutable_ready() .build(), glib::ParamSpecInt64::builder("buffer-duration") .nick("Buffer Duration") .blurb("Buffer duration when buffering streams (-1 default value)") .minimum(-1) - .maximum(std::i64::MAX - 1) + .maximum(i64::MAX - 1) .default_value(-1) .mutable_ready() .build(), diff --git a/utils/fallbackswitch/src/fallbackswitch/imp.rs b/utils/fallbackswitch/src/fallbackswitch/imp.rs index 5167b545..25a8d570 100644 --- a/utils/fallbackswitch/src/fallbackswitch/imp.rs +++ b/utils/fallbackswitch/src/fallbackswitch/imp.rs @@ -1329,21 +1329,21 @@ impl ObjectImpl for FallbackSwitch { glib::ParamSpecUInt64::builder(PROP_TIMEOUT) .nick("Input timeout") .blurb("Timeout on an input before switching to a lower priority input.") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(Settings::default().timeout.nseconds()) .mutable_playing() .build(), glib::ParamSpecUInt64::builder(PROP_LATENCY) .nick("Latency") .blurb("Additional latency in live mode to allow upstream to take longer to produce buffers for the current position (in nanoseconds)") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(Settings::default().latency.nseconds()) .mutable_ready() .build(), glib::ParamSpecUInt64::builder(PROP_MIN_UPSTREAM_LATENCY) .nick("Minimum Upstream Latency") .blurb("When sources with a higher latency are expected to be plugged in dynamically after the fallbackswitch has started playing, this allows overriding the minimum latency reported by the initial source(s). This is only taken into account when larger than the actually reported minimum latency. (nanoseconds)") - .maximum(std::u64::MAX - 1) + .maximum(u64::MAX - 1) .default_value(Settings::default().min_upstream_latency.nseconds()) .mutable_ready() .build(), diff --git a/utils/togglerecord/src/togglerecord/imp.rs b/utils/togglerecord/src/togglerecord/imp.rs index 0be6b335..54f19f70 100644 --- a/utils/togglerecord/src/togglerecord/imp.rs +++ b/utils/togglerecord/src/togglerecord/imp.rs @@ -20,7 +20,6 @@ use once_cell::sync::Lazy; use parking_lot::{Condvar, Mutex, MutexGuard}; use std::cmp; use std::collections::HashMap; -use std::f64; use std::iter; use std::sync::Arc; diff --git a/video/closedcaption/src/ccdetect/imp.rs b/video/closedcaption/src/ccdetect/imp.rs index 39ea519f..f291eab2 100644 --- a/video/closedcaption/src/ccdetect/imp.rs +++ b/video/closedcaption/src/ccdetect/imp.rs @@ -15,7 +15,6 @@ use crate::ccutils::{extract_cdp, ParseError, ParseErrorCode}; use once_cell::sync::Lazy; use std::sync::Mutex; -use std::u64; static CAT: Lazy = Lazy::new(|| { gst::DebugCategory::new( diff --git a/video/closedcaption/src/mcc_parse/imp.rs b/video/closedcaption/src/mcc_parse/imp.rs index 6307d98b..1bc6dace 100644 --- a/video/closedcaption/src/mcc_parse/imp.rs +++ b/video/closedcaption/src/mcc_parse/imp.rs @@ -1147,8 +1147,8 @@ impl ElementImpl for MccParse { { let caps = caps.get_mut().unwrap(); let framerate = gst::FractionRange::new( - gst::Fraction::new(1, std::i32::MAX), - gst::Fraction::new(std::i32::MAX, 1), + gst::Fraction::new(1, i32::MAX), + gst::Fraction::new(i32::MAX, 1), ); let s = gst::Structure::builder("closedcaption/x-cea-708") diff --git a/video/closedcaption/src/tttocea608/imp.rs b/video/closedcaption/src/tttocea608/imp.rs index 8ad98da9..38d12a07 100644 --- a/video/closedcaption/src/tttocea608/imp.rs +++ b/video/closedcaption/src/tttocea608/imp.rs @@ -559,8 +559,8 @@ impl ElementImpl for TtToCea608 { .unwrap(); let framerate = gst::FractionRange::new( - gst::Fraction::new(1, std::i32::MAX), - gst::Fraction::new(std::i32::MAX, 1), + gst::Fraction::new(1, i32::MAX), + gst::Fraction::new(i32::MAX, 1), ); let caps = gst::Caps::builder("closedcaption/x-cea-608") diff --git a/video/closedcaption/src/tttocea708/imp.rs b/video/closedcaption/src/tttocea708/imp.rs index 08812474..aa706bc0 100644 --- a/video/closedcaption/src/tttocea708/imp.rs +++ b/video/closedcaption/src/tttocea708/imp.rs @@ -625,8 +625,8 @@ impl ElementImpl for TtToCea708 { .unwrap(); let framerate = gst::FractionRange::new( - gst::Fraction::new(1, std::i32::MAX), - gst::Fraction::new(std::i32::MAX, 1), + gst::Fraction::new(1, i32::MAX), + gst::Fraction::new(i32::MAX, 1), ); let caps = gst::Caps::builder("closedcaption/x-cea-708") diff --git a/video/closedcaption/tests/cea708mux.rs b/video/closedcaption/tests/cea708mux.rs index 43dd9d8c..ff7b2e35 100644 --- a/video/closedcaption/tests/cea708mux.rs +++ b/video/closedcaption/tests/cea708mux.rs @@ -6,8 +6,6 @@ // // SPDX-License-Identifier: MPL-2.0 -use std::u8; - use gst::prelude::*; use pretty_assertions::assert_eq; diff --git a/video/dav1d/src/dav1ddec/imp.rs b/video/dav1d/src/dav1ddec/imp.rs index 16b72bf9..8195ca15 100644 --- a/video/dav1d/src/dav1ddec/imp.rs +++ b/video/dav1d/src/dav1ddec/imp.rs @@ -16,7 +16,6 @@ use gst_video::subclass::prelude::*; use once_cell::sync::Lazy; -use std::i32; use std::sync::{Mutex, MutexGuard}; const DEFAULT_N_THREADS: u32 = 0; @@ -645,7 +644,7 @@ impl ObjectImpl for Dav1dDec { .nick("Maximum frame delay") .blurb("Maximum delay in frames for the decoder (set to 1 for low latency, 0 to be equal to the number of logical cores. -1 to choose between these two based on pipeline liveness)") .minimum(-1) - .maximum(std::u32::MAX.into()) + .maximum(u32::MAX.into()) .default_value(DEFAULT_MAX_FRAME_DELAY) .mutable_ready() .build(), diff --git a/video/gif/src/gifenc/imp.rs b/video/gif/src/gifenc/imp.rs index c813a809..e92451c3 100644 --- a/video/gif/src/gifenc/imp.rs +++ b/video/gif/src/gifenc/imp.rs @@ -150,7 +150,7 @@ impl ObjectImpl for GifEnc { .nick("Repeat") .blurb("Repeat (-1 to loop forever, 0 .. n finite repetitions)") .minimum(-1) - .maximum(std::u16::MAX as i32) + .maximum(u16::MAX as i32) .default_value(DEFAULT_REPEAT) .mutable_ready() .build(), diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs index 14f7148b..403b9fc8 100644 --- a/video/rav1e/src/rav1enc/imp.rs +++ b/video/rav1e/src/rav1enc/imp.rs @@ -292,7 +292,7 @@ impl ObjectImpl for Rav1Enc { glib::ParamSpecUInt::builder("min-quantizer") .nick("Min Quantizer") .blurb("Min Quantizer") - .maximum(std::u8::MAX as u32) + .maximum(u8::MAX as u32) .default_value(DEFAULT_MIN_QUANTIZER as u32) .mutable_ready() .build(),