mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-26 09:36:18 +00:00
Fix various new Rust 1.85 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2104>
This commit is contained in:
parent
4fdcba449e
commit
93ee2ee70d
7 changed files with 14 additions and 14 deletions
|
@ -1336,7 +1336,7 @@ fn write_audio_sample_entry(
|
||||||
(bitrate / 8000) as u16
|
(bitrate / 8000) as u16
|
||||||
}
|
}
|
||||||
"audio/x-flac" => with_flac_metadata(&stream.caps, |streaminfo, _| {
|
"audio/x-flac" => with_flac_metadata(&stream.caps, |streaminfo, _| {
|
||||||
1 + (u16::from_be_bytes([streaminfo[16], streaminfo[17]]) >> 4 & 0b11111)
|
1 + ((u16::from_be_bytes([streaminfo[16], streaminfo[17]]) >> 4) & 0b11111)
|
||||||
})
|
})
|
||||||
.context("FLAC metadata error")?,
|
.context("FLAC metadata error")?,
|
||||||
_ => 16u16,
|
_ => 16u16,
|
||||||
|
|
|
@ -1613,7 +1613,7 @@ fn write_audio_sample_entry(
|
||||||
(bitrate / 8000) as u16
|
(bitrate / 8000) as u16
|
||||||
}
|
}
|
||||||
"audio/x-flac" => with_flac_metadata(&stream.caps, |streaminfo, _| {
|
"audio/x-flac" => with_flac_metadata(&stream.caps, |streaminfo, _| {
|
||||||
1 + (u16::from_be_bytes([streaminfo[16], streaminfo[17]]) >> 4 & 0b11111)
|
1 + ((u16::from_be_bytes([streaminfo[16], streaminfo[17]]) >> 4) & 0b11111)
|
||||||
})
|
})
|
||||||
.context("FLAC metadata error")?,
|
.context("FLAC metadata error")?,
|
||||||
_ => 16u16,
|
_ => 16u16,
|
||||||
|
|
|
@ -307,7 +307,7 @@ pub struct NDIlib_audio_frame_v3_t {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "advanced-sdk")]
|
#[cfg(feature = "advanced-sdk")]
|
||||||
#[repr(packed)]
|
#[repr(C, packed)]
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone)]
|
||||||
pub struct NDIlib_compressed_packet_t {
|
pub struct NDIlib_compressed_packet_t {
|
||||||
pub version: u32,
|
pub version: u32,
|
||||||
|
|
|
@ -171,11 +171,11 @@ pub fn set_varint<B: BufMut>(data: &mut B, val: u64) {
|
||||||
if val < 2u64.pow(6) {
|
if val < 2u64.pow(6) {
|
||||||
data.put_u8(val as u8);
|
data.put_u8(val as u8);
|
||||||
} else if val < 2u64.pow(14) {
|
} else if val < 2u64.pow(14) {
|
||||||
data.put_u16(0b01 << 14 | val as u16);
|
data.put_u16((0b01 << 14) | val as u16);
|
||||||
} else if val < 2u64.pow(30) {
|
} else if val < 2u64.pow(30) {
|
||||||
data.put_u32(0b10 << 30 | val as u32);
|
data.put_u32((0b10 << 30) | val as u32);
|
||||||
} else if val < 2u64.pow(62) {
|
} else if val < 2u64.pow(62) {
|
||||||
data.put_u64(0b11 << 62 | val);
|
data.put_u64((0b11 << 62) | val);
|
||||||
} else {
|
} else {
|
||||||
unreachable!("malformed varint");
|
unreachable!("malformed varint");
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,7 +206,7 @@ pub struct TocEntry {
|
||||||
|
|
||||||
impl TocEntry {
|
impl TocEntry {
|
||||||
pub fn frame_header(&self) -> u8 {
|
pub fn frame_header(&self) -> u8 {
|
||||||
self.frame_type << 3 | (self.frame_quality_indicator as u8) << 2
|
(self.frame_type << 3) | ((self.frame_quality_indicator as u8) << 2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -374,10 +374,10 @@ impl RTPAv1Pay {
|
||||||
};
|
};
|
||||||
|
|
||||||
let aggr_header: [u8; 1] = [
|
let aggr_header: [u8; 1] = [
|
||||||
(state.open_obu_fragment as u8) << 7 | // Z
|
((state.open_obu_fragment as u8) << 7) | // Z
|
||||||
((packet.last_obu_fragment_size.is_some()) as u8) << 6 | // Y
|
(((packet.last_obu_fragment_size.is_some()) as u8) << 6) | // Y
|
||||||
(w as u8) << 4 | // W
|
((w as u8) << 4) | // W
|
||||||
(packet.start_of_coded_video_sequence as u8) << 3 // N
|
((packet.start_of_coded_video_sequence as u8) << 3) // N
|
||||||
; 1];
|
; 1];
|
||||||
|
|
||||||
writer
|
writer
|
||||||
|
|
|
@ -119,9 +119,9 @@ impl ObjectImpl for Paintable {
|
||||||
"background-color" => {
|
"background-color" => {
|
||||||
let color = self.background_color.get();
|
let color = self.background_color.get();
|
||||||
|
|
||||||
let v = (f32::clamp(color.red() * 255.0, 0.0, 255.0) as u32) << 24
|
let v = ((f32::clamp(color.red() * 255.0, 0.0, 255.0) as u32) << 24)
|
||||||
| (f32::clamp(color.green() * 255.0, 0.0, 255.0) as u32) << 16
|
| ((f32::clamp(color.green() * 255.0, 0.0, 255.0) as u32) << 16)
|
||||||
| (f32::clamp(color.blue() * 255.0, 0.0, 255.0) as u32) << 8
|
| ((f32::clamp(color.blue() * 255.0, 0.0, 255.0) as u32) << 8)
|
||||||
| (f32::clamp(color.alpha() * 255.0, 0.0, 255.0) as u32);
|
| (f32::clamp(color.alpha() * 255.0, 0.0, 255.0) as u32);
|
||||||
|
|
||||||
v.to_value()
|
v.to_value()
|
||||||
|
|
Loading…
Reference in a new issue