mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-02-22 07:36:20 +00:00
Run everything through rustfmt again
This commit is contained in:
parent
3db1c92663
commit
d25b5006cb
11 changed files with 64 additions and 61 deletions
|
@ -6,11 +6,11 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::collections::VecDeque;
|
||||
use std::cmp;
|
||||
use std::io;
|
||||
use std::fmt;
|
||||
use std::collections::VecDeque;
|
||||
use std::error::Error;
|
||||
use std::fmt;
|
||||
use std::io;
|
||||
|
||||
use gst;
|
||||
|
||||
|
|
|
@ -26,9 +26,7 @@ macro_rules! any_impl {
|
|||
#[inline]
|
||||
pub fn downcast_ref<U: $trait<T>>(&self) -> Option<&U> {
|
||||
if self.is::<U>() {
|
||||
unsafe {
|
||||
Some(self.downcast_ref_unchecked())
|
||||
}
|
||||
unsafe { Some(self.downcast_ref_unchecked()) }
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
@ -52,9 +50,7 @@ macro_rules! any_impl {
|
|||
#[inline]
|
||||
pub fn downcast_ref<U: $trait>(&self) -> Option<&U> {
|
||||
if self.is::<U>() {
|
||||
unsafe {
|
||||
Some(self.downcast_ref_unchecked())
|
||||
}
|
||||
unsafe { Some(self.downcast_ref_unchecked()) }
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst_ffi;
|
||||
use gst_base_ffi;
|
||||
use gst_ffi;
|
||||
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
|
@ -20,12 +20,13 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_base;
|
||||
|
||||
use object::*;
|
||||
use element::*;
|
||||
use anyimpl::*;
|
||||
use element::*;
|
||||
use object::*;
|
||||
|
||||
pub trait BaseSinkImpl<T: BaseSinkBase>
|
||||
: AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static {
|
||||
pub trait BaseSinkImpl<T: BaseSinkBase>:
|
||||
AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
fn start(&self, _element: &T) -> bool {
|
||||
true
|
||||
}
|
||||
|
@ -93,8 +94,9 @@ pub trait BaseSinkImpl<T: BaseSinkBase>
|
|||
|
||||
any_impl!(BaseSinkBase, BaseSinkImpl);
|
||||
|
||||
pub unsafe trait BaseSinkBase
|
||||
: IsA<gst::Element> + IsA<gst_base::BaseSink> + ObjectType {
|
||||
pub unsafe trait BaseSinkBase:
|
||||
IsA<gst::Element> + IsA<gst_base::BaseSink> + ObjectType
|
||||
{
|
||||
fn parent_query(&self, query: &mut gst::QueryRef) -> bool {
|
||||
unsafe {
|
||||
let klass = self.get_class();
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst_ffi;
|
||||
use gst_base_ffi;
|
||||
use gst_ffi;
|
||||
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
|
@ -20,12 +20,13 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_base;
|
||||
|
||||
use object::*;
|
||||
use element::*;
|
||||
use anyimpl::*;
|
||||
use element::*;
|
||||
use object::*;
|
||||
|
||||
pub trait BaseSrcImpl<T: BaseSrcBase>
|
||||
: AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static {
|
||||
pub trait BaseSrcImpl<T: BaseSrcBase>:
|
||||
AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
fn start(&self, _element: &T) -> bool {
|
||||
true
|
||||
}
|
||||
|
@ -100,8 +101,9 @@ pub trait BaseSrcImpl<T: BaseSrcBase>
|
|||
|
||||
any_impl!(BaseSrcBase, BaseSrcImpl);
|
||||
|
||||
pub unsafe trait BaseSrcBase
|
||||
: IsA<gst::Element> + IsA<gst_base::BaseSrc> + ObjectType {
|
||||
pub unsafe trait BaseSrcBase:
|
||||
IsA<gst::Element> + IsA<gst_base::BaseSrc> + ObjectType
|
||||
{
|
||||
fn parent_create(&self, offset: u64, length: u32) -> Result<gst::Buffer, gst::FlowReturn> {
|
||||
unsafe {
|
||||
let klass = self.get_class();
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use gst_ffi;
|
||||
use gst_base_ffi;
|
||||
use gst_ffi;
|
||||
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
|
@ -20,12 +20,13 @@ use gst;
|
|||
use gst::prelude::*;
|
||||
use gst_base;
|
||||
|
||||
use object::*;
|
||||
use element::*;
|
||||
use anyimpl::*;
|
||||
use element::*;
|
||||
use object::*;
|
||||
|
||||
pub trait BaseTransformImpl<T: BaseTransformBase>
|
||||
: AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static {
|
||||
pub trait BaseTransformImpl<T: BaseTransformBase>:
|
||||
AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
fn start(&self, _element: &T) -> bool {
|
||||
true
|
||||
}
|
||||
|
@ -109,8 +110,9 @@ pub trait BaseTransformImpl<T: BaseTransformBase>
|
|||
|
||||
any_impl!(BaseTransformBase, BaseTransformImpl);
|
||||
|
||||
pub unsafe trait BaseTransformBase
|
||||
: IsA<gst::Element> + IsA<gst_base::BaseTransform> + ObjectType {
|
||||
pub unsafe trait BaseTransformBase:
|
||||
IsA<gst::Element> + IsA<gst_base::BaseTransform> + ObjectType
|
||||
{
|
||||
fn parent_transform_caps(
|
||||
&self,
|
||||
direction: gst::PadDirection,
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
|
@ -18,12 +18,13 @@ use glib::translate::*;
|
|||
use gst;
|
||||
use gst::prelude::*;
|
||||
|
||||
use object::*;
|
||||
use element::*;
|
||||
use anyimpl::*;
|
||||
use element::*;
|
||||
use object::*;
|
||||
|
||||
pub trait BinImpl<T: BinBase>
|
||||
: AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static {
|
||||
pub trait BinImpl<T: BinBase>:
|
||||
AnyImpl + ObjectImpl<T> + ElementImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
fn add_element(&self, bin: &T, element: &gst::Element) -> bool {
|
||||
bin.parent_add_element(element)
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use libc;
|
||||
|
||||
|
@ -20,11 +20,10 @@ use glib::translate::*;
|
|||
use gst;
|
||||
use gst::prelude::*;
|
||||
|
||||
use object::*;
|
||||
use anyimpl::*;
|
||||
use object::*;
|
||||
|
||||
pub trait ElementImpl<T: ElementBase>
|
||||
: ObjectImpl<T> + AnyImpl + Send + Sync + 'static {
|
||||
pub trait ElementImpl<T: ElementBase>: ObjectImpl<T> + AnyImpl + Send + Sync + 'static {
|
||||
fn change_state(&self, element: &T, transition: gst::StateChange) -> gst::StateChangeReturn {
|
||||
element.parent_change_state(transition)
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ extern crate gstreamer_base as gst_base;
|
|||
use std::ptr;
|
||||
|
||||
macro_rules! callback_guard {
|
||||
() => (
|
||||
() => {
|
||||
let _guard = ::glib::CallbackGuard::new();
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
macro_rules! floating_reference_guard {
|
||||
($obj:ident) => (
|
||||
($obj:ident) => {
|
||||
let _guard = $crate::FloatingReferenceGuard::new($obj as *mut _);
|
||||
)
|
||||
};
|
||||
}
|
||||
|
||||
pub struct FloatingReferenceGuard(ptr::NonNull<gobject_ffi::GObject>);
|
||||
|
|
|
@ -6,13 +6,13 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ffi::CString;
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
use std::any::TypeId;
|
||||
use std::collections::BTreeMap;
|
||||
use std::ffi::CString;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::atomic::AtomicBool;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
use std::ptr;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
|
@ -18,20 +18,21 @@ use glib::translate::*;
|
|||
use gst;
|
||||
use gst::prelude::*;
|
||||
|
||||
use object::*;
|
||||
use element::*;
|
||||
use bin::*;
|
||||
use anyimpl::*;
|
||||
use bin::*;
|
||||
use element::*;
|
||||
use object::*;
|
||||
|
||||
pub trait PipelineImpl<T: PipelineBase>
|
||||
: AnyImpl + ObjectImpl<T> + ElementImpl<T> + BinImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
pub trait PipelineImpl<T: PipelineBase>:
|
||||
AnyImpl + ObjectImpl<T> + ElementImpl<T> + BinImpl<T> + Send + Sync + 'static
|
||||
{
|
||||
}
|
||||
|
||||
any_impl!(PipelineBase, PipelineImpl);
|
||||
|
||||
pub unsafe trait PipelineBase
|
||||
: IsA<gst::Element> + IsA<gst::Bin> + IsA<gst::Pipeline> + ObjectType {
|
||||
pub unsafe trait PipelineBase:
|
||||
IsA<gst::Element> + IsA<gst::Bin> + IsA<gst::Pipeline> + ObjectType
|
||||
{
|
||||
}
|
||||
|
||||
pub unsafe trait PipelineClassExt<T: PipelineBase>
|
||||
|
|
|
@ -11,13 +11,13 @@ use glib_ffi;
|
|||
use gobject_ffi;
|
||||
use gst_ffi;
|
||||
|
||||
use libc;
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use gst;
|
||||
use libc;
|
||||
|
||||
use object::*;
|
||||
use anyimpl::*;
|
||||
use object::*;
|
||||
|
||||
pub trait URIHandlerImpl: AnyImpl + Send + Sync + 'static {
|
||||
fn get_uri(&self, element: &gst::URIHandler) -> Option<String>;
|
||||
|
|
Loading…
Reference in a new issue