threadshare: Run everything through rustfmt again

This commit is contained in:
Sebastian Dröge 2018-07-24 13:40:58 +03:00
parent 55f9b84008
commit fbc0a04cff
10 changed files with 41 additions and 59 deletions

View file

@ -459,10 +459,7 @@ impl AppSrc {
let mut state = self.state.lock().unwrap();
let io_context = IOContext::new(
&settings.context,
settings.context_wait,
).map_err(|err| {
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to create IO context: {}", err]

View file

@ -236,7 +236,8 @@ impl DataQueue {
gst_debug!(DATA_QUEUE_CAT, obj: &inner.element, "Clearing queue");
for item in inner.queue.drain(..) {
if let DataQueueItem::Event(event) = item {
if event.is_sticky() && event.get_type() != gst::EventType::Segment
if event.is_sticky()
&& event.get_type() != gst::EventType::Segment
&& event.get_type() != gst::EventType::Eos
{
let _ = src_pad.store_sticky_event(&event);

View file

@ -27,8 +27,8 @@ use futures::stream::futures_unordered::FuturesUnordered;
use futures::sync::oneshot;
use futures::{Future, Stream};
use tokio::reactor;
use tokio_timer::timer;
use tokio_current_thread;
use tokio_timer::timer;
use gst;
@ -84,7 +84,12 @@ impl IOContextRunner {
(runtime_handle, shutdown)
}
fn run(&mut self, wait: u32, reactor: reactor::Reactor, sender: mpsc::Sender<tokio_current_thread::Handle>) {
fn run(
&mut self,
wait: u32,
reactor: reactor::Reactor,
sender: mpsc::Sender<tokio_current_thread::Handle>,
) {
use std::time;
let wait = time::Duration::from_millis(wait as u64);

View file

@ -29,9 +29,9 @@ extern crate gstreamer as gst;
extern crate futures;
extern crate tokio;
extern crate tokio_current_thread;
extern crate tokio_executor;
extern crate tokio_reactor;
extern crate tokio_current_thread;
extern crate tokio_timer;
extern crate either;

View file

@ -136,15 +136,13 @@ static PROPERTIES_SRC: [Property; 6] = [
),
];
static PROPERTIES_SINK: [Property; 1] = [
Property::String(
"proxy-context",
"Proxy Context",
"Context name of the proxy to share with",
Some(DEFAULT_PROXY_CONTEXT),
PropertyMutability::ReadWrite,
),
];
static PROPERTIES_SINK: [Property; 1] = [Property::String(
"proxy-context",
"Proxy Context",
"Context name of the proxy to share with",
Some(DEFAULT_PROXY_CONTEXT),
PropertyMutability::ReadWrite,
)];
// TODO: Refactor into a Sender and Receiver instead of the have_ booleans
@ -826,11 +824,7 @@ impl ProxySrc {
fallback: G,
f: F,
) -> T {
let element = parent
.as_ref()
.unwrap()
.downcast_ref::<Element>()
.unwrap();
let element = parent.as_ref().unwrap().downcast_ref::<Element>().unwrap();
let src = element.get_impl().downcast_ref::<ProxySrc>().unwrap();
element.catch_panic(fallback, |element| f(src, element))
}
@ -1065,10 +1059,7 @@ impl ProxySrc {
let mut state = self.state.lock().unwrap();
let io_context = IOContext::new(
&settings.context,
settings.context_wait,
).map_err(|err| {
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to create IO context: {}", err]

View file

@ -565,12 +565,14 @@ impl Queue {
let (flags, min, max, align) = new_query.get_result();
q.set(flags, min, max, align);
q.add_scheduling_modes(&new_query
.get_scheduling_modes()
.iter()
.cloned()
.filter(|m| m != &gst::PadMode::Pull)
.collect::<Vec<_>>());
q.add_scheduling_modes(
&new_query
.get_scheduling_modes()
.iter()
.cloned()
.filter(|m| m != &gst::PadMode::Pull)
.collect::<Vec<_>>(),
);
gst_log!(self.cat, obj: pad, "Returning {:?}", q.get_mut_query());
return true;
}
@ -691,10 +693,7 @@ impl Queue {
let mut state = self.state.lock().unwrap();
let io_context = IOContext::new(
&settings.context,
settings.context_wait,
).map_err(|err| {
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to create IO context: {}", err]

View file

@ -443,10 +443,7 @@ impl TcpClientSrc {
let mut state = self.state.lock().unwrap();
let io_context = IOContext::new(
&settings.context,
settings.context_wait,
).map_err(|err| {
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to create IO context: {}", err]

View file

@ -430,10 +430,7 @@ impl UdpSrc {
let mut state = self.state.lock().unwrap();
let io_context = IOContext::new(
&settings.context,
settings.context_wait,
).map_err(|err| {
let io_context = IOContext::new(&settings.context, settings.context_wait).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to create IO context: {}", err]
@ -522,12 +519,13 @@ impl UdpSrc {
)
})?;
let socket = net::UdpSocket::from_std(socket, io_context.reactor_handle()).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to setup socket for tokio: {}", err]
)
})?;
let socket =
net::UdpSocket::from_std(socket, io_context.reactor_handle()).map_err(|err| {
gst_error_msg!(
gst::ResourceError::OpenRead,
["Failed to setup socket for tokio: {}", err]
)
})?;
if addr.is_multicast() {
// TODO: Multicast interface configuration, going to be tricky

View file

@ -72,12 +72,8 @@ fn test_push() {
proxysrc.link(&appsink).unwrap();
fakesrc.set_property("num-buffers", &3i32).unwrap();
proxysink
.set_property("proxy-context", &"test")
.unwrap();
proxysrc
.set_property("proxy-context", &"test")
.unwrap();
proxysink.set_property("proxy-context", &"test").unwrap();
proxysrc.set_property("proxy-context", &"test").unwrap();
appsink.set_property("emit-signals", &true).unwrap();

View file

@ -68,9 +68,7 @@ fn test_push() {
let caps = gst::Caps::new_simple("foo/bar", &[]);
udpsrc.set_property("caps", &caps).unwrap();
udpsrc
.set_property("port", &(5000 as u32))
.unwrap();
udpsrc.set_property("port", &(5000 as u32)).unwrap();
appsink.set_property("emit-signals", &true).unwrap();