Remove some code that is nowadays generated by the glib_wrapper! macro

This commit is contained in:
Sebastian Dröge 2019-01-16 15:23:53 +02:00
parent 58ccf666a6
commit 43ec33a1db
12 changed files with 10 additions and 288 deletions

View file

@ -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<gst::FlowSuccess, gst::FlowError>;
}
@ -29,27 +27,3 @@ impl<O: IsA<Aggregator>> 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()
}
}

View file

@ -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<O: IsA<AggregatorPad>> 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()
}
}

View file

@ -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<O: IsA<BaseSink>> 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()
}
}

View file

@ -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<O: IsA<BaseSrc>> 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()
}
}

View file

@ -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<O: IsA<BaseTransform>> 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()
}
}

View file

@ -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

View file

@ -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<O: IsA<Bin>> 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::*;

View file

@ -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<O: IsA<Element>> 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 {

View file

@ -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<Option<&'a str>>, Q: IsA<Pad>>(name: P, target: &Q) -> Option<GhostPad> {
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()
}
}

View file

@ -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;

View file

@ -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<O: IsA<Pad>> 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,

View file

@ -1,37 +0,0 @@
// Copyright (C) 2018 Sebastian Dröge <sebastian@centricular.com>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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()
}
}