mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 03:21:00 +00:00
Fix various new clippy 1.79 warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1620>
This commit is contained in:
parent
cd47bf2f04
commit
69c3c2ae46
41 changed files with 85 additions and 104 deletions
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ use gst::subclass::prelude::*;
|
|||
|
||||
use std::mem;
|
||||
use std::sync::Mutex;
|
||||
use std::u64;
|
||||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -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::*;
|
||||
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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<gst::DebugCategory> = Lazy::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<u16> {
|
||||
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)
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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};
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -135,13 +135,13 @@ impl ElementImpl for NdiSink {
|
|||
gst_video::VideoFormat::Rgbx.to_str(),
|
||||
]),
|
||||
)
|
||||
.field("width", gst::IntRange::<i32>::new(1, std::i32::MAX))
|
||||
.field("height", gst::IntRange::<i32>::new(1, std::i32::MAX))
|
||||
.field("width", gst::IntRange::<i32>::new(1, i32::MAX))
|
||||
.field("height", gst::IntRange::<i32>::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(),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -27,7 +27,9 @@ pub enum Buffer {
|
|||
},
|
||||
Metadata {
|
||||
frame: MetadataFrame,
|
||||
#[allow(unused)]
|
||||
receive_time_gst: gst::ClockTime,
|
||||
#[allow(unused)]
|
||||
receive_time_real: gst::ClockTime,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -872,7 +872,7 @@ impl ElementImpl for RaptorqEnc {
|
|||
fn pad_templates() -> &'static [gst::PadTemplate] {
|
||||
static PAD_TEMPLATES: Lazy<Vec<gst::PadTemplate>> = 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(
|
||||
|
|
|
@ -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::<ContentRange>()
|
||||
.and_then(|range| range.bytes_range())
|
||||
|
|
|
@ -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!()
|
||||
|
|
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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<u8>,
|
||||
pub clamping_type: Option<u8>,
|
||||
|
@ -176,6 +178,7 @@ impl<'a> FromBitStreamWith<'a> for FrameHeader {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(unused)]
|
||||
pub struct UpdateSegmentation {
|
||||
pub segment_feature_data: Option<SegmentFeatureData>,
|
||||
pub mb_segmentation_map: Option<MbSegmentationMap>,
|
||||
|
@ -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<i8>; 4]>,
|
||||
|
@ -262,6 +266,7 @@ impl FromBitStream for SegmentFeatureData {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(unused)]
|
||||
pub struct MbSegmentationMap {
|
||||
pub segment_probs: SmallVec<[Option<u8>; 3]>,
|
||||
}
|
||||
|
@ -291,6 +296,7 @@ impl FromBitStream for MbSegmentationMap {
|
|||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[allow(unused)]
|
||||
pub struct MbLfAdjustments {
|
||||
pub ref_frame_delta_update: SmallVec<[Option<i8>; 4]>,
|
||||
pub mb_mode_delta_update: SmallVec<[Option<i8>; 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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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<gst::DebugCategory> = Lazy::new(|| {
|
||||
gst::DebugCategory::new(
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -6,8 +6,6 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use std::u8;
|
||||
|
||||
use gst::prelude::*;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue