Commit 6da0a9d1 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Regenerate everything with latest gir

parent 948fb2ae
......@@ -5,6 +5,7 @@
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::ObjectType;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
......@@ -12,18 +13,11 @@ use glib_ffi;
use gobject_ffi;
use gst;
use gst_base;
use gst_base_ffi;
use gst_ffi;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct AppSink(Object<ffi::GstAppSink, ffi::GstAppSinkClass>): [
gst_base::BaseSink => gst_base_ffi::GstBaseSink,
gst::Element => gst_ffi::GstElement,
gst::Object => gst_ffi::GstObject,
gst::URIHandler => gst_ffi::GstURIHandler,
];
pub struct AppSink(Object<ffi::GstAppSink, ffi::GstAppSinkClass, AppSinkClass>) @extends gst_base::BaseSink, gst::Element, gst::Object, @implements gst::URIHandler;
match fn {
get_type => || ffi::gst_app_sink_get_type(),
......@@ -99,9 +93,8 @@ impl AppSink {
pub fn set_caps<'a, P: Into<Option<&'a gst::Caps>>>(&self, caps: P) {
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
ffi::gst_app_sink_set_caps(self.to_glib_none().0, caps.0);
ffi::gst_app_sink_set_caps(self.to_glib_none().0, caps.to_glib_none().0);
}
}
......@@ -146,21 +139,21 @@ impl AppSink {
pub fn get_property_buffer_list(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"buffer-list\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::GObject, b"buffer-list\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
pub fn set_property_buffer_list(&self, buffer_list: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, b"buffer-list\0".as_ptr() as *const _, Value::from(&buffer_list).to_glib_none().0);
gobject_ffi::g_object_set_property(self.as_ptr() as *mut gobject_ffi::GObject, b"buffer-list\0".as_ptr() as *const _, Value::from(&buffer_list).to_glib_none().0);
}
}
pub fn get_property_eos(&self) -> bool {
unsafe {
let mut value = Value::from_type(<bool as StaticType>::static_type());
gobject_ffi::g_object_get_property(self.to_glib_none().0, b"eos\0".as_ptr() as *const _, value.to_glib_none_mut().0);
gobject_ffi::g_object_get_property(self.as_ptr() as *mut gobject_ffi::GObject, b"eos\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get().unwrap()
}
}
......@@ -168,7 +161,7 @@ impl AppSink {
pub fn connect_eos<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"eos\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"eos\0".as_ptr() as *const _,
transmute(eos_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -176,7 +169,7 @@ impl AppSink {
pub fn connect_property_buffer_list_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::buffer-list\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::buffer-list\0".as_ptr() as *const _,
transmute(notify_buffer_list_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -184,7 +177,7 @@ impl AppSink {
pub fn connect_property_caps_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::caps\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::caps\0".as_ptr() as *const _,
transmute(notify_caps_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -192,7 +185,7 @@ impl AppSink {
pub fn connect_property_drop_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::drop\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::drop\0".as_ptr() as *const _,
transmute(notify_drop_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -200,7 +193,7 @@ impl AppSink {
pub fn connect_property_emit_signals_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::emit-signals\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::emit-signals\0".as_ptr() as *const _,
transmute(notify_emit_signals_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -208,7 +201,7 @@ impl AppSink {
pub fn connect_property_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::eos\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::eos\0".as_ptr() as *const _,
transmute(notify_eos_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -216,7 +209,7 @@ impl AppSink {
pub fn connect_property_max_buffers_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::max-buffers\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::max-buffers\0".as_ptr() as *const _,
transmute(notify_max_buffers_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -224,7 +217,7 @@ impl AppSink {
pub fn connect_property_wait_on_eos_notify<F: Fn(&AppSink) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&AppSink) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0, b"notify::wait-on-eos\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::wait-on-eos\0".as_ptr() as *const _,
transmute(notify_wait_on_eos_trampoline as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -233,6 +226,8 @@ impl AppSink {
unsafe impl Send for AppSink {}
unsafe impl Sync for AppSink {}
pub const NONE_APP_SINK: Option<&AppSink> = None;
unsafe extern "C" fn eos_trampoline(this: *mut ffi::GstAppSink, f: glib_ffi::gpointer) {
let f: &&(Fn(&AppSink) + Send + Sync + 'static) = transmute(f);
f(&from_glib_borrow(this))
......
This diff is collapsed.
......@@ -3,10 +3,10 @@
// DO NOT EDIT
mod app_sink;
pub use self::app_sink::AppSink;
pub use self::app_sink::{AppSink, AppSinkClass, NONE_APP_SINK};
mod app_src;
pub use self::app_src::AppSrc;
pub use self::app_src::{AppSrc, AppSrcClass, NONE_APP_SRC};
mod enums;
pub use self::enums::AppStreamType;
......
Generated by gir (https://github.com/gtk-rs/gir @ d41632a)
Generated by gir (https://github.com/gtk-rs/gir @ dd6fb0a)
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
......@@ -3,7 +3,7 @@
// DO NOT EDIT
mod stream_volume;
pub use self::stream_volume::StreamVolume;
pub use self::stream_volume::{StreamVolume, NONE_STREAM_VOLUME};
pub use self::stream_volume::StreamVolumeExt;
#[cfg(any(feature = "v1_14", feature = "dox"))]
......
......@@ -4,7 +4,7 @@
use StreamVolumeFormat;
use ffi;
use glib::object::Downcast;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
......@@ -14,7 +14,7 @@ use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct StreamVolume(Object<ffi::GstStreamVolume, ffi::GstStreamVolumeInterface>);
pub struct StreamVolume(Interface<ffi::GstStreamVolume>);
match fn {
get_type => || ffi::gst_stream_volume_get_type(),
......@@ -33,6 +33,8 @@ impl StreamVolume {
unsafe impl Send for StreamVolume {}
unsafe impl Sync for StreamVolume {}
pub const NONE_STREAM_VOLUME: Option<&StreamVolume> = None;
pub trait StreamVolumeExt: 'static {
fn get_mute(&self) -> bool;
......@@ -50,32 +52,32 @@ pub trait StreamVolumeExt: 'static {
impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn get_mute(&self) -> bool {
unsafe {
from_glib(ffi::gst_stream_volume_get_mute(self.to_glib_none().0))
from_glib(ffi::gst_stream_volume_get_mute(self.as_ref().to_glib_none().0))
}
}
fn get_volume(&self, format: StreamVolumeFormat) -> f64 {
unsafe {
ffi::gst_stream_volume_get_volume(self.to_glib_none().0, format.to_glib())
ffi::gst_stream_volume_get_volume(self.as_ref().to_glib_none().0, format.to_glib())
}
}
fn set_mute(&self, mute: bool) {
unsafe {
ffi::gst_stream_volume_set_mute(self.to_glib_none().0, mute.to_glib());
ffi::gst_stream_volume_set_mute(self.as_ref().to_glib_none().0, mute.to_glib());
}
}
fn set_volume(&self, format: StreamVolumeFormat, val: f64) {
unsafe {
ffi::gst_stream_volume_set_volume(self.to_glib_none().0, format.to_glib(), val);
ffi::gst_stream_volume_set_volume(self.as_ref().to_glib_none().0, format.to_glib(), val);
}
}
fn connect_property_mute_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::mute\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::mute\0".as_ptr() as *const _,
transmute(notify_mute_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -83,7 +85,7 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
fn connect_property_volume_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::volume\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::volume\0".as_ptr() as *const _,
transmute(notify_volume_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -92,11 +94,11 @@ impl<O: IsA<StreamVolume>> StreamVolumeExt for O {
unsafe extern "C" fn notify_mute_trampoline<P>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<StreamVolume> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&StreamVolume::from_glib_borrow(this).downcast_unchecked())
f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
}
unsafe extern "C" fn notify_volume_trampoline<P>(this: *mut ffi::GstStreamVolume, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<StreamVolume> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&StreamVolume::from_glib_borrow(this).downcast_unchecked())
f(&StreamVolume::from_glib_borrow(this).unsafe_cast())
}
Generated by gir (https://github.com/gtk-rs/gir @ d41632a)
Generated by gir (https://github.com/gtk-rs/gir @ dd6fb0a)
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
......@@ -10,7 +10,7 @@ use gst;
use std::mem;
glib_wrapper! {
pub struct Adapter(Object<ffi::GstAdapter, ffi::GstAdapterClass>);
pub struct Adapter(Object<ffi::GstAdapter, ffi::GstAdapterClass, AdapterClass>);
match fn {
get_type => || ffi::gst_adapter_get_type(),
......@@ -197,3 +197,5 @@ unsafe impl glib::SendUnique for Adapter {
self.ref_count() == 1
}
}
pub const NONE_ADAPTER: Option<&Adapter> = None;
......@@ -2,11 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use AggregatorClass;
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
......@@ -14,15 +13,11 @@ use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use gst;
use gst_ffi;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct Aggregator(Object<ffi::GstAggregator, ffi::GstAggregatorClass, AggregatorClass>): [
gst::Element => gst_ffi::GstElement,
gst::Object => gst_ffi::GstObject,
];
pub struct Aggregator(Object<ffi::GstAggregator, ffi::GstAggregatorClass, AggregatorClass>) @extends gst::Element, gst::Object;
match fn {
get_type => || ffi::gst_aggregator_get_type(),
......@@ -32,6 +27,8 @@ glib_wrapper! {
unsafe impl Send for Aggregator {}
unsafe impl Sync for Aggregator {}
pub const NONE_AGGREGATOR: Option<&Aggregator> = None;
pub trait AggregatorExt: 'static {
//#[cfg(any(feature = "v1_14", feature = "dox"))]
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams);
......@@ -67,28 +64,28 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
from_glib_full(ffi::gst_aggregator_get_buffer_pool(self.to_glib_none().0))
from_glib_full(ffi::gst_aggregator_get_buffer_pool(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn get_latency(&self) -> gst::ClockTime {
unsafe {
from_glib(ffi::gst_aggregator_get_latency(self.to_glib_none().0))
from_glib(ffi::gst_aggregator_get_latency(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn set_latency(&self, min_latency: gst::ClockTime, max_latency: gst::ClockTime) {
unsafe {
ffi::gst_aggregator_set_latency(self.to_glib_none().0, min_latency.to_glib(), max_latency.to_glib());
ffi::gst_aggregator_set_latency(self.as_ref().to_glib_none().0, min_latency.to_glib(), max_latency.to_glib());
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn set_src_caps(&self, caps: &gst::Caps) {
unsafe {
ffi::gst_aggregator_set_src_caps(self.to_glib_none().0, caps.to_glib_none().0);
ffi::gst_aggregator_set_src_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0);
}
}
......@@ -110,7 +107,7 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
fn connect_property_latency_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::latency\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::latency\0".as_ptr() as *const _,
transmute(notify_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -118,7 +115,7 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
fn connect_property_start_time_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::start-time\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::start-time\0".as_ptr() as *const _,
transmute(notify_start_time_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -128,11 +125,11 @@ impl<O: IsA<Aggregator>> AggregatorExt for O {
unsafe extern "C" fn notify_latency_trampoline<P>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Aggregator> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&Aggregator::from_glib_borrow(this).downcast_unchecked())
f(&Aggregator::from_glib_borrow(this).unsafe_cast())
}
unsafe extern "C" fn notify_start_time_trampoline<P>(this: *mut ffi::GstAggregator, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer)
where P: IsA<Aggregator> {
let f: &&(Fn(&P) + Send + Sync + 'static) = transmute(f);
f(&Aggregator::from_glib_borrow(this).downcast_unchecked())
f(&Aggregator::from_glib_borrow(this).unsafe_cast())
}
......@@ -2,18 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use AggregatorPadClass;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use gst;
use gst_ffi;
glib_wrapper! {
pub struct AggregatorPad(Object<ffi::GstAggregatorPad, ffi::GstAggregatorPadClass, AggregatorPadClass>): [
gst::Pad => gst_ffi::GstPad,
gst::Object => gst_ffi::GstObject,
];
pub struct AggregatorPad(Object<ffi::GstAggregatorPad, ffi::GstAggregatorPadClass, AggregatorPadClass>) @extends gst::Pad, gst::Object;
match fn {
get_type => || ffi::gst_aggregator_pad_get_type(),
......@@ -23,6 +18,8 @@ glib_wrapper! {
unsafe impl Send for AggregatorPad {}
unsafe impl Sync for AggregatorPad {}
pub const NONE_AGGREGATOR_PAD: Option<&AggregatorPad> = None;
pub trait AggregatorPadExt: 'static {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn drop_buffer(&self) -> bool;
......@@ -44,35 +41,35 @@ impl<O: IsA<AggregatorPad>> AggregatorPadExt for O {
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn drop_buffer(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_pad_drop_buffer(self.to_glib_none().0))
from_glib(ffi::gst_aggregator_pad_drop_buffer(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14_1", feature = "dox"))]
fn has_buffer(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_pad_has_buffer(self.to_glib_none().0))
from_glib(ffi::gst_aggregator_pad_has_buffer(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn is_eos(&self) -> bool {
unsafe {
from_glib(ffi::gst_aggregator_pad_is_eos(self.to_glib_none().0))
from_glib(ffi::gst_aggregator_pad_is_eos(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn peek_buffer(&self) -> Option<gst::Buffer> {
unsafe {
from_glib_full(ffi::gst_aggregator_pad_peek_buffer(self.to_glib_none().0))
from_glib_full(ffi::gst_aggregator_pad_peek_buffer(self.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v1_14", feature = "dox"))]
fn pop_buffer(&self) -> Option<gst::Buffer> {
unsafe {
from_glib_full(ffi::gst_aggregator_pad_pop_buffer(self.to_glib_none().0))
from_glib_full(ffi::gst_aggregator_pad_pop_buffer(self.as_ref().to_glib_none().0))
}
}
}
This diff is collapsed.
......@@ -2,11 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use BaseSrcClass;
use ffi;
use glib::StaticType;
use glib::Value;
use glib::object::Downcast;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
......@@ -14,16 +13,12 @@ use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use gst;
use gst_ffi;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
glib_wrapper! {
pub struct BaseSrc(Object<ffi::GstBaseSrc, ffi::GstBaseSrcClass, BaseSrcClass>): [
gst::Element => gst_ffi::GstElement,
gst::Object => gst_ffi::GstObject,
];
pub struct BaseSrc(Object<ffi::GstBaseSrc, ffi::GstBaseSrcClass, BaseSrcClass>) @extends gst::Element, gst::Object;
match fn {
get_type => || ffi::gst_base_src_get_type(),
......@@ -33,6 +28,8 @@ glib_wrapper! {
unsafe impl Send for BaseSrc {}
unsafe impl Sync for BaseSrc {}
pub const NONE_BASE_SRC: Option<&BaseSrc> = None;
pub trait BaseSrcExt: 'static {
//fn get_allocator(&self, allocator: /*Ignored*/gst::Allocator, params: /*Ignored*/gst::AllocationParams);
......@@ -90,37 +87,37 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn get_blocksize(&self) -> u32 {
unsafe {
ffi::gst_base_src_get_blocksize(self.to_glib_none().0)
ffi::gst_base_src_get_blocksize(self.as_ref().to_glib_none().0)
}
}
fn get_buffer_pool(&self) -> Option<gst::BufferPool> {
unsafe {
from_glib_full(ffi::gst_base_src_get_buffer_pool(self.to_glib_none().0))
from_glib_full(ffi::gst_base_src_get_buffer_pool(self.as_ref().to_glib_none().0))
}
}
fn get_do_timestamp(&self) -> bool {
unsafe {
from_glib(ffi::gst_base_src_get_do_timestamp(self.to_glib_none().0))
from_glib(ffi::gst_base_src_get_do_timestamp(self.as_ref().to_glib_none().0))
}
}
fn is_async(&self) -> bool {
unsafe {
from_glib(ffi::gst_base_src_is_async(self.to_glib_none().0))
from_glib(ffi::gst_base_src_is_async(self.as_ref().to_glib_none().0))
}
}
fn is_live(&self) -> bool {
unsafe {
from_glib(ffi::gst_base_src_is_live(self.to_glib_none().0))
from_glib(ffi::gst_base_src_is_live(self.as_ref().to_glib_none().0))
}
}
fn new_seamless_segment(&self, start: i64, stop: i64, time: i64) -> bool {
unsafe {
from_glib(ffi::gst_base_src_new_seamless_segment(self.to_glib_none().0, start, stop, time))
from_glib(ffi::gst_base_src_new_seamless_segment(self.as_ref().to_glib_none().0, start, stop, time))
}
}
......@@ -129,56 +126,56 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
let mut live = mem::uninitialized();
let mut min_latency = mem::uninitialized();
let mut max_latency = mem::uninitialized();
let ret = from_glib(ffi::gst_base_src_query_latency(self.to_glib_none().0, &mut live, &mut min_latency, &mut max_latency));
let ret = from_glib(ffi::gst_base_src_query_latency(self.as_ref().to_glib_none().0, &mut live, &mut min_latency, &mut max_latency));
if ret { Some((from_glib(live), from_glib(min_latency), from_glib(max_latency))) } else { None }
}
}
fn set_async(&self, async: bool) {
unsafe {
ffi::gst_base_src_set_async(self.to_glib_none().0, async.to_glib());
ffi::gst_base_src_set_async(self.as_ref().to_glib_none().0, async.to_glib());
}
}
fn set_automatic_eos(&self, automatic_eos: bool) {
unsafe {
ffi::gst_base_src_set_automatic_eos(self.to_glib_none().0, automatic_eos.to_glib());
ffi::gst_base_src_set_automatic_eos(self.as_ref().to_glib_none().0, automatic_eos.to_glib());
}
}
fn set_blocksize(&self, blocksize: u32) {
unsafe {
ffi::gst_base_src_set_blocksize(self.to_glib_none().0, blocksize);
ffi::gst_base_src_set_blocksize(self.as_ref().to_glib_none().0, blocksize);
}
}
fn set_caps(&self, caps: &gst::Caps) -> bool {
unsafe {
from_glib(ffi::gst_base_src_set_caps(self.to_glib_none().0, caps.to_glib_none().0))
from_glib(ffi::gst_base_src_set_caps(self.as_ref().to_glib_none().0, caps.to_glib_none().0))
}
}
fn set_do_timestamp(&self, timestamp: bool) {
unsafe {
ffi::gst_base_src_set_do_timestamp(self.to_glib_none().0, timestamp.to_glib());
ffi::gst_base_src_set_do_timestamp(self.as_ref().to_glib_none().0, timestamp.to_glib());
}
}
fn set_dynamic_size(&self, dynamic: bool) {
unsafe {
ffi::gst_base_src_set_dynamic_size(self.to_glib_none().0, dynamic.to_glib());
ffi::gst_base_src_set_dynamic_size(self.as_ref().to_glib_none().0, dynamic.to_glib());
}
}
fn set_format(&self, format: gst::Format) {
unsafe {
ffi::gst_base_src_set_format(self.to_glib_none().0, format.to_glib());
ffi::gst_base_src_set_format(self.as_ref().to_glib_none().0, format.to_glib());
}
}
fn set_live(&self, live: bool) {
unsafe {
ffi::gst_base_src_set_live(self.to_glib_none().0, live.to_glib());
ffi::gst_base_src_set_live(self.as_ref().to_glib_none().0, live.to_glib());
}
}
......@@ -213,7 +210,7 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn connect_property_blocksize_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::blocksize\0".as_ptr() as *const _,
transmute(notify_blocksize_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -221,7 +218,7 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn connect_property_do_timestamp_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::do-timestamp\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::do-timestamp\0".as_ptr() as *const _,
transmute(notify_do_timestamp_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
......@@ -229,7 +226,7 @@ impl<O: IsA<BaseSrc>> BaseSrcExt for O {
fn connect_property_num_buffers_notify<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
unsafe {
let f: Box_<Box_<Fn(&Self) + Send + Sync + 'static>> = Box_::new(Box_::new(f));
connect_raw(self.to_glib_none().0 as *mut _, b"notify::num-buffers\0".as_ptr() as *const _,
connect_raw(self.as_ptr() as *mut _, b"notify::num-buffers\0".as_ptr() as *const _,