diff --git a/gst-plugin-audiofx/src/audioecho.rs b/gst-plugin-audiofx/src/audioecho.rs index 473705ad..dfb1bcc6 100644 --- a/gst-plugin-audiofx/src/audioecho.rs +++ b/gst-plugin-audiofx/src/audioecho.rs @@ -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 for AudioEcho { impl ElementImpl for AudioEcho {} impl BaseTransformImpl 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); diff --git a/gst-plugin-flv/src/flvdemux.rs b/gst-plugin-flv/src/flvdemux.rs index 948d8f00..df0c5a91 100644 --- a/gst-plugin-flv/src/flvdemux.rs +++ b/gst-plugin-flv/src/flvdemux.rs @@ -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); diff --git a/gst-plugin-simple/src/lib.rs b/gst-plugin-simple/src/lib.rs index 97d07609..f01d0b10 100644 --- a/gst-plugin-simple/src/lib.rs +++ b/gst-plugin-simple/src/lib.rs @@ -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; diff --git a/gst-plugin/src/base_transform.rs b/gst-plugin/src/base_transform.rs index 1de5c188..49e67b6d 100644 --- a/gst-plugin/src/base_transform.rs +++ b/gst-plugin/src/base_transform.rs @@ -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() } diff --git a/gst-plugin/src/object.rs b/gst-plugin/src/object.rs index b9d4e108..ad228ec3 100644 --- a/gst-plugin/src/object.rs +++ b/gst-plugin/src/object.rs @@ -464,8 +464,8 @@ pub unsafe fn get_type() -> 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; } diff --git a/gst-plugin/src/uri_handler.rs b/gst-plugin/src/uri_handler.rs index 89d20add..7a8a818b 100644 --- a/gst-plugin/src/uri_handler.rs +++ b/gst-plugin/src/uri_handler.rs @@ -44,8 +44,8 @@ unsafe extern "C" fn uri_handler_get_type( callback_guard!(); let klass = gobject_ffi::g_type_class_peek(type_); let klass = &*(klass as *const ClassStruct); - let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as - *const URIHandlerStatic; + let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) + as *const URIHandlerStatic; (*(*interface_static).imp_static).get_type().to_glib() } @@ -55,8 +55,8 @@ unsafe extern "C" fn uri_handler_get_protocols( callback_guard!(); let klass = gobject_ffi::g_type_class_peek(type_); let klass = &*(klass as *const ClassStruct); - let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as - *const URIHandlerStatic; + let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) + as *const URIHandlerStatic; (*(*interface_static).protocols).as_ptr() } @@ -67,8 +67,8 @@ unsafe extern "C" fn uri_handler_get_uri( floating_reference_guard!(uri_handler); let klass = &**(uri_handler as *const *const ClassStruct); - let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as - *const URIHandlerStatic; + let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) + as *const URIHandlerStatic; let instance = &*(uri_handler as *const InstanceStruct); let imp = instance.get_impl(); @@ -86,8 +86,8 @@ unsafe extern "C" fn uri_handler_set_uri( floating_reference_guard!(uri_handler); let klass = &**(uri_handler as *const *const ClassStruct); - let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) as - *const URIHandlerStatic; + let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) + as *const URIHandlerStatic; let instance = &*(uri_handler as *const InstanceStruct); let imp = instance.get_impl();