mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-23 12:01:01 +00:00
Fix various clippy warnings
This commit is contained in:
parent
63a840e0e7
commit
b4efa42d8f
12 changed files with 51 additions and 64 deletions
|
@ -305,18 +305,17 @@ impl FlvDemux {
|
|||
}
|
||||
|
||||
// TODO: pull mode
|
||||
if false
|
||||
&& query.has_scheduling_mode_with_flags(
|
||||
gst::PadMode::Pull,
|
||||
gst::SchedulingFlags::SEEKABLE,
|
||||
)
|
||||
{
|
||||
gst_debug!(CAT, obj: pad, "Activating in Pull mode");
|
||||
gst::PadMode::Pull
|
||||
} else {
|
||||
// if query.has_scheduling_mode_with_flags(
|
||||
// gst::PadMode::Pull,
|
||||
// gst::SchedulingFlags::SEEKABLE,
|
||||
// )
|
||||
// {
|
||||
// gst_debug!(CAT, obj: pad, "Activating in Pull mode");
|
||||
// gst::PadMode::Pull
|
||||
// } else {
|
||||
gst_debug!(CAT, obj: pad, "Activating in Push mode");
|
||||
gst::PadMode::Push
|
||||
}
|
||||
// }
|
||||
};
|
||||
|
||||
pad.activate_mode(mode, true)?;
|
||||
|
|
|
@ -158,10 +158,9 @@ impl ReqwestHttpSrc {
|
|||
)
|
||||
}))
|
||||
.map_err(|err| {
|
||||
err.unwrap_or(gst_error_msg!(
|
||||
gst::LibraryError::Failed,
|
||||
["Interrupted during start"]
|
||||
))
|
||||
err.unwrap_or_else(|| {
|
||||
gst_error_msg!(gst::LibraryError::Failed, ["Interrupted during start"])
|
||||
})
|
||||
})?;
|
||||
|
||||
if !response.status().is_success() {
|
||||
|
@ -457,13 +456,13 @@ impl BaseSrcImpl for ReqwestHttpSrc {
|
|||
|
||||
*body = Some(current_body);
|
||||
|
||||
return Ok(buffer);
|
||||
Ok(buffer)
|
||||
}
|
||||
Ok((None, current_body)) => {
|
||||
/* No further data, end of stream */
|
||||
gst_debug!(cat, obj: src, "End of stream");
|
||||
*body = Some(current_body);
|
||||
return Err(gst::FlowError::Eos);
|
||||
Err(gst::FlowError::Eos)
|
||||
}
|
||||
Err(err) => {
|
||||
/* error */
|
||||
|
@ -475,7 +474,7 @@ impl BaseSrcImpl for ReqwestHttpSrc {
|
|||
["Failed to read at {}: {:?}", offset, err]
|
||||
);
|
||||
|
||||
return Err(gst::FlowError::Error);
|
||||
Err(gst::FlowError::Error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -290,10 +290,9 @@ impl S3Sink {
|
|||
|
||||
s3utils::wait(&self.canceller, &self.runtime, complete_req_future)
|
||||
.map_err(|err| {
|
||||
err.unwrap_or(gst_error_msg!(
|
||||
gst::LibraryError::Failed,
|
||||
["Interrupted during stop"]
|
||||
))
|
||||
err.unwrap_or_else(|| {
|
||||
gst_error_msg!(gst::LibraryError::Failed, ["Interrupted during stop"])
|
||||
})
|
||||
})
|
||||
.map(|_| ())
|
||||
}
|
||||
|
@ -313,16 +312,17 @@ impl S3Sink {
|
|||
});
|
||||
let response = s3utils::wait(&self.canceller, &self.runtime, create_multipart_req_future)
|
||||
.map_err(|err| {
|
||||
err.unwrap_or(gst_error_msg!(
|
||||
gst::LibraryError::Failed,
|
||||
["Interrupted during start"]
|
||||
))
|
||||
err.unwrap_or_else(|| {
|
||||
gst_error_msg!(gst::LibraryError::Failed, ["Interrupted during start"])
|
||||
})
|
||||
})?;
|
||||
|
||||
let upload_id = response.upload_id.ok_or(gst_error_msg!(
|
||||
let upload_id = response.upload_id.ok_or_else(|| {
|
||||
gst_error_msg!(
|
||||
gst::ResourceError::Failed,
|
||||
["Failed to get multipart upload ID"]
|
||||
))?;
|
||||
)
|
||||
})?;
|
||||
|
||||
Ok(Started::new(
|
||||
Vec::with_capacity(self.settings.lock().unwrap().buffer_size as usize),
|
||||
|
|
|
@ -119,10 +119,9 @@ impl S3Src {
|
|||
}),
|
||||
)
|
||||
.map_err(|err| {
|
||||
err.unwrap_or(gst_error_msg!(
|
||||
gst::LibraryError::Failed,
|
||||
["Interrupted during start"]
|
||||
))
|
||||
err.unwrap_or_else(|| {
|
||||
gst_error_msg!(gst::LibraryError::Failed, ["Interrupted during start"])
|
||||
})
|
||||
})?;
|
||||
|
||||
if let Some(size) = output.content_length {
|
||||
|
@ -300,7 +299,7 @@ impl ObjectImpl for S3Src {
|
|||
let basesrc = obj.downcast_ref::<gst_base::BaseSrc>().unwrap();
|
||||
basesrc.set_format(gst::Format::Bytes);
|
||||
/* Set a larger default blocksize to make read more efficient */
|
||||
basesrc.set_blocksize(262144);
|
||||
basesrc.set_blocksize(256 * 1024);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -368,7 +367,7 @@ impl BaseSrcImpl for S3Src {
|
|||
*state = StreamingState::Started {
|
||||
url: s3url,
|
||||
client: s3client,
|
||||
size: size,
|
||||
size,
|
||||
};
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -85,10 +85,10 @@ pub fn parse_s3_url(url_str: &str) -> Result<GstS3Url, String> {
|
|||
}
|
||||
|
||||
Ok(GstS3Url {
|
||||
region: region,
|
||||
bucket: bucket,
|
||||
object: object,
|
||||
version: version,
|
||||
region,
|
||||
bucket,
|
||||
object,
|
||||
version,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ impl State {
|
|||
|
||||
gst_debug!(CAT, obj: pad, "Returned pull size: {}", map.len());
|
||||
|
||||
let mut nonce = add_nonce(self.initial_nonce.clone().unwrap(), chunk_index);
|
||||
let mut nonce = add_nonce(self.initial_nonce.unwrap(), chunk_index);
|
||||
let block_size = self.block_size.expect("Block size wasn't set") as usize + box_::MACBYTES;
|
||||
|
||||
for subbuffer in map.chunks(block_size) {
|
||||
|
|
|
@ -271,7 +271,6 @@ impl Encrypter {
|
|||
})?,
|
||||
);
|
||||
|
||||
drop(state);
|
||||
drop(state_guard);
|
||||
|
||||
for buffer in buffers {
|
||||
|
@ -324,7 +323,6 @@ impl Encrypter {
|
|||
}
|
||||
|
||||
// drop the lock before pushing into the pad
|
||||
drop(state);
|
||||
drop(state_mutex);
|
||||
|
||||
for buffer in buffers {
|
||||
|
|
|
@ -223,7 +223,7 @@ impl AppSrc {
|
|||
} else {
|
||||
q.get_filter()
|
||||
.map(|f| f.to_owned())
|
||||
.unwrap_or_else(|| gst::Caps::new_any())
|
||||
.unwrap_or_else(gst::Caps::new_any)
|
||||
};
|
||||
|
||||
q.set_result(&caps);
|
||||
|
|
|
@ -858,7 +858,7 @@ impl ProxySrc {
|
|||
} else {
|
||||
q.get_filter()
|
||||
.map(|f| f.to_owned())
|
||||
.unwrap_or_else(|| gst::Caps::new_any())
|
||||
.unwrap_or_else(gst::Caps::new_any)
|
||||
};
|
||||
|
||||
q.set_result(&caps);
|
||||
|
|
|
@ -169,14 +169,10 @@ impl SocketRead for TcpClientReader {
|
|||
},
|
||||
};
|
||||
match socket.poll_read(buf) {
|
||||
Ok(Async::Ready(result)) => {
|
||||
return Ok(Async::Ready((result, None)));
|
||||
}
|
||||
Ok(Async::NotReady) => {
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
Ok(Async::Ready(result)) => Ok(Async::Ready((result, None))),
|
||||
Ok(Async::NotReady) => Ok(Async::NotReady),
|
||||
Err(result) => return Err(result),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -270,7 +266,7 @@ impl TcpClientSrc {
|
|||
} else {
|
||||
q.get_filter()
|
||||
.map(|f| f.to_owned())
|
||||
.unwrap_or_else(|| gst::Caps::new_any())
|
||||
.unwrap_or_else(gst::Caps::new_any)
|
||||
};
|
||||
|
||||
q.set_result(&caps);
|
||||
|
|
|
@ -303,14 +303,10 @@ impl SocketRead for UdpReader {
|
|||
buf: &mut [u8],
|
||||
) -> Poll<(usize, Option<std::net::SocketAddr>), io::Error> {
|
||||
match self.socket.poll_recv_from(buf) {
|
||||
Ok(Async::Ready(result)) => {
|
||||
return Ok(Async::Ready((result.0, Some(result.1))));
|
||||
Ok(Async::Ready(result)) => Ok(Async::Ready((result.0, Some(result.1)))),
|
||||
Ok(Async::NotReady) => Ok(Async::NotReady),
|
||||
Err(result) => Err(result),
|
||||
}
|
||||
Ok(Async::NotReady) => {
|
||||
return Ok(Async::NotReady);
|
||||
}
|
||||
Err(result) => return Err(result),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -404,7 +400,7 @@ impl UdpSrc {
|
|||
} else {
|
||||
q.get_filter()
|
||||
.map(|f| f.to_owned())
|
||||
.unwrap_or_else(|| gst::Caps::new_any())
|
||||
.unwrap_or_else(gst::Caps::new_any)
|
||||
};
|
||||
|
||||
q.set_result(&caps);
|
||||
|
|
|
@ -2,7 +2,7 @@ use chrono::TimeZone;
|
|||
use git2::{Commit, ObjectType, Repository};
|
||||
use std::path;
|
||||
|
||||
pub fn get_info() -> () {
|
||||
pub fn get_info() {
|
||||
let mut commit_id = "UNKNOWN".to_string();
|
||||
let mut commit_date = chrono::Utc::now().format("%Y-%m-%d").to_string();
|
||||
|
||||
|
|
Loading…
Reference in a new issue