mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 08:36:31 +00:00
Run everything through rustfmt once again
This commit is contained in:
parent
2fc3470fa1
commit
126159c762
5 changed files with 50 additions and 38 deletions
|
@ -61,7 +61,7 @@ fn main_loop(uri: &str) -> Result<(), Error> {
|
||||||
|
|
||||||
let guard = error.as_ref().lock().unwrap();
|
let guard = error.as_ref().lock().unwrap();
|
||||||
|
|
||||||
guard.clone().map_err(|e|e.into())
|
guard.clone().map_err(|e| e.into())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused_variables)]
|
#[allow(unused_variables)]
|
||||||
|
@ -74,7 +74,8 @@ fn main() {
|
||||||
std::process::exit(-1);
|
std::process::exit(-1);
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(not(feature = "gst-player"))] {
|
#[cfg(not(feature = "gst-player"))]
|
||||||
|
{
|
||||||
eprintln!("Feature gst-player is required. Please rebuild with --features gst-player");
|
eprintln!("Feature gst-player is required. Please rebuild with --features gst-player");
|
||||||
std::process::exit(-1);
|
std::process::exit(-1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,12 +34,13 @@ impl AudioChannelPosition {
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] =
|
let positions_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= len as usize {
|
if i >= len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].to_glib()
|
positions[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut mask = mem::uninitialized();
|
let mut mask = mem::uninitialized();
|
||||||
|
@ -100,12 +101,13 @@ impl AudioChannelPosition {
|
||||||
}
|
}
|
||||||
|
|
||||||
let len = positions.len();
|
let len = positions.len();
|
||||||
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] =
|
let mut positions_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(
|
||||||
array_init::array_init_copy(|i| if i >= len as usize {
|
|i| if i >= len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].to_glib()
|
positions[i].to_glib()
|
||||||
});
|
},
|
||||||
|
);
|
||||||
|
|
||||||
let valid: bool = unsafe {
|
let valid: bool = unsafe {
|
||||||
from_glib(ffi::gst_audio_channel_positions_to_valid_order(
|
from_glib(ffi::gst_audio_channel_positions_to_valid_order(
|
||||||
|
@ -143,12 +145,13 @@ impl AudioChannelPosition {
|
||||||
}
|
}
|
||||||
|
|
||||||
let len = positions.len();
|
let len = positions.len();
|
||||||
let positions_raw: [ffi::GstAudioChannelPosition; 64] =
|
let positions_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= len as usize {
|
if i >= len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
positions[i].to_glib()
|
positions[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib(ffi::gst_audio_check_valid_channel_positions(
|
from_glib(ffi::gst_audio_check_valid_channel_positions(
|
||||||
|
@ -176,19 +179,21 @@ pub fn buffer_reorder_channels(
|
||||||
let from_len = from.len();
|
let from_len = from.len();
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] =
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= from_len as usize {
|
if i >= from_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].to_glib()
|
from[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] =
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= to_len as usize {
|
if i >= to_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].to_glib()
|
to[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let valid: bool = unsafe {
|
let valid: bool = unsafe {
|
||||||
from_glib(ffi::gst_audio_buffer_reorder_channels(
|
from_glib(ffi::gst_audio_buffer_reorder_channels(
|
||||||
|
@ -223,19 +228,21 @@ pub fn reorder_channels(
|
||||||
let from_len = from.len();
|
let from_len = from.len();
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] =
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= from_len as usize {
|
if i >= from_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].to_glib()
|
from[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] =
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= to_len as usize {
|
if i >= to_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].to_glib()
|
to[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let valid: bool = unsafe {
|
let valid: bool = unsafe {
|
||||||
from_glib(ffi::gst_audio_reorder_channels(
|
from_glib(ffi::gst_audio_reorder_channels(
|
||||||
|
@ -269,19 +276,21 @@ pub fn get_channel_reorder_map(
|
||||||
let from_len = from.len();
|
let from_len = from.len();
|
||||||
let to_len = to.len();
|
let to_len = to.len();
|
||||||
|
|
||||||
let from_raw: [ffi::GstAudioChannelPosition; 64] =
|
let from_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= from_len as usize {
|
if i >= from_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
from[i].to_glib()
|
from[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let to_raw: [ffi::GstAudioChannelPosition; 64] =
|
let to_raw: [ffi::GstAudioChannelPosition; 64] = array_init::array_init_copy(|i| {
|
||||||
array_init::array_init_copy(|i| if i >= to_len as usize {
|
if i >= to_len as usize {
|
||||||
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
ffi::GST_AUDIO_CHANNEL_POSITION_INVALID
|
||||||
} else {
|
} else {
|
||||||
to[i].to_glib()
|
to[i].to_glib()
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
|
||||||
let mut reorder_map_raw = [0i32, 64];
|
let mut reorder_map_raw = [0i32, 64];
|
||||||
let valid: bool = unsafe {
|
let valid: bool = unsafe {
|
||||||
|
|
|
@ -120,7 +120,7 @@ pub use device_provider::DeviceProviderExtManual;
|
||||||
pub use parse_context::ParseContext;
|
pub use parse_context::ParseContext;
|
||||||
#[cfg(feature = "futures")]
|
#[cfg(feature = "futures")]
|
||||||
pub use bus::BusStream;
|
pub use bus::BusStream;
|
||||||
pub use enums::{StateChangeSuccess, StateChangeError};
|
pub use enums::{StateChangeError, StateChangeSuccess};
|
||||||
pub use clock_time::ClockTime;
|
pub use clock_time::ClockTime;
|
||||||
pub use format::FormatValue;
|
pub use format::FormatValue;
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use glib;
|
use glib;
|
||||||
use glib::{IsA, Cast};
|
use glib::{Cast, IsA};
|
||||||
use glib::translate::ToGlibPtr;
|
use glib::translate::ToGlibPtr;
|
||||||
use glib::signal::SignalHandlerId;
|
use glib::signal::SignalHandlerId;
|
||||||
use glib::object::ObjectExt;
|
use glib::object::ObjectExt;
|
||||||
|
@ -29,11 +29,7 @@ impl<O: IsA<::Object> + IsA<glib::Object> + glib::value::SetValue> GstObjectExtM
|
||||||
f: F,
|
f: F,
|
||||||
) -> SignalHandlerId {
|
) -> SignalHandlerId {
|
||||||
self.connect("deep-notify", false, move |values| {
|
self.connect("deep-notify", false, move |values| {
|
||||||
let obj: O = values[0]
|
let obj: O = values[0].get::<glib::Object>().unwrap().downcast().unwrap();
|
||||||
.get::<glib::Object>()
|
|
||||||
.unwrap()
|
|
||||||
.downcast()
|
|
||||||
.unwrap();
|
|
||||||
let prop_obj: ::Object = values[1].get().unwrap();
|
let prop_obj: ::Object = values[1].get().unwrap();
|
||||||
|
|
||||||
let prop_name = unsafe {
|
let prop_name = unsafe {
|
||||||
|
|
|
@ -65,7 +65,10 @@ fn main() {
|
||||||
let queue_video_pad = video_queue.get_static_pad("sink").unwrap();
|
let queue_video_pad = video_queue.get_static_pad("sink").unwrap();
|
||||||
tee_video_pad.link(&queue_video_pad).into_result().unwrap();
|
tee_video_pad.link(&queue_video_pad).into_result().unwrap();
|
||||||
|
|
||||||
pipeline.set_state(gst::State::Playing).into_result().expect("Unable to set the pipeline to the Playing state.");
|
pipeline
|
||||||
|
.set_state(gst::State::Playing)
|
||||||
|
.into_result()
|
||||||
|
.expect("Unable to set the pipeline to the Playing state.");
|
||||||
let bus = pipeline.get_bus().unwrap();
|
let bus = pipeline.get_bus().unwrap();
|
||||||
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
|
while let Some(msg) = bus.timed_pop(gst::CLOCK_TIME_NONE) {
|
||||||
use gst::MessageView;
|
use gst::MessageView;
|
||||||
|
@ -84,5 +87,8 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline.set_state(gst::State::Null).into_result().expect("Unable to set the pipeline to the Null state.");
|
pipeline
|
||||||
|
.set_state(gst::State::Null)
|
||||||
|
.into_result()
|
||||||
|
.expect("Unable to set the pipeline to the Null state.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue