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_audio;
|
||||
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::element::*;
|
||||
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::{cmp, iter, i32, u64};
|
||||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
use num_traits::float::Float;
|
||||
use num_traits::cast::{FromPrimitive, ToPrimitive};
|
||||
use num_traits::float::Float;
|
||||
|
||||
const DEFAULT_MAX_DELAY: u64 = gst::SECOND_VAL;
|
||||
const DEFAULT_DELAY: u64 = 500 * gst::MSECOND_VAL;
|
||||
|
|
|
@ -12,9 +12,9 @@ use url::Url;
|
|||
|
||||
use std::io::Write;
|
||||
|
||||
use gst_plugin_simple::UriValidator;
|
||||
use gst_plugin_simple::error::*;
|
||||
use gst_plugin_simple::sink::*;
|
||||
use gst_plugin_simple::UriValidator;
|
||||
|
||||
use gst;
|
||||
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::u64;
|
||||
use std::io::{Read, Seek, SeekFrom};
|
||||
use std::fs::File;
|
||||
use std::io::{Read, Seek, SeekFrom};
|
||||
use std::u64;
|
||||
use url::Url;
|
||||
|
||||
use gst_plugin_simple::UriValidator;
|
||||
use gst_plugin_simple::error::*;
|
||||
use gst_plugin_simple::source::*;
|
||||
use gst_plugin_simple::UriValidator;
|
||||
|
||||
use gst;
|
||||
|
||||
|
|
|
@ -15,14 +15,14 @@ extern crate gst_plugin_simple;
|
|||
extern crate gstreamer as gst;
|
||||
extern crate url;
|
||||
|
||||
use gst_plugin_simple::source::*;
|
||||
use gst_plugin_simple::sink::*;
|
||||
use gst_plugin_simple::source::*;
|
||||
|
||||
mod filesrc;
|
||||
mod filesink;
|
||||
mod filesrc;
|
||||
|
||||
use filesrc::FileSrc;
|
||||
use filesink::FileSink;
|
||||
use filesrc::FileSrc;
|
||||
|
||||
fn plugin_init(plugin: &gst::Plugin) -> bool {
|
||||
source_register(
|
||||
|
|
|
@ -6,16 +6,16 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// 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,
|
||||
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::source::*;
|
||||
use gst_plugin_simple::UriValidator;
|
||||
|
||||
use gst;
|
||||
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
use std::sync::Mutex;
|
||||
|
||||
use std::collections::BTreeMap;
|
||||
use std::u32;
|
||||
use std::u64;
|
||||
use std::collections::BTreeMap;
|
||||
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::object::*;
|
||||
|
||||
use error::*;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
use std::error::Error;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::fmt::Error as FmtError;
|
||||
use std::fmt::{Display, Formatter};
|
||||
|
||||
use glib;
|
||||
use gst;
|
||||
|
|
|
@ -14,9 +14,9 @@ extern crate gstreamer_base as gst_base;
|
|||
|
||||
extern crate url;
|
||||
|
||||
pub mod source;
|
||||
pub mod sink;
|
||||
pub mod demuxer;
|
||||
pub mod error;
|
||||
pub mod sink;
|
||||
pub mod source;
|
||||
|
||||
pub type UriValidator = Fn(&url::Url) -> Result<(), error::UriError> + Send + Sync + 'static;
|
||||
|
|
|
@ -15,12 +15,12 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_base::prelude::*;
|
||||
|
||||
use error::*;
|
||||
use gst_plugin::base_sink::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::base_sink::*;
|
||||
use gst_plugin::uri_handler::*;
|
||||
use error::*;
|
||||
|
||||
pub use gst_plugin::base_sink::BaseSink;
|
||||
|
||||
|
|
|
@ -17,12 +17,12 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_base::prelude::*;
|
||||
|
||||
use error::*;
|
||||
use gst_plugin::base_src::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::base_src::*;
|
||||
use gst_plugin::uri_handler::*;
|
||||
use error::*;
|
||||
|
||||
pub use gst_plugin::base_src::BaseSrc;
|
||||
|
||||
|
|
|
@ -21,15 +21,15 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_video;
|
||||
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::object::*;
|
||||
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::collections::HashMap;
|
||||
use std::f64;
|
||||
use std::iter;
|
||||
use std::sync::{Arc, Condvar, Mutex};
|
||||
|
||||
const DEFAULT_RECORD: bool = false;
|
||||
|
||||
|
|
|
@ -11,10 +11,10 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_video;
|
||||
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::base_transform::*;
|
||||
use gst_plugin::element::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::properties::*;
|
||||
|
||||
use std::i32;
|
||||
use std::sync::Mutex;
|
||||
|
|
|
@ -9,22 +9,22 @@
|
|||
use glib;
|
||||
use gst;
|
||||
use gst::prelude::*;
|
||||
use gst_base::prelude::*;
|
||||
use gst_audio;
|
||||
use gst_base::prelude::*;
|
||||
|
||||
use byte_slice_cast::*;
|
||||
|
||||
use gst_plugin::properties::*;
|
||||
use gst_plugin::object::*;
|
||||
use gst_plugin::element::*;
|
||||
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::sync::Mutex;
|
||||
use std::{i32, u32};
|
||||
|
||||
use num_traits::float::Float;
|
||||
use num_traits::cast::NumCast;
|
||||
use num_traits::float::Float;
|
||||
|
||||
// Default values of properties
|
||||
const DEFAULT_SAMPLES_PER_BUFFER: u32 = 1024;
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::any::Any;
|
||||
use std::mem;
|
||||
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> {
|
||||
fn catch_panic_pad_function<R, F: FnOnce(&Self, &T) -> R, G: FnOnce() -> R>(
|
||||
parent: &Option<gst::Object>,
|
||||
fallback: G,
|
||||
f: F,
|
||||
) -> R;
|
||||
parent: &Option<gst::Object>,
|
||||
fallback: G,
|
||||
f: F,
|
||||
) -> 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>(
|
||||
parent: &Option<gst::Object>,
|
||||
fallback: G,
|
||||
f: F,
|
||||
) -> R {
|
||||
let element = parent
|
||||
.as_ref()
|
||||
.cloned()
|
||||
.unwrap()
|
||||
.downcast::<T>()
|
||||
.unwrap();
|
||||
let element = parent.as_ref().cloned().unwrap().downcast::<T>().unwrap();
|
||||
let imp = Any::downcast_ref::<Self>(element.get_impl()).unwrap();
|
||||
element.catch_panic(fallback, |element| f(imp, element))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue