diff --git a/gstreamer-base/src/aggregator.rs b/gstreamer-base/src/aggregator.rs index 118248fbd..c107e4d91 100644 --- a/gstreamer-base/src/aggregator.rs +++ b/gstreamer-base/src/aggregator.rs @@ -8,12 +8,10 @@ use ffi; use glib::translate::*; -use glib::{IsA, IsClassFor}; +use glib::IsA; use gst; use Aggregator; -use std::ops; - pub trait AggregatorExtManual: 'static { fn finish_buffer(&self, buffer: gst::Buffer) -> Result; } @@ -29,27 +27,3 @@ impl> AggregatorExtManual for O { ret.into_result() } } - -#[repr(C)] -pub struct AggregatorClass(ffi::GstAggregatorClass); - -unsafe impl IsClassFor for AggregatorClass { - type Instance = Aggregator; -} - -unsafe impl Send for AggregatorClass {} -unsafe impl Sync for AggregatorClass {} - -impl ops::Deref for AggregatorClass { - type Target = gst::ElementClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for AggregatorClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer-base/src/aggregator_pad.rs b/gstreamer-base/src/aggregator_pad.rs index 5efaeb75c..9448be2f1 100644 --- a/gstreamer-base/src/aggregator_pad.rs +++ b/gstreamer-base/src/aggregator_pad.rs @@ -7,14 +7,12 @@ // except according to those terms. use ffi; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::*; use gst; use gst_ffi; use AggregatorPad; -use std::ops; - pub trait AggregatorPadExtManual: 'static { fn get_segment(&self) -> gst::Segment; } @@ -28,27 +26,3 @@ impl> AggregatorPadExtManual for O { } } } - -#[repr(C)] -pub struct AggregatorPadClass(ffi::GstAggregatorPadClass); - -unsafe impl IsClassFor for AggregatorPadClass { - type Instance = ::AggregatorPad; -} - -unsafe impl Send for AggregatorPadClass {} -unsafe impl Sync for AggregatorPadClass {} - -impl ops::Deref for AggregatorPadClass { - type Target = gst::PadClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for AggregatorPadClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer-base/src/base_sink.rs b/gstreamer-base/src/base_sink.rs index ad108d586..75d705972 100644 --- a/gstreamer-base/src/base_sink.rs +++ b/gstreamer-base/src/base_sink.rs @@ -7,11 +7,10 @@ // except according to those terms. use ffi; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::*; use gst; use std::mem; -use std::ops; use BaseSink; pub trait BaseSinkExtManual: 'static { @@ -58,27 +57,3 @@ impl> BaseSinkExtManual for O { ret.into_result() } } - -#[repr(C)] -pub struct BaseSinkClass(ffi::GstBaseSinkClass); - -unsafe impl IsClassFor for BaseSinkClass { - type Instance = BaseSink; -} - -unsafe impl Send for BaseSinkClass {} -unsafe impl Sync for BaseSinkClass {} - -impl ops::Deref for BaseSinkClass { - type Target = gst::ElementClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for BaseSinkClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer-base/src/base_src.rs b/gstreamer-base/src/base_src.rs index b29675451..6ce97fcb8 100644 --- a/gstreamer-base/src/base_src.rs +++ b/gstreamer-base/src/base_src.rs @@ -7,10 +7,9 @@ // except according to those terms. use ffi; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::*; use gst; -use std::ops; use BaseSrc; pub trait BaseSrcExtManual: 'static { @@ -54,27 +53,3 @@ impl> BaseSrcExtManual for O { ret.into_result() } } - -#[repr(C)] -pub struct BaseSrcClass(ffi::GstBaseSrcClass); - -unsafe impl IsClassFor for BaseSrcClass { - type Instance = BaseSrc; -} - -unsafe impl Send for BaseSrcClass {} -unsafe impl Sync for BaseSrcClass {} - -impl ops::Deref for BaseSrcClass { - type Target = gst::ElementClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for BaseSrcClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer-base/src/base_transform.rs b/gstreamer-base/src/base_transform.rs index 497b78ec8..03a0b8eb0 100644 --- a/gstreamer-base/src/base_transform.rs +++ b/gstreamer-base/src/base_transform.rs @@ -7,10 +7,9 @@ // except according to those terms. use ffi; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::*; use gst; -use std::ops; use BaseTransform; pub trait BaseTransformExtManual: 'static { @@ -26,27 +25,3 @@ impl> BaseTransformExtManual for O { } } } - -#[repr(C)] -pub struct BaseTransformClass(ffi::GstBaseTransformClass); - -unsafe impl IsClassFor for BaseTransformClass { - type Instance = BaseTransform; -} - -unsafe impl Send for BaseTransformClass {} -unsafe impl Sync for BaseTransformClass {} - -impl ops::Deref for BaseTransformClass { - type Target = gst::ElementClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for BaseTransformClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer-base/src/lib.rs b/gstreamer-base/src/lib.rs index f853c716d..96cd9344f 100644 --- a/gstreamer-base/src/lib.rs +++ b/gstreamer-base/src/lib.rs @@ -47,17 +47,10 @@ pub use flow_combiner::*; #[cfg(any(feature = "v1_14", feature = "dox"))] mod aggregator; #[cfg(any(feature = "v1_14", feature = "dox"))] -pub use aggregator::AggregatorClass; -#[cfg(any(feature = "v1_14", feature = "dox"))] mod aggregator_pad; -#[cfg(any(feature = "v1_14", feature = "dox"))] -pub use aggregator_pad::AggregatorPadClass; mod base_sink; -pub use base_sink::BaseSinkClass; mod base_src; -pub use base_src::BaseSrcClass; mod base_transform; -pub use base_transform::BaseTransformClass; // Re-export all the traits in a prelude module, so that applications // can always "use gst::prelude::*" without getting conflicts diff --git a/gstreamer/src/bin.rs b/gstreamer/src/bin.rs index fdbc3bec0..f79bbfbe7 100644 --- a/gstreamer/src/bin.rs +++ b/gstreamer/src/bin.rs @@ -10,13 +10,12 @@ use Bin; use Element; use glib; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::{from_glib, from_glib_full, FromGlibPtrContainer, ToGlib, ToGlibPtr}; use glib::GString; use ffi; -use std::ops; use std::path; pub trait GstBinExtManual: 'static { @@ -131,30 +130,6 @@ impl> GstBinExtManual for O { } } -#[repr(C)] -pub struct BinClass(ffi::GstBinClass); - -unsafe impl IsClassFor for BinClass { - type Instance = ::Bin; -} - -unsafe impl Send for BinClass {} -unsafe impl Sync for BinClass {} - -impl ops::Deref for BinClass { - type Target = ::ElementClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for BinClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} - #[cfg(test)] mod tests { use super::*; diff --git a/gstreamer/src/element.rs b/gstreamer/src/element.rs index bf12f92f7..c1375d6f6 100644 --- a/gstreamer/src/element.rs +++ b/gstreamer/src/element.rs @@ -7,11 +7,12 @@ // except according to those terms. use Element; +use ElementClass; use glib; #[cfg(any(feature = "v1_10", feature = "dox"))] use glib::object::Cast; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; #[cfg(any(feature = "v1_10", feature = "dox"))] use glib::translate::FromGlibPtrBorrow; use glib::translate::{ @@ -35,7 +36,6 @@ use StateChangeSuccess; use std::ffi::CStr; use std::mem; -use std::ops; use libc; @@ -683,30 +683,6 @@ impl> ElementExtManual for O { } } -#[repr(C)] -pub struct ElementClass(ffi::GstElementClass); - -unsafe impl IsClassFor for ElementClass { - type Instance = ::Element; -} - -unsafe impl Send for ElementClass {} -unsafe impl Sync for ElementClass {} - -impl ops::Deref for ElementClass { - type Target = glib::ObjectClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for ElementClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} - impl ElementClass { pub fn get_metadata<'a>(&self, key: &str) -> Option<&'a str> { unsafe { diff --git a/gstreamer/src/ghost_pad.rs b/gstreamer/src/ghost_pad.rs index 54b6b1845..8efd98b81 100644 --- a/gstreamer/src/ghost_pad.rs +++ b/gstreamer/src/ghost_pad.rs @@ -8,7 +8,7 @@ use ffi; use glib::object::Cast; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::*; use GhostPad; use Object; @@ -16,8 +16,6 @@ use Pad; use PadMode; use PadTemplate; -use std::ops; - impl GhostPad { pub fn new<'a, P: Into>, Q: IsA>(name: P, target: &Q) -> Option { skip_assert_initialized!(); @@ -96,27 +94,3 @@ impl GhostPad { } } } - -#[repr(C)] -pub struct GhostPadClass(ffi::GstGhostPadClass); - -unsafe impl IsClassFor for GhostPadClass { - type Instance = GhostPad; -} - -unsafe impl Send for GhostPadClass {} -unsafe impl Sync for GhostPadClass {} - -impl ops::Deref for GhostPadClass { - type Target = ::PadClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for GhostPadClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} diff --git a/gstreamer/src/lib.rs b/gstreamer/src/lib.rs index 9ef3c9347..4b32fff33 100644 --- a/gstreamer/src/lib.rs +++ b/gstreamer/src/lib.rs @@ -147,13 +147,8 @@ pub use promise::*; mod bus; mod element; -pub use element::ElementClass; mod bin; -pub use bin::BinClass; - -mod pipeline; -pub use pipeline::PipelineClass; // OS dependent Bus extensions (also import the other plateform mod for doc) #[cfg(any(feature = "v1_14", feature = "dox"))] @@ -180,12 +175,10 @@ mod device_monitor; mod device_provider; mod enums; mod ghost_pad; -pub use ghost_pad::GhostPadClass; mod gobject; mod iterator; mod object; mod pad; -pub use pad::PadClass; mod parse_context; mod proxy_pad; mod tag_setter; diff --git a/gstreamer/src/pad.rs b/gstreamer/src/pad.rs index 4f51fbd89..dcd7305fb 100644 --- a/gstreamer/src/pad.rs +++ b/gstreamer/src/pad.rs @@ -31,11 +31,10 @@ use StaticPadTemplate; use std::cell::RefCell; use std::mem; use std::mem::transmute; -use std::ops; use std::ptr; use glib; -use glib::object::{IsA, IsClassFor}; +use glib::object::IsA; use glib::translate::{ from_glib, from_glib_borrow, from_glib_full, from_glib_none, mut_override, FromGlib, ToGlib, ToGlibPtr, @@ -1026,30 +1025,6 @@ impl> PadExtManual for O { } } -#[repr(C)] -pub struct PadClass(ffi::GstPadClass); - -unsafe impl IsClassFor for PadClass { - type Instance = Pad; -} - -unsafe impl Send for PadClass {} -unsafe impl Sync for PadClass {} - -impl ops::Deref for PadClass { - type Target = glib::ObjectClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for PadClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -} - unsafe extern "C" fn trampoline_pad_probe( pad: *mut ffi::GstPad, info: *mut ffi::GstPadProbeInfo, diff --git a/gstreamer/src/pipeline.rs b/gstreamer/src/pipeline.rs deleted file mode 100644 index bda835bb0..000000000 --- a/gstreamer/src/pipeline.rs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2018 Sebastian Dröge -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -use ffi; - -use std::ops; - -use glib::IsClassFor; - -#[repr(C)] -pub struct PipelineClass(ffi::GstPipelineClass); - -unsafe impl IsClassFor for PipelineClass { - type Instance = ::Pipeline; -} - -unsafe impl Send for PipelineClass {} -unsafe impl Sync for PipelineClass {} - -impl ops::Deref for PipelineClass { - type Target = ::BinClass; - - fn deref(&self) -> &Self::Target { - self.upcast_ref() - } -} - -impl ops::DerefMut for PipelineClass { - fn deref_mut(&mut self) -> &mut Self::Target { - self.upcast_ref_mut() - } -}