Run everything through latest rustfmt-nightly

This commit is contained in:
Sebastian Dröge 2017-10-17 12:21:53 +03:00
parent 4b97d56949
commit 443abffa73
6 changed files with 43 additions and 31 deletions

View file

@ -163,8 +163,8 @@ impl AudioEcho {
state: &mut State,
settings: &Settings,
) {
let delay_frames = (settings.delay as usize) * (state.info.channels() as usize) *
(state.info.rate() as usize) / (gst::SECOND as usize);
let delay_frames = (settings.delay as usize) * (state.info.channels() as usize)
* (state.info.rate() as usize) / (gst::SECOND as usize);
for (i, (o, e)) in data.iter_mut().zip(state.buffer.iter(delay_frames)) {
let inp = (*i).to_f64().unwrap();
@ -232,7 +232,11 @@ impl ObjectImpl<RsBaseTransform> for AudioEcho {
impl ElementImpl<RsBaseTransform> for AudioEcho {}
impl BaseTransformImpl<RsBaseTransform> for AudioEcho {
fn transform_ip(&self, _element: &RsBaseTransform, buf: &mut gst::BufferRef) -> gst::FlowReturn {
fn transform_ip(
&self,
_element: &RsBaseTransform,
buf: &mut gst::BufferRef,
) -> gst::FlowReturn {
let mut settings = *self.settings.lock().unwrap();
settings.delay = cmp::min(settings.max_delay, settings.delay);

View file

@ -85,9 +85,9 @@ struct AudioFormat {
// Ignores bitrate
impl PartialEq for AudioFormat {
fn eq(&self, other: &Self) -> bool {
self.format.eq(&other.format) && self.rate.eq(&other.rate) && self.width.eq(&other.width) &&
self.channels.eq(&other.channels) &&
self.aac_sequence_header.eq(&other.aac_sequence_header)
self.format.eq(&other.format) && self.rate.eq(&other.rate) && self.width.eq(&other.width)
&& self.channels.eq(&other.channels)
&& self.aac_sequence_header.eq(&other.aac_sequence_header)
}
}
@ -375,11 +375,11 @@ impl VideoFormat {
// Ignores bitrate
impl PartialEq for VideoFormat {
fn eq(&self, other: &Self) -> bool {
self.format.eq(&other.format) && self.width.eq(&other.width) &&
self.height.eq(&other.height) &&
self.pixel_aspect_ratio.eq(&other.pixel_aspect_ratio) &&
self.framerate.eq(&other.framerate) &&
self.avc_sequence_header.eq(&other.avc_sequence_header)
self.format.eq(&other.format) && self.width.eq(&other.width)
&& self.height.eq(&other.height)
&& self.pixel_aspect_ratio.eq(&other.pixel_aspect_ratio)
&& self.framerate.eq(&other.framerate)
&& self.avc_sequence_header.eq(&other.avc_sequence_header)
}
}
@ -618,9 +618,9 @@ impl FlvDemux {
}
}
if !streaming_state.got_all_streams && streaming_state.audio != None &&
(streaming_state.expect_video && streaming_state.video != None ||
!streaming_state.expect_video)
if !streaming_state.got_all_streams && streaming_state.audio != None
&& (streaming_state.expect_video && streaming_state.video != None
|| !streaming_state.expect_video)
{
streaming_state.got_all_streams = true;
return Ok(HandleBufferResult::HaveAllStreams);
@ -796,9 +796,9 @@ impl FlvDemux {
}
}
if !streaming_state.got_all_streams && streaming_state.video != None &&
(streaming_state.expect_audio && streaming_state.audio != None ||
!streaming_state.expect_audio)
if !streaming_state.got_all_streams && streaming_state.video != None
&& (streaming_state.expect_audio && streaming_state.audio != None
|| !streaming_state.expect_audio)
{
streaming_state.got_all_streams = true;
return Ok(HandleBufferResult::HaveAllStreams);

View file

@ -8,10 +8,10 @@
extern crate glib;
#[macro_use]
extern crate gst_plugin;
#[macro_use]
extern crate gstreamer as gst;
extern crate gstreamer_base as gst_base;
#[macro_use]
extern crate gst_plugin;
extern crate url;
@ -19,4 +19,8 @@ pub mod source;
pub mod sink;
pub mod demuxer;
pub type UriValidator = Fn(&url::Url) -> Result<(), gst_plugin::error::UriError> + Send + Sync + 'static;
pub type UriValidator = Fn(&url::Url)
-> Result<(), gst_plugin::error::UriError>
+ Send
+ Sync
+ 'static;

View file

@ -670,7 +670,11 @@ where
let imp = &*element.imp;
panic_to_error!(&wrap, &element.panicked, gst::FlowReturn::Error, {
imp.transform(&wrap, &from_glib_borrow(inbuf), gst::BufferRef::from_mut_ptr(outbuf))
imp.transform(
&wrap,
&from_glib_borrow(inbuf),
gst::BufferRef::from_mut_ptr(outbuf),
)
}).to_glib()
}

View file

@ -464,8 +464,8 @@ pub unsafe fn get_type<T: ObjectType>() -> glib_ffi::GType {
loop {
let type_name = CString::new(format!("{}-{}", T::NAME, idx)).unwrap();
if gobject_ffi::g_type_from_name(type_name.as_ptr()) ==
gobject_ffi::G_TYPE_INVALID
if gobject_ffi::g_type_from_name(type_name.as_ptr())
== gobject_ffi::G_TYPE_INVALID
{
break type_name;
}

View file

@ -44,8 +44,8 @@ unsafe extern "C" fn uri_handler_get_type<T: ObjectType>(
callback_guard!();
let klass = gobject_ffi::g_type_class_peek(type_);
let klass = &*(klass as *const ClassStruct<T>);
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as
*const URIHandlerStatic<T>;
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type())
as *const URIHandlerStatic<T>;
(*(*interface_static).imp_static).get_type().to_glib()
}
@ -55,8 +55,8 @@ unsafe extern "C" fn uri_handler_get_protocols<T: ObjectType>(
callback_guard!();
let klass = gobject_ffi::g_type_class_peek(type_);
let klass = &*(klass as *const ClassStruct<T>);
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as
*const URIHandlerStatic<T>;
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type())
as *const URIHandlerStatic<T>;
(*(*interface_static).protocols).as_ptr()
}
@ -67,8 +67,8 @@ unsafe extern "C" fn uri_handler_get_uri<T: ObjectType>(
floating_reference_guard!(uri_handler);
let klass = &**(uri_handler as *const *const ClassStruct<T>);
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as
*const URIHandlerStatic<T>;
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type())
as *const URIHandlerStatic<T>;
let instance = &*(uri_handler as *const InstanceStruct<T>);
let imp = instance.get_impl();
@ -86,8 +86,8 @@ unsafe extern "C" fn uri_handler_set_uri<T: ObjectType>(
floating_reference_guard!(uri_handler);
let klass = &**(uri_handler as *const *const ClassStruct<T>);
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as
*const URIHandlerStatic<T>;
let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type())
as *const URIHandlerStatic<T>;
let instance = &*(uri_handler as *const InstanceStruct<T>);
let imp = instance.get_impl();