mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-02 23:38:45 +00:00
Run everything through rustfmt again
This commit is contained in:
parent
40f243dfc3
commit
c7103765db
14 changed files with 52 additions and 56 deletions
|
@ -11,18 +11,18 @@ use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_audio;
|
use gst_audio;
|
||||||
|
|
||||||
use gst_plugin::properties::*;
|
|
||||||
use gst_plugin::object::*;
|
|
||||||
use gst_plugin::element::*;
|
|
||||||
use gst_plugin::base_transform::*;
|
use gst_plugin::base_transform::*;
|
||||||
|
use gst_plugin::element::*;
|
||||||
|
use gst_plugin::object::*;
|
||||||
|
use gst_plugin::properties::*;
|
||||||
|
|
||||||
use std::{cmp, iter, i32, u64};
|
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
use std::{cmp, iter, i32, u64};
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
use num_traits::float::Float;
|
|
||||||
use num_traits::cast::{FromPrimitive, ToPrimitive};
|
use num_traits::cast::{FromPrimitive, ToPrimitive};
|
||||||
|
use num_traits::float::Float;
|
||||||
|
|
||||||
const DEFAULT_MAX_DELAY: u64 = gst::SECOND_VAL;
|
const DEFAULT_MAX_DELAY: u64 = gst::SECOND_VAL;
|
||||||
const DEFAULT_DELAY: u64 = 500 * gst::MSECOND_VAL;
|
const DEFAULT_DELAY: u64 = 500 * gst::MSECOND_VAL;
|
||||||
|
|
|
@ -12,9 +12,9 @@ use url::Url;
|
||||||
|
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
|
use gst_plugin_simple::UriValidator;
|
||||||
use gst_plugin_simple::error::*;
|
use gst_plugin_simple::error::*;
|
||||||
use gst_plugin_simple::sink::*;
|
use gst_plugin_simple::sink::*;
|
||||||
use gst_plugin_simple::UriValidator;
|
|
||||||
|
|
||||||
use gst;
|
use gst;
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::u64;
|
|
||||||
use std::io::{Read, Seek, SeekFrom};
|
|
||||||
use std::fs::File;
|
use std::fs::File;
|
||||||
|
use std::io::{Read, Seek, SeekFrom};
|
||||||
|
use std::u64;
|
||||||
use url::Url;
|
use url::Url;
|
||||||
|
|
||||||
|
use gst_plugin_simple::UriValidator;
|
||||||
use gst_plugin_simple::error::*;
|
use gst_plugin_simple::error::*;
|
||||||
use gst_plugin_simple::source::*;
|
use gst_plugin_simple::source::*;
|
||||||
use gst_plugin_simple::UriValidator;
|
|
||||||
|
|
||||||
use gst;
|
use gst;
|
||||||
|
|
||||||
|
|
|
@ -15,14 +15,14 @@ extern crate gst_plugin_simple;
|
||||||
extern crate gstreamer as gst;
|
extern crate gstreamer as gst;
|
||||||
extern crate url;
|
extern crate url;
|
||||||
|
|
||||||
use gst_plugin_simple::source::*;
|
|
||||||
use gst_plugin_simple::sink::*;
|
use gst_plugin_simple::sink::*;
|
||||||
|
use gst_plugin_simple::source::*;
|
||||||
|
|
||||||
mod filesrc;
|
|
||||||
mod filesink;
|
mod filesink;
|
||||||
|
mod filesrc;
|
||||||
|
|
||||||
use filesrc::FileSrc;
|
|
||||||
use filesink::FileSink;
|
use filesink::FileSink;
|
||||||
|
use filesrc::FileSrc;
|
||||||
|
|
||||||
fn plugin_init(plugin: &gst::Plugin) -> bool {
|
fn plugin_init(plugin: &gst::Plugin) -> bool {
|
||||||
source_register(
|
source_register(
|
||||||
|
|
|
@ -6,16 +6,16 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::u64;
|
|
||||||
use std::io::Read;
|
|
||||||
use url::Url;
|
|
||||||
use reqwest::{Client, Response};
|
|
||||||
use reqwest::header::{AcceptRanges, ByteRangeSpec, ContentLength, ContentRange, ContentRangeSpec,
|
use reqwest::header::{AcceptRanges, ByteRangeSpec, ContentLength, ContentRange, ContentRangeSpec,
|
||||||
Range, RangeUnit};
|
Range, RangeUnit};
|
||||||
|
use reqwest::{Client, Response};
|
||||||
|
use std::io::Read;
|
||||||
|
use std::u64;
|
||||||
|
use url::Url;
|
||||||
|
|
||||||
|
use gst_plugin_simple::UriValidator;
|
||||||
use gst_plugin_simple::error::*;
|
use gst_plugin_simple::error::*;
|
||||||
use gst_plugin_simple::source::*;
|
use gst_plugin_simple::source::*;
|
||||||
use gst_plugin_simple::UriValidator;
|
|
||||||
|
|
||||||
use gst;
|
use gst;
|
||||||
|
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
|
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
|
use std::collections::BTreeMap;
|
||||||
use std::u32;
|
use std::u32;
|
||||||
use std::u64;
|
use std::u64;
|
||||||
use std::collections::BTreeMap;
|
|
||||||
|
|
||||||
use gst_plugin::object::*;
|
|
||||||
use gst_plugin::element::*;
|
use gst_plugin::element::*;
|
||||||
|
use gst_plugin::object::*;
|
||||||
|
|
||||||
use error::*;
|
use error::*;
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::{Display, Formatter};
|
|
||||||
use std::fmt::Error as FmtError;
|
use std::fmt::Error as FmtError;
|
||||||
|
use std::fmt::{Display, Formatter};
|
||||||
|
|
||||||
use glib;
|
use glib;
|
||||||
use gst;
|
use gst;
|
||||||
|
|
|
@ -14,9 +14,9 @@ extern crate gstreamer_base as gst_base;
|
||||||
|
|
||||||
extern crate url;
|
extern crate url;
|
||||||
|
|
||||||
pub mod source;
|
|
||||||
pub mod sink;
|
|
||||||
pub mod demuxer;
|
pub mod demuxer;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
pub mod sink;
|
||||||
|
pub mod source;
|
||||||
|
|
||||||
pub type UriValidator = Fn(&url::Url) -> Result<(), error::UriError> + Send + Sync + 'static;
|
pub type UriValidator = Fn(&url::Url) -> Result<(), error::UriError> + Send + Sync + 'static;
|
||||||
|
|
|
@ -15,12 +15,12 @@ use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_base::prelude::*;
|
use gst_base::prelude::*;
|
||||||
|
|
||||||
|
use error::*;
|
||||||
|
use gst_plugin::base_sink::*;
|
||||||
|
use gst_plugin::element::*;
|
||||||
use gst_plugin::object::*;
|
use gst_plugin::object::*;
|
||||||
use gst_plugin::properties::*;
|
use gst_plugin::properties::*;
|
||||||
use gst_plugin::element::*;
|
|
||||||
use gst_plugin::base_sink::*;
|
|
||||||
use gst_plugin::uri_handler::*;
|
use gst_plugin::uri_handler::*;
|
||||||
use error::*;
|
|
||||||
|
|
||||||
pub use gst_plugin::base_sink::BaseSink;
|
pub use gst_plugin::base_sink::BaseSink;
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,12 @@ use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_base::prelude::*;
|
use gst_base::prelude::*;
|
||||||
|
|
||||||
|
use error::*;
|
||||||
|
use gst_plugin::base_src::*;
|
||||||
|
use gst_plugin::element::*;
|
||||||
use gst_plugin::object::*;
|
use gst_plugin::object::*;
|
||||||
use gst_plugin::properties::*;
|
use gst_plugin::properties::*;
|
||||||
use gst_plugin::element::*;
|
|
||||||
use gst_plugin::base_src::*;
|
|
||||||
use gst_plugin::uri_handler::*;
|
use gst_plugin::uri_handler::*;
|
||||||
use error::*;
|
|
||||||
|
|
||||||
pub use gst_plugin::base_src::BaseSrc;
|
pub use gst_plugin::base_src::BaseSrc;
|
||||||
|
|
||||||
|
|
|
@ -21,15 +21,15 @@ use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_video;
|
use gst_video;
|
||||||
|
|
||||||
use gst_plugin::properties::*;
|
|
||||||
use gst_plugin::object::*;
|
|
||||||
use gst_plugin::element::*;
|
use gst_plugin::element::*;
|
||||||
|
use gst_plugin::object::*;
|
||||||
|
use gst_plugin::properties::*;
|
||||||
|
|
||||||
use std::sync::{Arc, Condvar, Mutex};
|
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::iter;
|
|
||||||
use std::cmp;
|
use std::cmp;
|
||||||
|
use std::collections::HashMap;
|
||||||
use std::f64;
|
use std::f64;
|
||||||
|
use std::iter;
|
||||||
|
use std::sync::{Arc, Condvar, Mutex};
|
||||||
|
|
||||||
const DEFAULT_RECORD: bool = false;
|
const DEFAULT_RECORD: bool = false;
|
||||||
|
|
||||||
|
|
|
@ -11,10 +11,10 @@ use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_video;
|
use gst_video;
|
||||||
|
|
||||||
use gst_plugin::properties::*;
|
|
||||||
use gst_plugin::object::*;
|
|
||||||
use gst_plugin::element::*;
|
|
||||||
use gst_plugin::base_transform::*;
|
use gst_plugin::base_transform::*;
|
||||||
|
use gst_plugin::element::*;
|
||||||
|
use gst_plugin::object::*;
|
||||||
|
use gst_plugin::properties::*;
|
||||||
|
|
||||||
use std::i32;
|
use std::i32;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
|
@ -9,22 +9,22 @@
|
||||||
use glib;
|
use glib;
|
||||||
use gst;
|
use gst;
|
||||||
use gst::prelude::*;
|
use gst::prelude::*;
|
||||||
use gst_base::prelude::*;
|
|
||||||
use gst_audio;
|
use gst_audio;
|
||||||
|
use gst_base::prelude::*;
|
||||||
|
|
||||||
use byte_slice_cast::*;
|
use byte_slice_cast::*;
|
||||||
|
|
||||||
use gst_plugin::properties::*;
|
|
||||||
use gst_plugin::object::*;
|
|
||||||
use gst_plugin::element::*;
|
|
||||||
use gst_plugin::base_src::*;
|
use gst_plugin::base_src::*;
|
||||||
|
use gst_plugin::element::*;
|
||||||
|
use gst_plugin::object::*;
|
||||||
|
use gst_plugin::properties::*;
|
||||||
|
|
||||||
use std::{i32, u32};
|
|
||||||
use std::sync::Mutex;
|
|
||||||
use std::ops::Rem;
|
use std::ops::Rem;
|
||||||
|
use std::sync::Mutex;
|
||||||
|
use std::{i32, u32};
|
||||||
|
|
||||||
use num_traits::float::Float;
|
|
||||||
use num_traits::cast::NumCast;
|
use num_traits::cast::NumCast;
|
||||||
|
use num_traits::float::Float;
|
||||||
|
|
||||||
// Default values of properties
|
// Default values of properties
|
||||||
const DEFAULT_SAMPLES_PER_BUFFER: u32 = 1024;
|
const DEFAULT_SAMPLES_PER_BUFFER: u32 = 1024;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
|
use std::any::Any;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
|
|
||||||
|
@ -53,28 +54,23 @@ pub trait ElementImpl<T: ElementBase>: ObjectImpl<T> + AnyImpl + Send + Sync + '
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
use std::any::Any;
|
|
||||||
|
|
||||||
pub trait ElementImplExt<T> {
|
pub trait ElementImplExt<T> {
|
||||||
fn catch_panic_pad_function<R, F: FnOnce(&Self, &T) -> R, G: FnOnce() -> R>(
|
fn catch_panic_pad_function<R, F: FnOnce(&Self, &T) -> R, G: FnOnce() -> R>(
|
||||||
parent: &Option<gst::Object>,
|
parent: &Option<gst::Object>,
|
||||||
fallback: G,
|
fallback: G,
|
||||||
f: F,
|
f: F,
|
||||||
) -> R;
|
) -> R;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<S: ElementImpl<T>, T: ObjectType + glib::IsA<gst::Element> + glib::IsA<gst::Object>> ElementImplExt<T> for S {
|
impl<S: ElementImpl<T>, T: ObjectType + glib::IsA<gst::Element> + glib::IsA<gst::Object>>
|
||||||
|
ElementImplExt<T> for S
|
||||||
|
{
|
||||||
fn catch_panic_pad_function<R, F: FnOnce(&Self, &T) -> R, G: FnOnce() -> R>(
|
fn catch_panic_pad_function<R, F: FnOnce(&Self, &T) -> R, G: FnOnce() -> R>(
|
||||||
parent: &Option<gst::Object>,
|
parent: &Option<gst::Object>,
|
||||||
fallback: G,
|
fallback: G,
|
||||||
f: F,
|
f: F,
|
||||||
) -> R {
|
) -> R {
|
||||||
let element = parent
|
let element = parent.as_ref().cloned().unwrap().downcast::<T>().unwrap();
|
||||||
.as_ref()
|
|
||||||
.cloned()
|
|
||||||
.unwrap()
|
|
||||||
.downcast::<T>()
|
|
||||||
.unwrap();
|
|
||||||
let imp = Any::downcast_ref::<Self>(element.get_impl()).unwrap();
|
let imp = Any::downcast_ref::<Self>(element.get_impl()).unwrap();
|
||||||
element.catch_panic(fallback, |element| f(imp, element))
|
element.catch_panic(fallback, |element| f(imp, element))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue