mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 11:30:59 +00:00
Fix various 1.80 clippy warnings
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1688>
This commit is contained in:
parent
1316b821c4
commit
fa060b9fa0
6 changed files with 33 additions and 12 deletions
|
@ -44,7 +44,7 @@ pub struct OriginalBufferRestore {
|
||||||
}
|
}
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
#[cfg(unused_code)]
|
#[allow(dead_code)]
|
||||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"originalbufferrestore",
|
"originalbufferrestore",
|
||||||
|
|
|
@ -19,7 +19,7 @@ pub struct OriginalBufferSave {
|
||||||
}
|
}
|
||||||
|
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
#[cfg(unused_code)]
|
#[allow(dead_code)]
|
||||||
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
static CAT: Lazy<gst::DebugCategory> = Lazy::new(|| {
|
||||||
gst::DebugCategory::new(
|
gst::DebugCategory::new(
|
||||||
"originalbuffersave",
|
"originalbuffersave",
|
||||||
|
|
|
@ -33,7 +33,10 @@ use std::net::UdpSocket;
|
||||||
use crate::runtime::Async;
|
use crate::runtime::Async;
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
|
use std::os::{
|
||||||
|
fd::BorrowedFd,
|
||||||
|
unix::io::{AsRawFd, FromRawFd, IntoRawFd, RawFd},
|
||||||
|
};
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket};
|
use std::os::windows::io::{AsRawSocket, FromRawSocket, IntoRawSocket, RawSocket};
|
||||||
|
@ -231,8 +234,14 @@ impl GioSocketWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(
|
#[cfg(any(
|
||||||
bsd,
|
target_os = "macos",
|
||||||
linux_like,
|
target_os = "ios",
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "dragonfly",
|
||||||
|
target_os = "openbsd",
|
||||||
|
target_os = "netbsd",
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "android",
|
||||||
target_os = "aix",
|
target_os = "aix",
|
||||||
target_os = "fuchsia",
|
target_os = "fuchsia",
|
||||||
target_os = "haiku",
|
target_os = "haiku",
|
||||||
|
@ -246,18 +255,30 @@ impl GioSocketWrapper {
|
||||||
|
|
||||||
let socket = self.as_socket();
|
let socket = self.as_socket();
|
||||||
|
|
||||||
sockopt::set_ip_tos(socket, tos)?;
|
sockopt::set_ip_tos(
|
||||||
|
unsafe { BorrowedFd::borrow_raw(socket.as_raw_fd()) },
|
||||||
|
tos as u8,
|
||||||
|
)?;
|
||||||
|
|
||||||
if socket.family() == gio::SocketFamily::Ipv6 {
|
if socket.family() == gio::SocketFamily::Ipv6 {
|
||||||
sockopt::set_ipv6_tclass(socket, tos)?;
|
sockopt::set_ipv6_tclass(
|
||||||
|
unsafe { BorrowedFd::borrow_raw(socket.as_raw_fd()) },
|
||||||
|
tos as u32,
|
||||||
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(any(
|
#[cfg(not(any(
|
||||||
bsd,
|
target_os = "macos",
|
||||||
linux_like,
|
target_os = "ios",
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "dragonfly",
|
||||||
|
target_os = "openbsd",
|
||||||
|
target_os = "netbsd",
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "android",
|
||||||
target_os = "aix",
|
target_os = "aix",
|
||||||
target_os = "fuchsia",
|
target_os = "fuchsia",
|
||||||
target_os = "haiku",
|
target_os = "haiku",
|
||||||
|
|
|
@ -503,7 +503,7 @@ fn test_extra_headers() {
|
||||||
|src| {
|
|src| {
|
||||||
src.set_property(
|
src.set_property(
|
||||||
"extra-headers",
|
"extra-headers",
|
||||||
&gst::Structure::builder("headers")
|
gst::Structure::builder("headers")
|
||||||
.field("foo", "bar")
|
.field("foo", "bar")
|
||||||
.field("baz", 1i32)
|
.field("baz", 1i32)
|
||||||
.field("list", gst::List::new([1i32, 2i32]))
|
.field("list", gst::List::new([1i32, 2i32]))
|
||||||
|
|
|
@ -1215,7 +1215,7 @@ impl RtpRecv {
|
||||||
// TODO what to do with the ssrc?
|
// TODO what to do with the ssrc?
|
||||||
let event = gst_video::UpstreamForceKeyUnitEvent::builder()
|
let event = gst_video::UpstreamForceKeyUnitEvent::builder()
|
||||||
.all_headers(fir)
|
.all_headers(fir)
|
||||||
.other_field("ssrcs", &gst::Array::new(ssrcs))
|
.other_field("ssrcs", gst::Array::new(ssrcs))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
let _ = rtp_send_sinkpad.push_event(event);
|
let _ = rtp_send_sinkpad.push_event(event);
|
||||||
|
|
|
@ -3513,7 +3513,7 @@ impl BaseWebRTCSink {
|
||||||
if let gst::EventView::Caps(caps) = event.view() {
|
if let gst::EventView::Caps(caps) = event.view() {
|
||||||
sink.post_message(gst::message::Application::new(
|
sink.post_message(gst::message::Application::new(
|
||||||
gst::Structure::builder("payloaded_caps")
|
gst::Structure::builder("payloaded_caps")
|
||||||
.field("caps", &caps.caps().to_owned())
|
.field("caps", caps.caps_owned())
|
||||||
.build(),
|
.build(),
|
||||||
))
|
))
|
||||||
.expect("Could not send message");
|
.expect("Could not send message");
|
||||||
|
|
Loading…
Reference in a new issue