mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
gstreamer: Regenerate
This commit is contained in:
parent
9889bc990a
commit
b933931d6c
37 changed files with 1677 additions and 1891 deletions
|
@ -3,7 +3,7 @@
|
|||
// DO NOT EDIT
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use auto::*;
|
||||
use crate::auto::*;
|
||||
|
||||
pub type ClockTimeDiff = i64;
|
||||
pub type ElementFactoryListType = u64;
|
||||
|
|
|
@ -2,32 +2,28 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Object;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Allocator(Object<gst_sys::GstAllocator, gst_sys::GstAllocatorClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Allocator(Object<ffi::GstAllocator, ffi::GstAllocatorClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_allocator_get_type(),
|
||||
get_type => || ffi::gst_allocator_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Allocator {
|
||||
pub fn find(name: Option<&str>) -> Option<Allocator> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_allocator_find(name.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_allocator_find(name.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn register<P: IsA<Allocator>>(name: &str, allocator: &P) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_allocator_register(
|
||||
name.to_glib_none().0,
|
||||
allocator.as_ref().to_glib_full(),
|
||||
);
|
||||
ffi::gst_allocator_register(name.to_glib_none().0, allocator.as_ref().to_glib_full());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -47,16 +43,16 @@ pub trait AllocatorExt: 'static {
|
|||
|
||||
impl<O: IsA<Allocator>> AllocatorExt for O {
|
||||
//fn alloc(&self, size: usize, params: /*Ignored*/Option<&mut AllocationParams>) -> /*Ignored*/Option<Memory> {
|
||||
// unsafe { TODO: call gst_sys:gst_allocator_alloc() }
|
||||
// unsafe { TODO: call ffi:gst_allocator_alloc() }
|
||||
//}
|
||||
|
||||
//fn free(&self, memory: /*Ignored*/&Memory) {
|
||||
// unsafe { TODO: call gst_sys:gst_allocator_free() }
|
||||
// unsafe { TODO: call ffi:gst_allocator_free() }
|
||||
//}
|
||||
|
||||
fn set_default(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_allocator_set_default(self.as_ref().to_glib_full());
|
||||
ffi::gst_allocator_set_default(self.as_ref().to_glib_full());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,14 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::ChildProxy;
|
||||
use crate::Element;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::ElementFlags;
|
||||
use crate::Object;
|
||||
use crate::Pad;
|
||||
use crate::PadDirection;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
|
@ -10,34 +17,21 @@ use glib::signal::SignalHandlerId;
|
|||
use glib::translate::*;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use ChildProxy;
|
||||
use Element;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use ElementFlags;
|
||||
use Object;
|
||||
use Pad;
|
||||
use PadDirection;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Bin(Object<gst_sys::GstBin, gst_sys::GstBinClass>) @extends Element, Object, @implements ChildProxy;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Bin(Object<ffi::GstBin, ffi::GstBinClass>) @extends Element, Object, @implements ChildProxy;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_bin_get_type(),
|
||||
get_type => || ffi::gst_bin_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Bin {
|
||||
pub fn new(name: Option<&str>) -> Bin {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Element::from_glib_none(gst_sys::gst_bin_new(name.to_glib_none().0)).unsafe_cast()
|
||||
}
|
||||
unsafe { Element::from_glib_none(ffi::gst_bin_new(name.to_glib_none().0)).unsafe_cast() }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -137,8 +131,8 @@ pub trait GstBinExt: 'static {
|
|||
impl<O: IsA<Bin>> GstBinExt for O {
|
||||
fn add<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bin_add(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bin_add(
|
||||
self.as_ref().to_glib_none().0,
|
||||
element.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -148,12 +142,12 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
}
|
||||
|
||||
//fn add_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_add_many() }
|
||||
// unsafe { TODO: call ffi:gst_bin_add_many() }
|
||||
//}
|
||||
|
||||
fn find_unlinked_pad(&self, direction: PadDirection) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_bin_find_unlinked_pad(
|
||||
from_glib_full(ffi::gst_bin_find_unlinked_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
direction.to_glib(),
|
||||
))
|
||||
|
@ -162,7 +156,7 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn get_by_interface(&self, iface: glib::types::Type) -> Option<Element> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_bin_get_by_interface(
|
||||
from_glib_full(ffi::gst_bin_get_by_interface(
|
||||
self.as_ref().to_glib_none().0,
|
||||
iface.to_glib(),
|
||||
))
|
||||
|
@ -171,7 +165,7 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn get_by_name(&self, name: &str) -> Option<Element> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_bin_get_by_name(
|
||||
from_glib_full(ffi::gst_bin_get_by_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -180,7 +174,7 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn get_by_name_recurse_up(&self, name: &str) -> Option<Element> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_bin_get_by_name_recurse_up(
|
||||
from_glib_full(ffi::gst_bin_get_by_name_recurse_up(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -191,7 +185,7 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
fn get_suppressed_flags(&self) -> ElementFlags {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_bin_get_suppressed_flags(
|
||||
from_glib(ffi::gst_bin_get_suppressed_flags(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -200,37 +194,37 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
//#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
//fn iterate_all_by_element_factory_name(&self, factory_name: &str) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_all_by_element_factory_name() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_all_by_element_factory_name() }
|
||||
//}
|
||||
|
||||
//fn iterate_all_by_interface(&self, iface: glib::types::Type) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_all_by_interface() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_all_by_interface() }
|
||||
//}
|
||||
|
||||
//fn iterate_elements(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_elements() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_elements() }
|
||||
//}
|
||||
|
||||
//fn iterate_recurse(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_recurse() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_recurse() }
|
||||
//}
|
||||
|
||||
//fn iterate_sinks(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_sinks() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_sinks() }
|
||||
//}
|
||||
|
||||
//fn iterate_sorted(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_sorted() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_sorted() }
|
||||
//}
|
||||
|
||||
//fn iterate_sources(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_iterate_sources() }
|
||||
// unsafe { TODO: call ffi:gst_bin_iterate_sources() }
|
||||
//}
|
||||
|
||||
fn recalculate_latency(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bin_recalculate_latency(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bin_recalculate_latency(self.as_ref().to_glib_none().0),
|
||||
"Failed to recalculate latency"
|
||||
)
|
||||
}
|
||||
|
@ -238,8 +232,8 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn remove<P: IsA<Element>>(&self, element: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bin_remove(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bin_remove(
|
||||
self.as_ref().to_glib_none().0,
|
||||
element.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -249,21 +243,21 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
}
|
||||
|
||||
//fn remove_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_bin_remove_many() }
|
||||
// unsafe { TODO: call ffi:gst_bin_remove_many() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
fn set_suppressed_flags(&self, flags: ElementFlags) {
|
||||
unsafe {
|
||||
gst_sys::gst_bin_set_suppressed_flags(self.as_ref().to_glib_none().0, flags.to_glib());
|
||||
ffi::gst_bin_set_suppressed_flags(self.as_ref().to_glib_none().0, flags.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn sync_children_states(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bin_sync_children_states(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bin_sync_children_states(self.as_ref().to_glib_none().0),
|
||||
"Failed to sync children states"
|
||||
)
|
||||
}
|
||||
|
@ -272,8 +266,8 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
fn get_property_async_handling(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"async-handling\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -286,8 +280,8 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn set_property_async_handling(&self, async_handling: bool) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"async-handling\0".as_ptr() as *const _,
|
||||
Value::from(&async_handling).to_glib_none().0,
|
||||
);
|
||||
|
@ -297,8 +291,8 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
fn get_property_message_forward(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"message-forward\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -311,8 +305,8 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
|
||||
fn set_property_message_forward(&self, message_forward: bool) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"message-forward\0".as_ptr() as *const _,
|
||||
Value::from(&message_forward).to_glib_none().0,
|
||||
);
|
||||
|
@ -329,10 +323,10 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P, &Bin, &Element) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
sub_bin: *mut gst_sys::GstBin,
|
||||
element: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
sub_bin: *mut ffi::GstBin,
|
||||
element: *mut ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
@ -366,10 +360,10 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P, &Bin, &Element) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
sub_bin: *mut gst_sys::GstBin,
|
||||
element: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
sub_bin: *mut ffi::GstBin,
|
||||
element: *mut ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
@ -401,9 +395,9 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P, &Element) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
element: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
element: *mut ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
@ -434,9 +428,9 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P, &Element) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
element: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
element: *mut ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
@ -467,9 +461,9 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
@ -497,9 +491,9 @@ impl<O: IsA<Bin>> GstBinExt for O {
|
|||
P,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBin,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBin,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Bin>,
|
||||
{
|
||||
|
|
|
@ -2,18 +2,15 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Object;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct BufferPool(Object<gst_sys::GstBufferPool, gst_sys::GstBufferPoolClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct BufferPool(Object<ffi::GstBufferPool, ffi::GstBufferPoolClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_buffer_pool_get_type(),
|
||||
get_type => || ffi::gst_buffer_pool_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,7 +20,7 @@ unsafe impl Sync for BufferPool {}
|
|||
pub const NONE_BUFFER_POOL: Option<&BufferPool> = None;
|
||||
|
||||
pub trait BufferPoolExt: 'static {
|
||||
fn get_options(&self) -> Vec<GString>;
|
||||
fn get_options(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn has_option(&self, option: &str) -> bool;
|
||||
|
||||
|
@ -35,9 +32,9 @@ pub trait BufferPoolExt: 'static {
|
|||
}
|
||||
|
||||
impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
||||
fn get_options(&self) -> Vec<GString> {
|
||||
fn get_options(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(gst_sys::gst_buffer_pool_get_options(
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_buffer_pool_get_options(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -45,7 +42,7 @@ impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
|||
|
||||
fn has_option(&self, option: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_buffer_pool_has_option(
|
||||
from_glib(ffi::gst_buffer_pool_has_option(
|
||||
self.as_ref().to_glib_none().0,
|
||||
option.to_glib_none().0,
|
||||
))
|
||||
|
@ -54,7 +51,7 @@ impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
|||
|
||||
fn is_active(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_buffer_pool_is_active(
|
||||
from_glib(ffi::gst_buffer_pool_is_active(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -62,11 +59,8 @@ impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
|||
|
||||
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_buffer_pool_set_active(
|
||||
self.as_ref().to_glib_none().0,
|
||||
active.to_glib()
|
||||
),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_buffer_pool_set_active(self.as_ref().to_glib_none().0, active.to_glib()),
|
||||
"Failed to activate buffer pool"
|
||||
)
|
||||
}
|
||||
|
@ -74,10 +68,7 @@ impl<O: IsA<BufferPool>> BufferPoolExt for O {
|
|||
|
||||
fn set_flushing(&self, flushing: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_buffer_pool_set_flushing(
|
||||
self.as_ref().to_glib_none().0,
|
||||
flushing.to_glib(),
|
||||
);
|
||||
ffi::gst_buffer_pool_set_flushing(self.as_ref().to_glib_none().0, flushing.to_glib());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,77 +2,74 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::ClockTime;
|
||||
use crate::Message;
|
||||
use crate::Object;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use ClockTime;
|
||||
use Message;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Bus(Object<gst_sys::GstBus, gst_sys::GstBusClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Bus(Object<ffi::GstBus, ffi::GstBusClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_bus_get_type(),
|
||||
get_type => || ffi::gst_bus_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Bus {
|
||||
pub fn new() -> Bus {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_bus_new()) }
|
||||
unsafe { from_glib_full(ffi::gst_bus_new()) }
|
||||
}
|
||||
|
||||
pub fn add_signal_watch(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_bus_add_signal_watch(self.to_glib_none().0);
|
||||
ffi::gst_bus_add_signal_watch(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn async_signal_func(&self, message: &Message, data: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_bus_async_signal_func() }
|
||||
// unsafe { TODO: call ffi:gst_bus_async_signal_func() }
|
||||
//}
|
||||
|
||||
pub fn disable_sync_message_emission(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_bus_disable_sync_message_emission(self.to_glib_none().0);
|
||||
ffi::gst_bus_disable_sync_message_emission(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn enable_sync_message_emission(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_bus_enable_sync_message_emission(self.to_glib_none().0);
|
||||
ffi::gst_bus_enable_sync_message_emission(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
//pub fn get_pollfd(&self, fd: /*Ignored*/glib::PollFD) {
|
||||
// unsafe { TODO: call gst_sys:gst_bus_get_pollfd() }
|
||||
// unsafe { TODO: call ffi:gst_bus_get_pollfd() }
|
||||
//}
|
||||
|
||||
pub fn have_pending(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_bus_have_pending(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_bus_have_pending(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn peek(&self) -> Option<Message> {
|
||||
unsafe { from_glib_full(gst_sys::gst_bus_peek(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_bus_peek(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn pop(&self) -> Option<Message> {
|
||||
unsafe { from_glib_full(gst_sys::gst_bus_pop(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_bus_pop(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn post(&self, message: &Message) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bus_post(self.to_glib_none().0, message.to_glib_full()),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bus_post(self.to_glib_none().0, message.to_glib_full()),
|
||||
"Failed to post message"
|
||||
)
|
||||
}
|
||||
|
@ -80,14 +77,14 @@ impl Bus {
|
|||
|
||||
pub fn remove_signal_watch(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_bus_remove_signal_watch(self.to_glib_none().0);
|
||||
ffi::gst_bus_remove_signal_watch(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_watch(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_bus_remove_watch(self.to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_bus_remove_watch(self.to_glib_none().0),
|
||||
"Bus has no event source"
|
||||
)
|
||||
}
|
||||
|
@ -95,17 +92,17 @@ impl Bus {
|
|||
|
||||
pub fn set_flushing(&self, flushing: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_bus_set_flushing(self.to_glib_none().0, flushing.to_glib());
|
||||
ffi::gst_bus_set_flushing(self.to_glib_none().0, flushing.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn sync_signal_handler(&self, message: &Message, data: /*Unimplemented*/Option<Fundamental: Pointer>) -> BusSyncReply {
|
||||
// unsafe { TODO: call gst_sys:gst_bus_sync_signal_handler() }
|
||||
// unsafe { TODO: call ffi:gst_bus_sync_signal_handler() }
|
||||
//}
|
||||
|
||||
pub fn timed_pop(&self, timeout: ClockTime) -> Option<Message> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_bus_timed_pop(
|
||||
from_glib_full(ffi::gst_bus_timed_pop(
|
||||
self.to_glib_none().0,
|
||||
timeout.to_glib(),
|
||||
))
|
||||
|
@ -114,9 +111,9 @@ impl Bus {
|
|||
|
||||
pub fn connect_message<F: Fn(&Bus, &Message) + Send + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn message_trampoline<F: Fn(&Bus, &Message) + Send + 'static>(
|
||||
this: *mut gst_sys::GstBus,
|
||||
message: *mut gst_sys::GstMessage,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBus,
|
||||
message: *mut ffi::GstMessage,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(message))
|
||||
|
@ -141,9 +138,9 @@ impl Bus {
|
|||
unsafe extern "C" fn sync_message_trampoline<
|
||||
F: Fn(&Bus, &Message) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstBus,
|
||||
message: *mut gst_sys::GstMessage,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstBus,
|
||||
message: *mut ffi::GstMessage,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(message))
|
||||
|
|
|
@ -2,25 +2,19 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use libc;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ChildProxy(Interface<gst_sys::GstChildProxy>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct ChildProxy(Interface<ffi::GstChildProxy>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_child_proxy_get_type(),
|
||||
get_type => || ffi::gst_child_proxy_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,7 +58,7 @@ pub trait ChildProxyExt: 'static {
|
|||
impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
||||
fn child_added<P: IsA<glib::Object>>(&self, child: &P, name: &str) {
|
||||
unsafe {
|
||||
gst_sys::gst_child_proxy_child_added(
|
||||
ffi::gst_child_proxy_child_added(
|
||||
self.as_ref().to_glib_none().0,
|
||||
child.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
|
@ -74,7 +68,7 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
|
||||
fn child_removed<P: IsA<glib::Object>>(&self, child: &P, name: &str) {
|
||||
unsafe {
|
||||
gst_sys::gst_child_proxy_child_removed(
|
||||
ffi::gst_child_proxy_child_removed(
|
||||
self.as_ref().to_glib_none().0,
|
||||
child.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
|
@ -83,12 +77,12 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
}
|
||||
|
||||
//fn get(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_child_proxy_get() }
|
||||
// unsafe { TODO: call ffi:gst_child_proxy_get() }
|
||||
//}
|
||||
|
||||
fn get_child_by_index(&self, index: u32) -> Option<glib::Object> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_child_proxy_get_child_by_index(
|
||||
from_glib_full(ffi::gst_child_proxy_get_child_by_index(
|
||||
self.as_ref().to_glib_none().0,
|
||||
index,
|
||||
))
|
||||
|
@ -97,7 +91,7 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
|
||||
fn get_child_by_name(&self, name: &str) -> Option<glib::Object> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_child_proxy_get_child_by_name(
|
||||
from_glib_full(ffi::gst_child_proxy_get_child_by_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -105,23 +99,23 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
}
|
||||
|
||||
fn get_children_count(&self) -> u32 {
|
||||
unsafe { gst_sys::gst_child_proxy_get_children_count(self.as_ref().to_glib_none().0) }
|
||||
unsafe { ffi::gst_child_proxy_get_children_count(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
//fn get_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call gst_sys:gst_child_proxy_get_valist() }
|
||||
// unsafe { TODO: call ffi:gst_child_proxy_get_valist() }
|
||||
//}
|
||||
|
||||
//fn lookup(&self, name: &str, pspec: /*Ignored*/glib::ParamSpec) -> Option<glib::Object> {
|
||||
// unsafe { TODO: call gst_sys:gst_child_proxy_lookup() }
|
||||
// unsafe { TODO: call ffi:gst_child_proxy_lookup() }
|
||||
//}
|
||||
|
||||
//fn set(&self, first_property_name: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_child_proxy_set() }
|
||||
// unsafe { TODO: call ffi:gst_child_proxy_set() }
|
||||
//}
|
||||
|
||||
//fn set_valist(&self, first_property_name: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call gst_sys:gst_child_proxy_set_valist() }
|
||||
// unsafe { TODO: call ffi:gst_child_proxy_set_valist() }
|
||||
//}
|
||||
|
||||
fn connect_child_added<F: Fn(&Self, &glib::Object, &str) + Send + Sync + 'static>(
|
||||
|
@ -132,10 +126,10 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
P,
|
||||
F: Fn(&P, &glib::Object, &str) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstChildProxy,
|
||||
object: *mut gobject_sys::GObject,
|
||||
this: *mut ffi::GstChildProxy,
|
||||
object: *mut glib::gobject_ffi::GObject,
|
||||
name: *mut libc::c_char,
|
||||
f: glib_sys::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<ChildProxy>,
|
||||
{
|
||||
|
@ -143,7 +137,7 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
f(
|
||||
&ChildProxy::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&from_glib_borrow(object),
|
||||
&GString::from_glib_borrow(name),
|
||||
&glib::GString::from_glib_borrow(name),
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
|
@ -167,10 +161,10 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
P,
|
||||
F: Fn(&P, &glib::Object, &str) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstChildProxy,
|
||||
object: *mut gobject_sys::GObject,
|
||||
this: *mut ffi::GstChildProxy,
|
||||
object: *mut glib::gobject_ffi::GObject,
|
||||
name: *mut libc::c_char,
|
||||
f: glib_sys::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<ChildProxy>,
|
||||
{
|
||||
|
@ -178,7 +172,7 @@ impl<O: IsA<ChildProxy>> ChildProxyExt for O {
|
|||
f(
|
||||
&ChildProxy::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&from_glib_borrow(object),
|
||||
&GString::from_glib_borrow(name),
|
||||
&glib::GString::from_glib_borrow(name),
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::ClockTime;
|
||||
use crate::Object;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
|
@ -10,62 +11,57 @@ use glib::signal::SignalHandlerId;
|
|||
use glib::translate::*;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use ClockTime;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Clock(Object<gst_sys::GstClock, gst_sys::GstClockClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Clock(Object<ffi::GstClock, ffi::GstClockClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_clock_get_type(),
|
||||
get_type => || ffi::gst_clock_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Clock {
|
||||
//pub fn id_compare_func(id1: /*Unimplemented*/Option<Fundamental: Pointer>, id2: /*Unimplemented*/Option<Fundamental: Pointer>) -> i32 {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_compare_func() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_compare_func() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
//pub fn id_get_clock(id: /*Unimplemented*/ClockID) -> Option<Clock> {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_get_clock() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_get_clock() }
|
||||
//}
|
||||
|
||||
//pub fn id_get_time(id: /*Unimplemented*/ClockID) -> ClockTime {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_get_time() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_get_time() }
|
||||
//}
|
||||
|
||||
//pub fn id_ref(id: /*Unimplemented*/ClockID) -> /*Unimplemented*/Option<ClockID> {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_ref() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_ref() }
|
||||
//}
|
||||
|
||||
//pub fn id_unref(id: /*Unimplemented*/ClockID) {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_unref() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_unref() }
|
||||
//}
|
||||
|
||||
//pub fn id_unschedule(id: /*Unimplemented*/ClockID) {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_unschedule() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_unschedule() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v1_16", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
//pub fn id_uses_clock<P: IsA<Clock>>(id: /*Unimplemented*/ClockID, clock: &P) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_uses_clock() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_uses_clock() }
|
||||
//}
|
||||
|
||||
//pub fn id_wait(id: /*Unimplemented*/ClockID) -> (ClockReturn, ClockTimeDiff) {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_wait() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_wait() }
|
||||
//}
|
||||
|
||||
//pub fn id_wait_async(id: /*Unimplemented*/ClockID, func: /*Unimplemented*/Fn(&Clock, ClockTime, /*Unimplemented*/ClockID) -> bool, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> ClockReturn {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_id_wait_async() }
|
||||
// unsafe { TODO: call ffi:gst_clock_id_wait_async() }
|
||||
//}
|
||||
}
|
||||
|
||||
|
@ -157,7 +153,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
fn add_observation(&self, slave: ClockTime, master: ClockTime) -> Option<f64> {
|
||||
unsafe {
|
||||
let mut r_squared = mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(gst_sys::gst_clock_add_observation(
|
||||
let ret = from_glib(ffi::gst_clock_add_observation(
|
||||
self.as_ref().to_glib_none().0,
|
||||
slave.to_glib(),
|
||||
master.to_glib(),
|
||||
|
@ -183,7 +179,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
let mut external = mem::MaybeUninit::uninit();
|
||||
let mut rate_num = mem::MaybeUninit::uninit();
|
||||
let mut rate_denom = mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(gst_sys::gst_clock_add_observation_unapplied(
|
||||
let ret = from_glib(ffi::gst_clock_add_observation_unapplied(
|
||||
self.as_ref().to_glib_none().0,
|
||||
slave.to_glib(),
|
||||
master.to_glib(),
|
||||
|
@ -214,7 +210,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn adjust_unlocked(&self, internal: ClockTime) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_adjust_unlocked(
|
||||
from_glib(ffi::gst_clock_adjust_unlocked(
|
||||
self.as_ref().to_glib_none().0,
|
||||
internal.to_glib(),
|
||||
))
|
||||
|
@ -227,7 +223,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
let mut external = mem::MaybeUninit::uninit();
|
||||
let mut rate_num = mem::MaybeUninit::uninit();
|
||||
let mut rate_denom = mem::MaybeUninit::uninit();
|
||||
gst_sys::gst_clock_get_calibration(
|
||||
ffi::gst_clock_get_calibration(
|
||||
self.as_ref().to_glib_none().0,
|
||||
internal.as_mut_ptr(),
|
||||
external.as_mut_ptr(),
|
||||
|
@ -249,54 +245,46 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn get_internal_time(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_get_internal_time(
|
||||
from_glib(ffi::gst_clock_get_internal_time(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_master(&self) -> Option<Clock> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_clock_get_master(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_clock_get_master(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_resolution(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_get_resolution(
|
||||
from_glib(ffi::gst_clock_get_resolution(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_time(&self) -> ClockTime {
|
||||
unsafe { from_glib(gst_sys::gst_clock_get_time(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_clock_get_time(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_timeout(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_get_timeout(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_clock_get_timeout(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn is_synced(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_clock_is_synced(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_clock_is_synced(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
//fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> /*Unimplemented*/Option<ClockID> {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_new_periodic_id() }
|
||||
// unsafe { TODO: call ffi:gst_clock_new_periodic_id() }
|
||||
//}
|
||||
|
||||
//fn new_single_shot_id(&self, time: ClockTime) -> /*Unimplemented*/Option<ClockID> {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_new_single_shot_id() }
|
||||
// unsafe { TODO: call ffi:gst_clock_new_single_shot_id() }
|
||||
//}
|
||||
|
||||
//fn periodic_id_reinit(&self, id: /*Unimplemented*/ClockID, start_time: ClockTime, interval: ClockTime) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_periodic_id_reinit() }
|
||||
// unsafe { TODO: call ffi:gst_clock_periodic_id_reinit() }
|
||||
//}
|
||||
|
||||
fn set_calibration(
|
||||
|
@ -307,7 +295,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
rate_denom: ClockTime,
|
||||
) {
|
||||
unsafe {
|
||||
gst_sys::gst_clock_set_calibration(
|
||||
ffi::gst_clock_set_calibration(
|
||||
self.as_ref().to_glib_none().0,
|
||||
internal.to_glib(),
|
||||
external.to_glib(),
|
||||
|
@ -319,8 +307,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn set_master<P: IsA<Clock>>(&self, master: Option<&P>) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_clock_set_master(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_clock_set_master(
|
||||
self.as_ref().to_glib_none().0,
|
||||
master.map(|p| p.as_ref()).to_glib_none().0
|
||||
),
|
||||
|
@ -331,7 +319,7 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn set_resolution(&self, resolution: ClockTime) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_set_resolution(
|
||||
from_glib(ffi::gst_clock_set_resolution(
|
||||
self.as_ref().to_glib_none().0,
|
||||
resolution.to_glib(),
|
||||
))
|
||||
|
@ -340,23 +328,23 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn set_synced(&self, synced: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_clock_set_synced(self.as_ref().to_glib_none().0, synced.to_glib());
|
||||
ffi::gst_clock_set_synced(self.as_ref().to_glib_none().0, synced.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_timeout(&self, timeout: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_clock_set_timeout(self.as_ref().to_glib_none().0, timeout.to_glib());
|
||||
ffi::gst_clock_set_timeout(self.as_ref().to_glib_none().0, timeout.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//fn single_shot_id_reinit(&self, id: /*Unimplemented*/ClockID, time: ClockTime) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_clock_single_shot_id_reinit() }
|
||||
// unsafe { TODO: call ffi:gst_clock_single_shot_id_reinit() }
|
||||
//}
|
||||
|
||||
fn unadjust_unlocked(&self, external: ClockTime) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_clock_unadjust_unlocked(
|
||||
from_glib(ffi::gst_clock_unadjust_unlocked(
|
||||
self.as_ref().to_glib_none().0,
|
||||
external.to_glib(),
|
||||
))
|
||||
|
@ -365,8 +353,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn wait_for_sync(&self, timeout: ClockTime) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_clock_wait_for_sync(self.as_ref().to_glib_none().0, timeout.to_glib()),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_clock_wait_for_sync(self.as_ref().to_glib_none().0, timeout.to_glib()),
|
||||
"Timed out waiting for sync"
|
||||
)
|
||||
}
|
||||
|
@ -375,8 +363,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
fn get_property_window_size(&self) -> i32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"window-size\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -389,8 +377,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn set_property_window_size(&self, window_size: i32) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"window-size\0".as_ptr() as *const _,
|
||||
Value::from(&window_size).to_glib_none().0,
|
||||
);
|
||||
|
@ -400,8 +388,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
fn get_property_window_threshold(&self) -> i32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"window-threshold\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -414,8 +402,8 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn set_property_window_threshold(&self, window_threshold: i32) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"window-threshold\0".as_ptr() as *const _,
|
||||
Value::from(&window_threshold).to_glib_none().0,
|
||||
);
|
||||
|
@ -424,9 +412,9 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
|
||||
fn connect_synced<F: Fn(&Self, bool) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn synced_trampoline<P, F: Fn(&P, bool) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstClock,
|
||||
synced: glib_sys::gboolean,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstClock,
|
||||
synced: glib::ffi::gboolean,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Clock>,
|
||||
{
|
||||
|
@ -454,9 +442,9 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_timeout_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstClock,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstClock,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Clock>,
|
||||
{
|
||||
|
@ -481,9 +469,9 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_window_size_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstClock,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstClock,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Clock>,
|
||||
{
|
||||
|
@ -511,9 +499,9 @@ impl<O: IsA<Clock>> ClockExt for O {
|
|||
P,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstClock,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstClock,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Clock>,
|
||||
{
|
||||
|
|
|
@ -2,21 +2,18 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::ClockTime;
|
||||
use crate::Object;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use ClockTime;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ControlBinding(Object<gst_sys::GstControlBinding, gst_sys::GstControlBindingClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct ControlBinding(Object<ffi::GstControlBinding, ffi::GstControlBindingClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_control_binding_get_type(),
|
||||
get_type => || ffi::gst_control_binding_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +44,7 @@ pub trait ControlBindingExt: 'static {
|
|||
impl<O: IsA<ControlBinding>> ControlBindingExt for O {
|
||||
fn get_value(&self, timestamp: ClockTime) -> Option<glib::Value> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_control_binding_get_value(
|
||||
from_glib_full(ffi::gst_control_binding_get_value(
|
||||
self.as_ref().to_glib_none().0,
|
||||
timestamp.to_glib(),
|
||||
))
|
||||
|
@ -55,12 +52,12 @@ impl<O: IsA<ControlBinding>> ControlBindingExt for O {
|
|||
}
|
||||
|
||||
//fn get_value_array(&self, timestamp: ClockTime, interval: ClockTime, values: /*Unimplemented*/&[&Fundamental: Pointer]) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_control_binding_get_value_array() }
|
||||
// unsafe { TODO: call ffi:gst_control_binding_get_value_array() }
|
||||
//}
|
||||
|
||||
fn is_disabled(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_control_binding_is_disabled(
|
||||
from_glib(ffi::gst_control_binding_is_disabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -68,7 +65,7 @@ impl<O: IsA<ControlBinding>> ControlBindingExt for O {
|
|||
|
||||
fn set_disabled(&self, disabled: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_control_binding_set_disabled(
|
||||
ffi::gst_control_binding_set_disabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
disabled.to_glib(),
|
||||
);
|
||||
|
@ -82,7 +79,7 @@ impl<O: IsA<ControlBinding>> ControlBindingExt for O {
|
|||
last_sync: ClockTime,
|
||||
) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_control_binding_sync_values(
|
||||
from_glib(ffi::gst_control_binding_sync_values(
|
||||
self.as_ref().to_glib_none().0,
|
||||
object.as_ref().to_glib_none().0,
|
||||
timestamp.to_glib(),
|
||||
|
@ -94,8 +91,8 @@ impl<O: IsA<ControlBinding>> ControlBindingExt for O {
|
|||
fn get_property_object(&self) -> Option<Object> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<Object as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"object\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::ClockTime;
|
||||
use crate::Object;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use std::mem;
|
||||
use ClockTime;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ControlSource(Object<gst_sys::GstControlSource, gst_sys::GstControlSourceClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct ControlSource(Object<ffi::GstControlSource, ffi::GstControlSourceClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_control_source_get_type(),
|
||||
get_type => || ffi::gst_control_source_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +29,7 @@ impl<O: IsA<ControlSource>> ControlSourceExt for O {
|
|||
fn get_value(&self, timestamp: ClockTime) -> Option<f64> {
|
||||
unsafe {
|
||||
let mut value = mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(gst_sys::gst_control_source_get_value(
|
||||
let ret = from_glib(ffi::gst_control_source_get_value(
|
||||
self.as_ref().to_glib_none().0,
|
||||
timestamp.to_glib(),
|
||||
value.as_mut_ptr(),
|
||||
|
|
|
@ -2,19 +2,16 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::glib_wrapper! {
|
||||
#[derive()]
|
||||
pub struct DateTime(Shared<gst_sys::GstDateTime>);
|
||||
pub struct DateTime(Shared<ffi::GstDateTime>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| gst_sys::gst_date_time_ref(ptr),
|
||||
unref => |ptr| gst_sys::gst_date_time_unref(ptr),
|
||||
get_type => || gst_sys::gst_date_time_get_type(),
|
||||
ref => |ptr| ffi::gst_date_time_ref(ptr),
|
||||
unref => |ptr| ffi::gst_date_time_unref(ptr),
|
||||
get_type => || ffi::gst_date_time_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,36 +27,34 @@ impl DateTime {
|
|||
) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new(
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new(
|
||||
tzoffset, year, month, day, hour, minute, seconds,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create DateTime"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_g_date_time(dt: &glib::DateTime) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_from_g_date_time(
|
||||
dt.to_glib_full(),
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create DateTime from glib::DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new_from_g_date_time(dt.to_glib_full()))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create DateTime from glib::DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_iso8601_string(string: &str) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_from_iso8601_string(
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new_from_iso8601_string(
|
||||
string.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create DateTime from ISO-8601 string"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create DateTime from ISO-8601 string"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_unix_epoch_local_time(secs: i64) -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_date_time_new_from_unix_epoch_local_time(secs)) }
|
||||
unsafe { from_glib_full(ffi::gst_date_time_new_from_unix_epoch_local_time(secs)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
|
@ -67,7 +62,7 @@ impl DateTime {
|
|||
pub fn from_unix_epoch_local_time_usecs(usecs: i64) -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_date_time_new_from_unix_epoch_local_time_usecs(
|
||||
from_glib_full(ffi::gst_date_time_new_from_unix_epoch_local_time_usecs(
|
||||
usecs,
|
||||
))
|
||||
}
|
||||
|
@ -75,14 +70,14 @@ impl DateTime {
|
|||
|
||||
pub fn from_unix_epoch_utc(secs: i64) -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_date_time_new_from_unix_epoch_utc(secs)) }
|
||||
unsafe { from_glib_full(ffi::gst_date_time_new_from_unix_epoch_utc(secs)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
pub fn from_unix_epoch_utc_usecs(usecs: i64) -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_date_time_new_from_unix_epoch_utc_usecs(usecs)) }
|
||||
unsafe { from_glib_full(ffi::gst_date_time_new_from_unix_epoch_utc_usecs(usecs)) }
|
||||
}
|
||||
|
||||
pub fn new_local_time(
|
||||
|
@ -95,7 +90,7 @@ impl DateTime {
|
|||
) -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_date_time_new_local_time(
|
||||
from_glib_full(ffi::gst_date_time_new_local_time(
|
||||
year, month, day, hour, minute, seconds,
|
||||
))
|
||||
}
|
||||
|
@ -103,105 +98,103 @@ impl DateTime {
|
|||
|
||||
pub fn new_now_local_time() -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_date_time_new_now_local_time()) }
|
||||
unsafe { from_glib_full(ffi::gst_date_time_new_now_local_time()) }
|
||||
}
|
||||
|
||||
pub fn new_now_utc() -> DateTime {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_date_time_new_now_utc()) }
|
||||
unsafe { from_glib_full(ffi::gst_date_time_new_now_utc()) }
|
||||
}
|
||||
|
||||
pub fn new_y(year: i32) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_y(year))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new_y(year))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_ym(year: i32, month: i32) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_ym(year, month))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new_ym(year, month))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_ymd(year: i32, month: i32, day: i32) -> Result<DateTime, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_ymd(year, month, day))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_new_ymd(year, month, day))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_day(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_day(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_day(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_hour(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_hour(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_hour(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_microsecond(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_microsecond(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_microsecond(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_minute(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_minute(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_minute(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_month(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_month(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_month(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_second(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_second(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_second(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_time_zone_offset(&self) -> f32 {
|
||||
unsafe { gst_sys::gst_date_time_get_time_zone_offset(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_time_zone_offset(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_year(&self) -> i32 {
|
||||
unsafe { gst_sys::gst_date_time_get_year(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_date_time_get_year(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn has_day(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_date_time_has_day(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_date_time_has_day(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn has_month(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_date_time_has_month(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_date_time_has_month(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn has_second(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_date_time_has_second(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_date_time_has_second(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn has_time(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_date_time_has_time(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_date_time_has_time(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn has_year(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_date_time_has_year(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_date_time_has_year(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn to_g_date_time(&self) -> Result<glib::DateTime, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_to_g_date_time(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Can't create glib::DateTime from DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_to_g_date_time(self.to_glib_none().0))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Can't create glib::DateTime from DateTime"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_iso8601_string(&self) -> Result<GString, glib::BoolError> {
|
||||
pub fn to_iso8601_string(&self) -> Result<glib::GString, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_date_time_to_iso8601_string(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create ISO-8601 string from DateTime"))
|
||||
Option::<_>::from_glib_full(ffi::gst_date_time_to_iso8601_string(self.to_glib_none().0))
|
||||
.ok_or_else(|| {
|
||||
glib::glib_bool_error!("Failed to create ISO-8601 string from DateTime")
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,27 +2,23 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Caps;
|
||||
use crate::Element;
|
||||
use crate::Object;
|
||||
use crate::Structure;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Caps;
|
||||
use Element;
|
||||
use Object;
|
||||
use Structure;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Device(Object<gst_sys::GstDevice, gst_sys::GstDeviceClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Device(Object<ffi::GstDevice, ffi::GstDeviceClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_device_get_type(),
|
||||
get_type => || ffi::gst_device_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -36,9 +32,9 @@ pub trait DeviceExt: 'static {
|
|||
|
||||
fn get_caps(&self) -> Option<Caps>;
|
||||
|
||||
fn get_device_class(&self) -> GString;
|
||||
fn get_device_class(&self) -> glib::GString;
|
||||
|
||||
fn get_display_name(&self) -> GString;
|
||||
fn get_display_name(&self) -> glib::GString;
|
||||
|
||||
fn get_properties(&self) -> Option<Structure>;
|
||||
|
||||
|
@ -57,29 +53,29 @@ pub trait DeviceExt: 'static {
|
|||
impl<O: IsA<Device>> DeviceExt for O {
|
||||
fn create_element(&self, name: Option<&str>) -> Result<Element, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_device_create_element(
|
||||
Option::<_>::from_glib_none(ffi::gst_device_create_element(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create element for device"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create element for device"))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_caps(&self) -> Option<Caps> {
|
||||
unsafe { from_glib_full(gst_sys::gst_device_get_caps(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_device_get_caps(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_device_class(&self) -> GString {
|
||||
fn get_device_class(&self) -> glib::GString {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_get_device_class(
|
||||
from_glib_full(ffi::gst_device_get_device_class(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_display_name(&self) -> GString {
|
||||
fn get_display_name(&self) -> glib::GString {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_get_display_name(
|
||||
from_glib_full(ffi::gst_device_get_display_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -87,7 +83,7 @@ impl<O: IsA<Device>> DeviceExt for O {
|
|||
|
||||
fn get_properties(&self) -> Option<Structure> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_get_properties(
|
||||
from_glib_full(ffi::gst_device_get_properties(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -95,7 +91,7 @@ impl<O: IsA<Device>> DeviceExt for O {
|
|||
|
||||
fn has_classes(&self, classes: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_has_classes(
|
||||
from_glib(ffi::gst_device_has_classes(
|
||||
self.as_ref().to_glib_none().0,
|
||||
classes.to_glib_none().0,
|
||||
))
|
||||
|
@ -104,7 +100,7 @@ impl<O: IsA<Device>> DeviceExt for O {
|
|||
|
||||
fn has_classesv(&self, classes: &[&str]) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_has_classesv(
|
||||
from_glib(ffi::gst_device_has_classesv(
|
||||
self.as_ref().to_glib_none().0,
|
||||
classes.to_glib_none().0,
|
||||
))
|
||||
|
@ -116,8 +112,8 @@ impl<O: IsA<Device>> DeviceExt for O {
|
|||
element: &P,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_device_reconfigure_element(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_device_reconfigure_element(
|
||||
self.as_ref().to_glib_none().0,
|
||||
element.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -128,8 +124,8 @@ impl<O: IsA<Device>> DeviceExt for O {
|
|||
|
||||
fn connect_removed<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn removed_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstDevice,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDevice,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Device>,
|
||||
{
|
||||
|
|
|
@ -2,29 +2,24 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Bus;
|
||||
use crate::Device;
|
||||
use crate::Object;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Bus;
|
||||
use Device;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DeviceMonitor(Object<gst_sys::GstDeviceMonitor, gst_sys::GstDeviceMonitorClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DeviceMonitor(Object<ffi::GstDeviceMonitor, ffi::GstDeviceMonitorClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_device_monitor_get_type(),
|
||||
get_type => || ffi::gst_device_monitor_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -38,7 +33,7 @@ pub trait DeviceMonitorExt: 'static {
|
|||
|
||||
fn get_devices(&self) -> Vec<Device>;
|
||||
|
||||
fn get_providers(&self) -> Vec<GString>;
|
||||
fn get_providers(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn get_show_all_devices(&self) -> bool;
|
||||
|
||||
|
@ -61,7 +56,7 @@ pub trait DeviceMonitorExt: 'static {
|
|||
impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
||||
fn get_bus(&self) -> Bus {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_monitor_get_bus(
|
||||
from_glib_full(ffi::gst_device_monitor_get_bus(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -69,15 +64,15 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn get_devices(&self) -> Vec<Device> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_device_monitor_get_devices(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_device_monitor_get_devices(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_providers(&self) -> Vec<GString> {
|
||||
fn get_providers(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_device_monitor_get_providers(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_device_monitor_get_providers(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -85,7 +80,7 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn get_show_all_devices(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_monitor_get_show_all_devices(
|
||||
from_glib(ffi::gst_device_monitor_get_show_all_devices(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -93,7 +88,7 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn set_show_all_devices(&self, show_all: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_monitor_set_show_all_devices(
|
||||
ffi::gst_device_monitor_set_show_all_devices(
|
||||
self.as_ref().to_glib_none().0,
|
||||
show_all.to_glib(),
|
||||
);
|
||||
|
@ -102,8 +97,8 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn start(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_device_monitor_start(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_device_monitor_start(self.as_ref().to_glib_none().0),
|
||||
"Failed to start"
|
||||
)
|
||||
}
|
||||
|
@ -111,15 +106,15 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn stop(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_monitor_stop(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_device_monitor_stop(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_show_all(&self) -> bool {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<bool as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"show-all\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -132,8 +127,8 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
|
||||
fn set_property_show_all(&self, show_all: bool) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"show-all\0".as_ptr() as *const _,
|
||||
Value::from(&show_all).to_glib_none().0,
|
||||
);
|
||||
|
@ -145,9 +140,9 @@ impl<O: IsA<DeviceMonitor>> DeviceMonitorExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_show_all_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstDeviceMonitor,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstDeviceMonitor,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<DeviceMonitor>,
|
||||
{
|
||||
|
|
|
@ -2,28 +2,23 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Bus;
|
||||
use crate::Device;
|
||||
use crate::DeviceProviderFactory;
|
||||
use crate::Object;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use libc;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Bus;
|
||||
use Device;
|
||||
use DeviceProviderFactory;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DeviceProvider(Object<gst_sys::GstDeviceProvider, gst_sys::GstDeviceProviderClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DeviceProvider(Object<ffi::GstDeviceProvider, ffi::GstDeviceProviderClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_device_provider_get_type(),
|
||||
get_type => || ffi::gst_device_provider_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -49,7 +44,7 @@ pub trait DeviceProviderExt: 'static {
|
|||
|
||||
fn get_factory(&self) -> Option<DeviceProviderFactory>;
|
||||
|
||||
fn get_hidden_providers(&self) -> Vec<GString>;
|
||||
fn get_hidden_providers(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn hide_provider(&self, name: &str);
|
||||
|
||||
|
@ -73,7 +68,7 @@ pub trait DeviceProviderExt: 'static {
|
|||
impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
||||
fn can_monitor(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_provider_can_monitor(
|
||||
from_glib(ffi::gst_device_provider_can_monitor(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -81,7 +76,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn device_add<P: IsA<Device>>(&self, device: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_device_add(
|
||||
ffi::gst_device_provider_device_add(
|
||||
self.as_ref().to_glib_none().0,
|
||||
device.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -92,7 +87,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))]
|
||||
fn device_changed<P: IsA<Device>, Q: IsA<Device>>(&self, device: &P, changed_device: &Q) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_device_changed(
|
||||
ffi::gst_device_provider_device_changed(
|
||||
self.as_ref().to_glib_none().0,
|
||||
device.as_ref().to_glib_none().0,
|
||||
changed_device.as_ref().to_glib_none().0,
|
||||
|
@ -102,7 +97,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn device_remove<P: IsA<Device>>(&self, device: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_device_remove(
|
||||
ffi::gst_device_provider_device_remove(
|
||||
self.as_ref().to_glib_none().0,
|
||||
device.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -111,7 +106,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn get_bus(&self) -> Bus {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_provider_get_bus(
|
||||
from_glib_full(ffi::gst_device_provider_get_bus(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -119,7 +114,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn get_devices(&self) -> Vec<Device> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_device_provider_get_devices(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_device_provider_get_devices(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -127,15 +122,15 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn get_factory(&self) -> Option<DeviceProviderFactory> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_device_provider_get_factory(
|
||||
from_glib_none(ffi::gst_device_provider_get_factory(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_hidden_providers(&self) -> Vec<GString> {
|
||||
fn get_hidden_providers(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_device_provider_get_hidden_providers(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_device_provider_get_hidden_providers(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -143,7 +138,7 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn hide_provider(&self, name: &str) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_hide_provider(
|
||||
ffi::gst_device_provider_hide_provider(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
);
|
||||
|
@ -152,8 +147,8 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn start(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_device_provider_start(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_device_provider_start(self.as_ref().to_glib_none().0),
|
||||
"Failed to start"
|
||||
)
|
||||
}
|
||||
|
@ -161,13 +156,13 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
|
||||
fn stop(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_stop(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_device_provider_stop(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn unhide_provider(&self, name: &str) {
|
||||
unsafe {
|
||||
gst_sys::gst_device_provider_unhide_provider(
|
||||
ffi::gst_device_provider_unhide_provider(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
);
|
||||
|
@ -182,16 +177,16 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
P,
|
||||
F: Fn(&P, &str) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstDeviceProvider,
|
||||
this: *mut ffi::GstDeviceProvider,
|
||||
object: *mut libc::c_char,
|
||||
f: glib_sys::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<DeviceProvider>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
&DeviceProvider::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&GString::from_glib_borrow(object),
|
||||
&glib::GString::from_glib_borrow(object),
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
|
@ -215,16 +210,16 @@ impl<O: IsA<DeviceProvider>> DeviceProviderExt for O {
|
|||
P,
|
||||
F: Fn(&P, &str) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstDeviceProvider,
|
||||
this: *mut ffi::GstDeviceProvider,
|
||||
object: *mut libc::c_char,
|
||||
f: glib_sys::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<DeviceProvider>,
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(
|
||||
&DeviceProvider::from_glib_borrow(this).unsafe_cast_ref(),
|
||||
&GString::from_glib_borrow(object),
|
||||
&glib::GString::from_glib_borrow(object),
|
||||
)
|
||||
}
|
||||
unsafe {
|
||||
|
|
|
@ -2,62 +2,53 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::DeviceProvider;
|
||||
use crate::Object;
|
||||
use crate::PluginFeature;
|
||||
use crate::Rank;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use DeviceProvider;
|
||||
use Object;
|
||||
use PluginFeature;
|
||||
use Rank;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct DeviceProviderFactory(Object<gst_sys::GstDeviceProviderFactory, gst_sys::GstDeviceProviderFactoryClass>) @extends PluginFeature, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct DeviceProviderFactory(Object<ffi::GstDeviceProviderFactory, ffi::GstDeviceProviderFactoryClass>) @extends PluginFeature, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_device_provider_factory_get_type(),
|
||||
get_type => || ffi::gst_device_provider_factory_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl DeviceProviderFactory {
|
||||
pub fn get(&self) -> Option<DeviceProvider> {
|
||||
unsafe { from_glib_full(ffi::gst_device_provider_factory_get(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_device_provider_type(&self) -> glib::types::Type {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_provider_factory_get(
|
||||
from_glib(ffi::gst_device_provider_factory_get_device_provider_type(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_device_provider_type(&self) -> glib::types::Type {
|
||||
pub fn get_metadata(&self, key: &str) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib(
|
||||
gst_sys::gst_device_provider_factory_get_device_provider_type(
|
||||
self.to_glib_none().0,
|
||||
),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_metadata(&self, key: &str) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_device_provider_factory_get_metadata(
|
||||
from_glib_none(ffi::gst_device_provider_factory_get_metadata(
|
||||
self.to_glib_none().0,
|
||||
key.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_metadata_keys(&self) -> Vec<GString> {
|
||||
pub fn get_metadata_keys(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_sys::gst_device_provider_factory_get_metadata_keys(self.to_glib_none().0),
|
||||
ffi::gst_device_provider_factory_get_metadata_keys(self.to_glib_none().0),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn has_classes(&self, classes: Option<&str>) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_provider_factory_has_classes(
|
||||
from_glib(ffi::gst_device_provider_factory_has_classes(
|
||||
self.to_glib_none().0,
|
||||
classes.to_glib_none().0,
|
||||
))
|
||||
|
@ -66,7 +57,7 @@ impl DeviceProviderFactory {
|
|||
|
||||
pub fn has_classesv(&self, classes: &[&str]) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_device_provider_factory_has_classesv(
|
||||
from_glib(ffi::gst_device_provider_factory_has_classesv(
|
||||
self.to_glib_none().0,
|
||||
classes.to_glib_none().0,
|
||||
))
|
||||
|
@ -75,17 +66,13 @@ impl DeviceProviderFactory {
|
|||
|
||||
pub fn find(name: &str) -> Option<DeviceProviderFactory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_provider_factory_find(
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_device_provider_factory_find(name.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_by_name(factoryname: &str) -> Option<DeviceProvider> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_device_provider_factory_get_by_name(
|
||||
from_glib_full(ffi::gst_device_provider_factory_get_by_name(
|
||||
factoryname.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -95,7 +82,7 @@ impl DeviceProviderFactory {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(
|
||||
gst_sys::gst_device_provider_factory_list_get_device_providers(minrank.to_glib()),
|
||||
ffi::gst_device_provider_factory_list_get_device_providers(minrank.to_glib()),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,34 +2,31 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Bus;
|
||||
use crate::Caps;
|
||||
use crate::Clock;
|
||||
use crate::ClockTime;
|
||||
use crate::Context;
|
||||
use crate::ElementFactory;
|
||||
use crate::Object;
|
||||
use crate::Pad;
|
||||
use crate::PadLinkCheck;
|
||||
use crate::PadTemplate;
|
||||
use crate::URIType;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
use Bus;
|
||||
use Caps;
|
||||
use Clock;
|
||||
use ClockTime;
|
||||
use Context;
|
||||
use ElementFactory;
|
||||
use Object;
|
||||
use Pad;
|
||||
use PadLinkCheck;
|
||||
use PadTemplate;
|
||||
use URIType;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Element(Object<gst_sys::GstElement, gst_sys::GstElementClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Element(Object<ffi::GstElement, ffi::GstElementClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_element_get_type(),
|
||||
get_type => || ffi::gst_element_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +39,7 @@ impl Element {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_sys::gst_element_make_from_uri(
|
||||
let ret = ffi::gst_element_make_from_uri(
|
||||
type_.to_glib(),
|
||||
uri.to_glib_none().0,
|
||||
elementname.to_glib_none().0,
|
||||
|
@ -203,14 +200,14 @@ pub trait ElementExt: 'static {
|
|||
impl<O: IsA<Element>> ElementExt for O {
|
||||
fn abort_state(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_abort_state(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_element_abort_state(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_add_pad(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_add_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -221,7 +218,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn create_all_pads(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_create_all_pads(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_element_create_all_pads(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -230,10 +227,10 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
fn foreach_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
|
||||
let func_data: P = func;
|
||||
unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(
|
||||
element: *mut gst_sys::GstElement,
|
||||
pad: *mut gst_sys::GstPad,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
element: *mut ffi::GstElement,
|
||||
pad: *mut ffi::GstPad,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let element = from_glib_borrow(element);
|
||||
let pad = from_glib_borrow(pad);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
|
@ -243,7 +240,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
let func = Some(func_func::<P> as _);
|
||||
let super_callback0: &P = &func_data;
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_foreach_pad(
|
||||
from_glib(ffi::gst_element_foreach_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
func,
|
||||
super_callback0 as *const _ as usize as *mut _,
|
||||
|
@ -256,10 +253,10 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
fn foreach_sink_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
|
||||
let func_data: P = func;
|
||||
unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(
|
||||
element: *mut gst_sys::GstElement,
|
||||
pad: *mut gst_sys::GstPad,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
element: *mut ffi::GstElement,
|
||||
pad: *mut ffi::GstPad,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let element = from_glib_borrow(element);
|
||||
let pad = from_glib_borrow(pad);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
|
@ -269,7 +266,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
let func = Some(func_func::<P> as _);
|
||||
let super_callback0: &P = &func_data;
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_foreach_sink_pad(
|
||||
from_glib(ffi::gst_element_foreach_sink_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
func,
|
||||
super_callback0 as *const _ as usize as *mut _,
|
||||
|
@ -282,10 +279,10 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
fn foreach_src_pad<P: FnMut(&Element, &Pad) -> bool>(&self, func: P) -> bool {
|
||||
let func_data: P = func;
|
||||
unsafe extern "C" fn func_func<P: FnMut(&Element, &Pad) -> bool>(
|
||||
element: *mut gst_sys::GstElement,
|
||||
pad: *mut gst_sys::GstPad,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
element: *mut ffi::GstElement,
|
||||
pad: *mut ffi::GstPad,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let element = from_glib_borrow(element);
|
||||
let pad = from_glib_borrow(pad);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
|
@ -295,7 +292,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
let func = Some(func_func::<P> as _);
|
||||
let super_callback0: &P = &func_data;
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_foreach_src_pad(
|
||||
from_glib(ffi::gst_element_foreach_src_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
func,
|
||||
super_callback0 as *const _ as usize as *mut _,
|
||||
|
@ -305,27 +302,23 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_base_time(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_get_base_time(
|
||||
from_glib(ffi::gst_element_get_base_time(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_bus(&self) -> Option<Bus> {
|
||||
unsafe { from_glib_full(gst_sys::gst_element_get_bus(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_element_get_bus(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_clock(&self) -> Option<Clock> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_get_clock(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_element_get_clock(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_compatible_pad<P: IsA<Pad>>(&self, pad: &P, caps: Option<&Caps>) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_get_compatible_pad(
|
||||
from_glib_full(ffi::gst_element_get_compatible_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
|
@ -335,7 +328,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_element_get_compatible_pad_template(
|
||||
from_glib_none(ffi::gst_element_get_compatible_pad_template(
|
||||
self.as_ref().to_glib_none().0,
|
||||
compattempl.to_glib_none().0,
|
||||
))
|
||||
|
@ -344,7 +337,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_context(&self, context_type: &str) -> Option<Context> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_get_context(
|
||||
from_glib_full(ffi::gst_element_get_context(
|
||||
self.as_ref().to_glib_none().0,
|
||||
context_type.to_glib_none().0,
|
||||
))
|
||||
|
@ -353,23 +346,19 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_contexts(&self) -> Vec<Context> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_get_contexts(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_element_get_contexts(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_factory(&self) -> Option<ElementFactory> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_element_get_factory(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_none(ffi::gst_element_get_factory(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_request_pad(&self, name: &str) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_get_request_pad(
|
||||
from_glib_full(ffi::gst_element_get_request_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -378,7 +367,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_start_time(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_get_start_time(
|
||||
from_glib(ffi::gst_element_get_start_time(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -386,7 +375,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn get_static_pad(&self, name: &str) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_get_static_pad(
|
||||
from_glib_full(ffi::gst_element_get_static_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -395,28 +384,28 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn is_locked_state(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_is_locked_state(
|
||||
from_glib(ffi::gst_element_is_locked_state(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
//fn iterate_pads(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_element_iterate_pads() }
|
||||
// unsafe { TODO: call ffi:gst_element_iterate_pads() }
|
||||
//}
|
||||
|
||||
//fn iterate_sink_pads(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_element_iterate_sink_pads() }
|
||||
// unsafe { TODO: call ffi:gst_element_iterate_sink_pads() }
|
||||
//}
|
||||
|
||||
//fn iterate_src_pads(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_element_iterate_src_pads() }
|
||||
// unsafe { TODO: call ffi:gst_element_iterate_src_pads() }
|
||||
//}
|
||||
|
||||
fn link<P: IsA<Element>>(&self, dest: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_link(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_link(
|
||||
self.as_ref().to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -431,8 +420,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
filter: Option<&Caps>,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_link_filtered(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_link_filtered(
|
||||
self.as_ref().to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
filter.to_glib_none().0
|
||||
|
@ -443,7 +432,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
}
|
||||
|
||||
//fn link_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_element_link_many() }
|
||||
// unsafe { TODO: call ffi:gst_element_link_many() }
|
||||
//}
|
||||
|
||||
fn link_pads<P: IsA<Element>>(
|
||||
|
@ -453,8 +442,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
destpadname: Option<&str>,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_link_pads(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_link_pads(
|
||||
self.as_ref().to_glib_none().0,
|
||||
srcpadname.to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
|
@ -473,8 +462,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
filter: Option<&Caps>,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_link_pads_filtered(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_link_pads_filtered(
|
||||
self.as_ref().to_glib_none().0,
|
||||
srcpadname.to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
|
@ -494,8 +483,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
flags: PadLinkCheck,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_link_pads_full(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_link_pads_full(
|
||||
self.as_ref().to_glib_none().0,
|
||||
srcpadname.to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
|
@ -509,29 +498,29 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn lost_state(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_lost_state(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_element_lost_state(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//fn message_full(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: Option<&str>, debug: Option<&str>, file: &str, function: &str, line: i32) {
|
||||
// unsafe { TODO: call gst_sys:gst_element_message_full() }
|
||||
// unsafe { TODO: call ffi:gst_element_message_full() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
//fn message_full_with_details(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: Option<&str>, debug: Option<&str>, file: &str, function: &str, line: i32, structure: &mut Structure) {
|
||||
// unsafe { TODO: call gst_sys:gst_element_message_full_with_details() }
|
||||
// unsafe { TODO: call ffi:gst_element_message_full_with_details() }
|
||||
//}
|
||||
|
||||
fn no_more_pads(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_no_more_pads(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_element_no_more_pads(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn provide_clock(&self) -> Option<Clock> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_provide_clock(
|
||||
from_glib_full(ffi::gst_element_provide_clock(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -539,7 +528,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn release_request_pad<P: IsA<Pad>>(&self, pad: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_release_request_pad(
|
||||
ffi::gst_element_release_request_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -548,8 +537,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn remove_pad<P: IsA<Pad>>(&self, pad: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_remove_pad(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_remove_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -565,7 +554,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
caps: Option<&Caps>,
|
||||
) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_element_request_pad(
|
||||
from_glib_full(ffi::gst_element_request_pad(
|
||||
self.as_ref().to_glib_none().0,
|
||||
templ.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
|
@ -576,20 +565,20 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn set_base_time(&self, time: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_set_base_time(self.as_ref().to_glib_none().0, time.to_glib());
|
||||
ffi::gst_element_set_base_time(self.as_ref().to_glib_none().0, time.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_bus(&self, bus: Option<&Bus>) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_set_bus(self.as_ref().to_glib_none().0, bus.to_glib_none().0);
|
||||
ffi::gst_element_set_bus(self.as_ref().to_glib_none().0, bus.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_clock<P: IsA<Clock>>(&self, clock: Option<&P>) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_set_clock(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_set_clock(
|
||||
self.as_ref().to_glib_none().0,
|
||||
clock.map(|p| p.as_ref()).to_glib_none().0
|
||||
),
|
||||
|
@ -600,16 +589,13 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn set_context(&self, context: &Context) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_set_context(
|
||||
self.as_ref().to_glib_none().0,
|
||||
context.to_glib_none().0,
|
||||
);
|
||||
ffi::gst_element_set_context(self.as_ref().to_glib_none().0, context.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_locked_state(&self, locked_state: bool) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_set_locked_state(
|
||||
from_glib(ffi::gst_element_set_locked_state(
|
||||
self.as_ref().to_glib_none().0,
|
||||
locked_state.to_glib(),
|
||||
))
|
||||
|
@ -618,14 +604,14 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn set_start_time(&self, time: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_set_start_time(self.as_ref().to_glib_none().0, time.to_glib());
|
||||
ffi::gst_element_set_start_time(self.as_ref().to_glib_none().0, time.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn sync_state_with_parent(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_element_sync_state_with_parent(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_element_sync_state_with_parent(self.as_ref().to_glib_none().0),
|
||||
"Failed to sync state with parent"
|
||||
)
|
||||
}
|
||||
|
@ -633,7 +619,7 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn unlink<P: IsA<Element>>(&self, dest: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_unlink(
|
||||
ffi::gst_element_unlink(
|
||||
self.as_ref().to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -641,12 +627,12 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
}
|
||||
|
||||
//fn unlink_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_element_unlink_many() }
|
||||
// unsafe { TODO: call ffi:gst_element_unlink_many() }
|
||||
//}
|
||||
|
||||
fn unlink_pads<P: IsA<Element>>(&self, srcpadname: &str, dest: &P, destpadname: &str) {
|
||||
unsafe {
|
||||
gst_sys::gst_element_unlink_pads(
|
||||
ffi::gst_element_unlink_pads(
|
||||
self.as_ref().to_glib_none().0,
|
||||
srcpadname.to_glib_none().0,
|
||||
dest.as_ref().to_glib_none().0,
|
||||
|
@ -657,8 +643,8 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
|
||||
fn connect_no_more_pads<F: Fn(&Self) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn no_more_pads_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstElement,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstElement,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Element>,
|
||||
{
|
||||
|
@ -683,9 +669,9 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn pad_added_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstElement,
|
||||
new_pad: *mut gst_sys::GstPad,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstElement,
|
||||
new_pad: *mut ffi::GstPad,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Element>,
|
||||
{
|
||||
|
@ -713,9 +699,9 @@ impl<O: IsA<Element>> ElementExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn pad_removed_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstElement,
|
||||
old_pad: *mut gst_sys::GstPad,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstElement,
|
||||
old_pad: *mut ffi::GstPad,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Element>,
|
||||
{
|
||||
|
|
|
@ -2,32 +2,29 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Caps;
|
||||
use crate::Element;
|
||||
use crate::ElementFactoryListType;
|
||||
use crate::Object;
|
||||
use crate::PadDirection;
|
||||
use crate::PluginFeature;
|
||||
use crate::Rank;
|
||||
use crate::StaticPadTemplate;
|
||||
use crate::URIType;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use Caps;
|
||||
use Element;
|
||||
use ElementFactoryListType;
|
||||
use Object;
|
||||
use PadDirection;
|
||||
use PluginFeature;
|
||||
use Rank;
|
||||
use StaticPadTemplate;
|
||||
use URIType;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ElementFactory(Object<gst_sys::GstElementFactory, gst_sys::GstElementFactoryClass>) @extends PluginFeature, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct ElementFactory(Object<ffi::GstElementFactory, ffi::GstElementFactoryClass>) @extends PluginFeature, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_element_factory_get_type(),
|
||||
get_type => || ffi::gst_element_factory_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl ElementFactory {
|
||||
pub fn can_sink_all_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_can_sink_all_caps(
|
||||
from_glib(ffi::gst_element_factory_can_sink_all_caps(
|
||||
self.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -36,7 +33,7 @@ impl ElementFactory {
|
|||
|
||||
pub fn can_sink_any_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_can_sink_any_caps(
|
||||
from_glib(ffi::gst_element_factory_can_sink_any_caps(
|
||||
self.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -45,7 +42,7 @@ impl ElementFactory {
|
|||
|
||||
pub fn can_src_all_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_can_src_all_caps(
|
||||
from_glib(ffi::gst_element_factory_can_src_all_caps(
|
||||
self.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -54,7 +51,7 @@ impl ElementFactory {
|
|||
|
||||
pub fn can_src_any_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_can_src_any_caps(
|
||||
from_glib(ffi::gst_element_factory_can_src_any_caps(
|
||||
self.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -63,70 +60,66 @@ impl ElementFactory {
|
|||
|
||||
pub fn create(&self, name: Option<&str>) -> Result<Element, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_element_factory_create(
|
||||
Option::<_>::from_glib_none(ffi::gst_element_factory_create(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create element from factory"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create element from factory"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_element_type(&self) -> glib::types::Type {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_get_element_type(
|
||||
from_glib(ffi::gst_element_factory_get_element_type(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_metadata(&self, key: &str) -> Option<GString> {
|
||||
pub fn get_metadata(&self, key: &str) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_element_factory_get_metadata(
|
||||
from_glib_none(ffi::gst_element_factory_get_metadata(
|
||||
self.to_glib_none().0,
|
||||
key.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_metadata_keys(&self) -> Vec<GString> {
|
||||
pub fn get_metadata_keys(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_get_metadata_keys(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_get_metadata_keys(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_num_pad_templates(&self) -> u32 {
|
||||
unsafe { gst_sys::gst_element_factory_get_num_pad_templates(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_element_factory_get_num_pad_templates(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_static_pad_templates(&self) -> Vec<StaticPadTemplate> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(
|
||||
gst_sys::gst_element_factory_get_static_pad_templates(self.to_glib_none().0),
|
||||
)
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_static_pad_templates(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_uri_protocols(&self) -> Vec<GString> {
|
||||
pub fn get_uri_protocols(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(gst_sys::gst_element_factory_get_uri_protocols(
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_uri_protocols(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_uri_type(&self) -> URIType {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_get_uri_type(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_element_factory_get_uri_type(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn has_interface(&self, interfacename: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_has_interface(
|
||||
from_glib(ffi::gst_element_factory_has_interface(
|
||||
self.to_glib_none().0,
|
||||
interfacename.to_glib_none().0,
|
||||
))
|
||||
|
@ -135,7 +128,7 @@ impl ElementFactory {
|
|||
|
||||
pub fn list_is_type(&self, type_: ElementFactoryListType) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_element_factory_list_is_type(
|
||||
from_glib(ffi::gst_element_factory_list_is_type(
|
||||
self.to_glib_none().0,
|
||||
type_,
|
||||
))
|
||||
|
@ -144,7 +137,7 @@ impl ElementFactory {
|
|||
|
||||
pub fn find(name: &str) -> Option<ElementFactory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_element_factory_find(name.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_element_factory_find(name.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn list_filter(
|
||||
|
@ -155,7 +148,7 @@ impl ElementFactory {
|
|||
) -> Vec<ElementFactory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_list_filter(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_list_filter(
|
||||
list.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
direction.to_glib(),
|
||||
|
@ -167,7 +160,7 @@ impl ElementFactory {
|
|||
pub fn list_get_elements(type_: ElementFactoryListType, minrank: Rank) -> Vec<ElementFactory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_list_get_elements(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_list_get_elements(
|
||||
type_,
|
||||
minrank.to_glib(),
|
||||
))
|
||||
|
@ -177,11 +170,11 @@ impl ElementFactory {
|
|||
pub fn make(factoryname: &str, name: Option<&str>) -> Result<Element, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_element_factory_make(
|
||||
Option::<_>::from_glib_none(ffi::gst_element_factory_make(
|
||||
factoryname.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create element from factory name"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create element from factory name"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -2,39 +2,35 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use std;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use Bin;
|
||||
use ClockTime;
|
||||
use DebugGraphDetails;
|
||||
use DebugLevel;
|
||||
use Element;
|
||||
use crate::Bin;
|
||||
use crate::ClockTime;
|
||||
use crate::DebugGraphDetails;
|
||||
use crate::DebugLevel;
|
||||
use crate::Element;
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
use PluginAPIFlags;
|
||||
use crate::PluginAPIFlags;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
use StackTraceFlags;
|
||||
use crate::StackTraceFlags;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn debug_add_ring_buffer_logger(max_size_per_thread: u32, thread_timeout: u32) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_add_ring_buffer_logger(max_size_per_thread, thread_timeout);
|
||||
ffi::gst_debug_add_ring_buffer_logger(max_size_per_thread, thread_timeout);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_bin_to_dot_data<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails) -> GString {
|
||||
pub fn debug_bin_to_dot_data<P: IsA<Bin>>(bin: &P, details: DebugGraphDetails) -> glib::GString {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_debug_bin_to_dot_data(
|
||||
from_glib_full(ffi::gst_debug_bin_to_dot_data(
|
||||
bin.as_ref().to_glib_none().0,
|
||||
details.to_glib(),
|
||||
))
|
||||
|
@ -48,7 +44,7 @@ pub fn debug_bin_to_dot_file<P: IsA<Bin>, Q: AsRef<std::path::Path>>(
|
|||
) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_bin_to_dot_file(
|
||||
ffi::gst_debug_bin_to_dot_file(
|
||||
bin.as_ref().to_glib_none().0,
|
||||
details.to_glib(),
|
||||
file_name.as_ref().to_glib_none().0,
|
||||
|
@ -63,7 +59,7 @@ pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>, Q: AsRef<std::path::Path>>(
|
|||
) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_bin_to_dot_file_with_ts(
|
||||
ffi::gst_debug_bin_to_dot_file_with_ts(
|
||||
bin.as_ref().to_glib_none().0,
|
||||
details.to_glib(),
|
||||
file_name.as_ref().to_glib_none().0,
|
||||
|
@ -73,33 +69,33 @@ pub fn debug_bin_to_dot_file_with_ts<P: IsA<Bin>, Q: AsRef<std::path::Path>>(
|
|||
|
||||
pub fn debug_get_default_threshold() -> DebugLevel {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib(gst_sys::gst_debug_get_default_threshold()) }
|
||||
unsafe { from_glib(ffi::gst_debug_get_default_threshold()) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
pub fn debug_get_stack_trace(flags: StackTraceFlags) -> Result<GString, glib::BoolError> {
|
||||
pub fn debug_get_stack_trace(flags: StackTraceFlags) -> Result<glib::GString, glib::BoolError> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_debug_get_stack_trace(flags.to_glib()))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to get stack trace"))
|
||||
Option::<_>::from_glib_full(ffi::gst_debug_get_stack_trace(flags.to_glib()))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to get stack trace"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_is_active() -> bool {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib(gst_sys::gst_debug_is_active()) }
|
||||
unsafe { from_glib(ffi::gst_debug_is_active()) }
|
||||
}
|
||||
|
||||
pub fn debug_is_colored() -> bool {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib(gst_sys::gst_debug_is_colored()) }
|
||||
unsafe { from_glib(ffi::gst_debug_is_colored()) }
|
||||
}
|
||||
|
||||
pub fn debug_print_stack_trace() {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_print_stack_trace();
|
||||
ffi::gst_debug_print_stack_trace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,68 +104,66 @@ pub fn debug_print_stack_trace() {
|
|||
pub fn debug_remove_ring_buffer_logger() {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_remove_ring_buffer_logger();
|
||||
ffi::gst_debug_remove_ring_buffer_logger();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn debug_ring_buffer_logger_get_logs() -> Vec<GString> {
|
||||
pub fn debug_ring_buffer_logger_get_logs() -> Vec<glib::GString> {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_debug_ring_buffer_logger_get_logs())
|
||||
}
|
||||
unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_debug_ring_buffer_logger_get_logs()) }
|
||||
}
|
||||
|
||||
pub fn debug_set_active(active: bool) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_set_active(active.to_glib());
|
||||
ffi::gst_debug_set_active(active.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_set_colored(colored: bool) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_set_colored(colored.to_glib());
|
||||
ffi::gst_debug_set_colored(colored.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_set_default_threshold(level: DebugLevel) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_set_default_threshold(level.to_glib());
|
||||
ffi::gst_debug_set_default_threshold(level.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_set_threshold_for_name(name: &str, level: DebugLevel) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_set_threshold_for_name(name.to_glib_none().0, level.to_glib());
|
||||
ffi::gst_debug_set_threshold_for_name(name.to_glib_none().0, level.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_set_threshold_from_string(list: &str, reset: bool) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_set_threshold_from_string(list.to_glib_none().0, reset.to_glib());
|
||||
ffi::gst_debug_set_threshold_from_string(list.to_glib_none().0, reset.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn debug_unset_threshold_for_name(name: &str) {
|
||||
skip_assert_initialized!();
|
||||
unsafe {
|
||||
gst_sys::gst_debug_unset_threshold_for_name(name.to_glib_none().0);
|
||||
ffi::gst_debug_unset_threshold_for_name(name.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_14", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_14")))]
|
||||
pub fn get_main_executable_path() -> Result<GString, glib::BoolError> {
|
||||
pub fn get_main_executable_path() -> Result<glib::GString, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_get_main_executable_path())
|
||||
.ok_or_else(|| glib_bool_error!("Failed to get main executable path"))
|
||||
Option::<_>::from_glib_none(ffi::gst_get_main_executable_path())
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to get main executable path"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -180,7 +174,7 @@ pub fn parse_bin_from_description(
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_sys::gst_parse_bin_from_description(
|
||||
let ret = ffi::gst_parse_bin_from_description(
|
||||
bin_description.to_glib_none().0,
|
||||
ghost_unlinked_pads.to_glib(),
|
||||
&mut error,
|
||||
|
@ -197,7 +191,7 @@ pub fn parse_launch(pipeline_description: &str) -> Result<Element, glib::Error>
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_sys::gst_parse_launch(pipeline_description.to_glib_none().0, &mut error);
|
||||
let ret = ffi::gst_parse_launch(pipeline_description.to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_none(ret))
|
||||
} else {
|
||||
|
@ -210,7 +204,7 @@ pub fn parse_launchv(argv: &[&str]) -> Result<Element, glib::Error> {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_sys::gst_parse_launchv(argv.to_glib_none().0, &mut error);
|
||||
let ret = ffi::gst_parse_launchv(argv.to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_none(ret))
|
||||
} else {
|
||||
|
@ -222,11 +216,11 @@ pub fn parse_launchv(argv: &[&str]) -> Result<Element, glib::Error> {
|
|||
//#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
//pub fn tracing_get_active_tracers() -> /*Ignored*/Vec<Tracer> {
|
||||
// unsafe { TODO: call gst_sys:gst_tracing_get_active_tracers() }
|
||||
// unsafe { TODO: call ffi:gst_tracing_get_active_tracers() }
|
||||
//}
|
||||
|
||||
//pub fn tracing_register_hook<P: FnOnce() + Send + Sync + 'static>(tracer: /*Ignored*/&Tracer, detail: &str, func: P) {
|
||||
// unsafe { TODO: call gst_sys:gst_tracing_register_hook() }
|
||||
// unsafe { TODO: call ffi:gst_tracing_register_hook() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
|
@ -234,15 +228,15 @@ pub fn parse_launchv(argv: &[&str]) -> Result<Element, glib::Error> {
|
|||
pub fn type_mark_as_plugin_api(type_: glib::types::Type, flags: PluginAPIFlags) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
gst_sys::gst_type_mark_as_plugin_api(type_.to_glib(), flags.to_glib());
|
||||
ffi::gst_type_mark_as_plugin_api(type_.to_glib(), flags.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn update_registry() -> Result<(), glib::error::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_update_registry(),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_update_registry(),
|
||||
"Failed to update the registry"
|
||||
)
|
||||
}
|
||||
|
@ -250,7 +244,7 @@ pub fn update_registry() -> Result<(), glib::error::BoolError> {
|
|||
|
||||
pub fn util_get_timestamp() -> ClockTime {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib(gst_sys::gst_util_get_timestamp()) }
|
||||
unsafe { from_glib(ffi::gst_util_get_timestamp()) }
|
||||
}
|
||||
|
||||
pub fn version() -> (u32, u32, u32, u32) {
|
||||
|
@ -260,7 +254,7 @@ pub fn version() -> (u32, u32, u32, u32) {
|
|||
let mut minor = mem::MaybeUninit::uninit();
|
||||
let mut micro = mem::MaybeUninit::uninit();
|
||||
let mut nano = mem::MaybeUninit::uninit();
|
||||
gst_sys::gst_version(
|
||||
ffi::gst_version(
|
||||
major.as_mut_ptr(),
|
||||
minor.as_mut_ptr(),
|
||||
micro.as_mut_ptr(),
|
||||
|
@ -274,7 +268,7 @@ pub fn version() -> (u32, u32, u32, u32) {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn version_string() -> GString {
|
||||
pub fn version_string() -> glib::GString {
|
||||
skip_assert_initialized!();
|
||||
unsafe { from_glib_full(gst_sys::gst_version_string()) }
|
||||
unsafe { from_glib_full(ffi::gst_version_string()) }
|
||||
}
|
||||
|
|
|
@ -2,19 +2,17 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Object;
|
||||
use crate::Pad;
|
||||
use crate::ProxyPad;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
use Pad;
|
||||
use ProxyPad;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct GhostPad(Object<gst_sys::GstGhostPad, gst_sys::GstGhostPadClass>) @extends ProxyPad, Pad, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct GhostPad(Object<ffi::GstGhostPad, ffi::GstGhostPadClass>) @extends ProxyPad, Pad, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_ghost_pad_get_type(),
|
||||
get_type => || ffi::gst_ghost_pad_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,7 +30,7 @@ pub trait GhostPadExt: 'static {
|
|||
impl<O: IsA<GhostPad>> GhostPadExt for O {
|
||||
fn get_target(&self) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_ghost_pad_get_target(
|
||||
from_glib_full(ffi::gst_ghost_pad_get_target(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -40,8 +38,8 @@ impl<O: IsA<GhostPad>> GhostPadExt for O {
|
|||
|
||||
fn set_target<P: IsA<Pad>>(&self, newtarget: Option<&P>) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_ghost_pad_set_target(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_ghost_pad_set_target(
|
||||
self.as_ref().to_glib_none().0,
|
||||
newtarget.map(|p| p.as_ref()).to_glib_none().0
|
||||
),
|
||||
|
|
|
@ -2,25 +2,21 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::ClockTime;
|
||||
use crate::ControlBinding;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use ClockTime;
|
||||
use ControlBinding;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Object(Object<gst_sys::GstObject, gst_sys::GstObjectClass>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct Object(Object<ffi::GstObject, ffi::GstObjectClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_object_get_type(),
|
||||
get_type => || ffi::gst_object_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +24,7 @@ impl Object {
|
|||
pub fn check_uniqueness(list: &[Object], name: &str) -> bool {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_check_uniqueness(
|
||||
from_glib(ffi::gst_object_check_uniqueness(
|
||||
list.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -36,15 +32,15 @@ impl Object {
|
|||
}
|
||||
|
||||
//pub fn default_deep_notify<P: IsA<glib::Object>, Q: IsA<Object>>(object: &P, orig: &Q, pspec: /*Ignored*/&glib::ParamSpec, excluded_props: &[&str]) {
|
||||
// unsafe { TODO: call gst_sys:gst_object_default_deep_notify() }
|
||||
// unsafe { TODO: call ffi:gst_object_default_deep_notify() }
|
||||
//}
|
||||
|
||||
//pub fn ref_sink(object: /*Unimplemented*/Option<Fundamental: Pointer>) -> /*Unimplemented*/Option<Fundamental: Pointer> {
|
||||
// unsafe { TODO: call gst_sys:gst_object_ref_sink() }
|
||||
// unsafe { TODO: call ffi:gst_object_ref_sink() }
|
||||
//}
|
||||
|
||||
//pub fn replace<P: IsA<Object>, Q: IsA<Object>>(oldobj: Option<&P>, newobj: Option<&Q>) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_object_replace() }
|
||||
// unsafe { TODO: call ffi:gst_object_replace() }
|
||||
//}
|
||||
}
|
||||
|
||||
|
@ -65,11 +61,11 @@ pub trait GstObjectExt: 'static {
|
|||
|
||||
fn get_control_rate(&self) -> ClockTime;
|
||||
|
||||
fn get_name(&self) -> GString;
|
||||
fn get_name(&self) -> glib::GString;
|
||||
|
||||
fn get_parent(&self) -> Option<Object>;
|
||||
|
||||
fn get_path_string(&self) -> GString;
|
||||
fn get_path_string(&self) -> glib::GString;
|
||||
|
||||
fn get_value(&self, property_name: &str, timestamp: ClockTime) -> Option<glib::Value>;
|
||||
|
||||
|
@ -113,8 +109,8 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
binding: &P,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_object_add_control_binding(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_object_add_control_binding(
|
||||
self.as_ref().to_glib_none().0,
|
||||
binding.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -125,7 +121,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn default_error(&self, error: &glib::Error, debug: Option<&str>) {
|
||||
unsafe {
|
||||
gst_sys::gst_object_default_error(
|
||||
ffi::gst_object_default_error(
|
||||
self.as_ref().to_glib_none().0,
|
||||
error.to_glib_none().0,
|
||||
debug.to_glib_none().0,
|
||||
|
@ -135,7 +131,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn get_control_binding(&self, property_name: &str) -> Option<ControlBinding> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_object_get_control_binding(
|
||||
from_glib_full(ffi::gst_object_get_control_binding(
|
||||
self.as_ref().to_glib_none().0,
|
||||
property_name.to_glib_none().0,
|
||||
))
|
||||
|
@ -144,27 +140,23 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn get_control_rate(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_get_control_rate(
|
||||
from_glib(ffi::gst_object_get_control_rate(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_name(&self) -> GString {
|
||||
unsafe { from_glib_full(gst_sys::gst_object_get_name(self.as_ref().to_glib_none().0)) }
|
||||
fn get_name(&self) -> glib::GString {
|
||||
unsafe { from_glib_full(ffi::gst_object_get_name(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_parent(&self) -> Option<Object> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_object_get_parent(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_object_get_parent(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_path_string(&self) -> GString {
|
||||
fn get_path_string(&self) -> glib::GString {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_object_get_path_string(
|
||||
from_glib_full(ffi::gst_object_get_path_string(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -172,7 +164,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn get_value(&self, property_name: &str, timestamp: ClockTime) -> Option<glib::Value> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_object_get_value(
|
||||
from_glib_full(ffi::gst_object_get_value(
|
||||
self.as_ref().to_glib_none().0,
|
||||
property_name.to_glib_none().0,
|
||||
timestamp.to_glib(),
|
||||
|
@ -181,12 +173,12 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
}
|
||||
|
||||
//fn get_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Unimplemented*/Option<Fundamental: Pointer>) -> bool {
|
||||
// unsafe { TODO: call gst_sys:gst_object_get_value_array() }
|
||||
// unsafe { TODO: call ffi:gst_object_get_value_array() }
|
||||
//}
|
||||
|
||||
fn has_active_control_bindings(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_has_active_control_bindings(
|
||||
from_glib(ffi::gst_object_has_active_control_bindings(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -194,7 +186,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn has_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_has_ancestor(
|
||||
from_glib(ffi::gst_object_has_ancestor(
|
||||
self.as_ref().to_glib_none().0,
|
||||
ancestor.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -203,7 +195,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn has_as_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_has_as_ancestor(
|
||||
from_glib(ffi::gst_object_has_as_ancestor(
|
||||
self.as_ref().to_glib_none().0,
|
||||
ancestor.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -212,7 +204,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_has_as_parent(
|
||||
from_glib(ffi::gst_object_has_as_parent(
|
||||
self.as_ref().to_glib_none().0,
|
||||
parent.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -221,7 +213,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn remove_control_binding<P: IsA<ControlBinding>>(&self, binding: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_remove_control_binding(
|
||||
from_glib(ffi::gst_object_remove_control_binding(
|
||||
self.as_ref().to_glib_none().0,
|
||||
binding.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -230,7 +222,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_object_set_control_binding_disabled(
|
||||
ffi::gst_object_set_control_binding_disabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
property_name.to_glib_none().0,
|
||||
disabled.to_glib(),
|
||||
|
@ -240,7 +232,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn set_control_bindings_disabled(&self, disabled: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_object_set_control_bindings_disabled(
|
||||
ffi::gst_object_set_control_bindings_disabled(
|
||||
self.as_ref().to_glib_none().0,
|
||||
disabled.to_glib(),
|
||||
);
|
||||
|
@ -249,7 +241,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn set_control_rate(&self, control_rate: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_object_set_control_rate(
|
||||
ffi::gst_object_set_control_rate(
|
||||
self.as_ref().to_glib_none().0,
|
||||
control_rate.to_glib(),
|
||||
);
|
||||
|
@ -258,8 +250,8 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_object_set_parent(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_object_set_parent(
|
||||
self.as_ref().to_glib_none().0,
|
||||
parent.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -270,7 +262,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn suggest_next_sync(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_object_suggest_next_sync(
|
||||
from_glib(ffi::gst_object_suggest_next_sync(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -278,11 +270,8 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn sync_values(&self, timestamp: ClockTime) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_object_sync_values(
|
||||
self.as_ref().to_glib_none().0,
|
||||
timestamp.to_glib()
|
||||
),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_object_sync_values(self.as_ref().to_glib_none().0, timestamp.to_glib()),
|
||||
"Failed to sync values"
|
||||
)
|
||||
}
|
||||
|
@ -290,7 +279,7 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
|
||||
fn unparent(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_object_unparent(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_object_unparent(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,9 +292,9 @@ impl<O: IsA<Object>> GstObjectExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_parent_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstObject,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstObject,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Object>,
|
||||
{
|
||||
|
|
|
@ -2,43 +2,38 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Caps;
|
||||
use crate::Element;
|
||||
use crate::Event;
|
||||
use crate::EventType;
|
||||
use crate::Object;
|
||||
use crate::PadDirection;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::PadLinkCheck;
|
||||
use crate::PadMode;
|
||||
use crate::PadTemplate;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::Stream;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
use crate::TaskState;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Caps;
|
||||
use Element;
|
||||
use Event;
|
||||
use EventType;
|
||||
use Object;
|
||||
use PadDirection;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use PadLinkCheck;
|
||||
use PadMode;
|
||||
use PadTemplate;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use Stream;
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
use TaskState;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Pad(Object<gst_sys::GstPad, gst_sys::GstPadClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Pad(Object<ffi::GstPad, ffi::GstPadClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_pad_get_type(),
|
||||
get_type => || ffi::gst_pad_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -58,11 +53,11 @@ pub trait PadExt: 'static {
|
|||
&self,
|
||||
parent: &P,
|
||||
stream_id: Option<&str>,
|
||||
) -> Option<GString>;
|
||||
) -> Option<glib::GString>;
|
||||
|
||||
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<GString>;
|
||||
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<glib::GString>;
|
||||
|
||||
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<GString>;
|
||||
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<glib::GString>;
|
||||
|
||||
fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool;
|
||||
|
||||
|
@ -94,7 +89,7 @@ pub trait PadExt: 'static {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
fn get_stream(&self) -> Option<Stream>;
|
||||
|
||||
fn get_stream_id(&self) -> Option<GString>;
|
||||
fn get_stream_id(&self) -> Option<glib::GString>;
|
||||
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
|
@ -173,8 +168,8 @@ pub trait PadExt: 'static {
|
|||
impl<O: IsA<Pad>> PadExt for O {
|
||||
fn activate_mode(&self, mode: PadMode, active: bool) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_activate_mode(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_activate_mode(
|
||||
self.as_ref().to_glib_none().0,
|
||||
mode.to_glib(),
|
||||
active.to_glib()
|
||||
|
@ -186,7 +181,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_can_link(
|
||||
from_glib(ffi::gst_pad_can_link(
|
||||
self.as_ref().to_glib_none().0,
|
||||
sinkpad.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -195,7 +190,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn check_reconfigure(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_check_reconfigure(
|
||||
from_glib(ffi::gst_pad_check_reconfigure(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -205,9 +200,9 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
&self,
|
||||
parent: &P,
|
||||
stream_id: Option<&str>,
|
||||
) -> Option<GString> {
|
||||
) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_create_stream_id(
|
||||
from_glib_full(ffi::gst_pad_create_stream_id(
|
||||
self.as_ref().to_glib_none().0,
|
||||
parent.as_ref().to_glib_none().0,
|
||||
stream_id.to_glib_none().0,
|
||||
|
@ -215,20 +210,20 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<GString> {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_create_stream_id_printf() }
|
||||
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<glib::GString> {
|
||||
// unsafe { TODO: call ffi:gst_pad_create_stream_id_printf() }
|
||||
//}
|
||||
|
||||
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<GString> {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_create_stream_id_printf_valist() }
|
||||
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<glib::GString> {
|
||||
// unsafe { TODO: call ffi:gst_pad_create_stream_id_printf_valist() }
|
||||
//}
|
||||
|
||||
fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool {
|
||||
let forward_data: P = forward;
|
||||
unsafe extern "C" fn forward_func<P: FnMut(&Pad) -> bool>(
|
||||
pad: *mut gst_sys::GstPad,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
pad: *mut ffi::GstPad,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let pad = from_glib_borrow(pad);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
let res = (*callback)(&pad);
|
||||
|
@ -237,7 +232,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
let forward = Some(forward_func::<P> as _);
|
||||
let super_callback0: &P = &forward_data;
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_forward(
|
||||
from_glib(ffi::gst_pad_forward(
|
||||
self.as_ref().to_glib_none().0,
|
||||
forward,
|
||||
super_callback0 as *const _ as usize as *mut _,
|
||||
|
@ -247,7 +242,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn get_allowed_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_allowed_caps(
|
||||
from_glib_full(ffi::gst_pad_get_allowed_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -255,31 +250,27 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn get_current_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_current_caps(
|
||||
from_glib_full(ffi::gst_pad_get_current_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_direction(&self) -> PadDirection {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_get_direction(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_pad_get_direction(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
//fn get_element_private(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_get_element_private() }
|
||||
// unsafe { TODO: call ffi:gst_pad_get_element_private() }
|
||||
//}
|
||||
|
||||
fn get_offset(&self) -> i64 {
|
||||
unsafe { gst_sys::gst_pad_get_offset(self.as_ref().to_glib_none().0) }
|
||||
unsafe { ffi::gst_pad_get_offset(self.as_ref().to_glib_none().0) }
|
||||
}
|
||||
|
||||
fn get_pad_template(&self) -> Option<PadTemplate> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_pad_template(
|
||||
from_glib_full(ffi::gst_pad_get_pad_template(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -287,7 +278,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn get_pad_template_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_pad_template_caps(
|
||||
from_glib_full(ffi::gst_pad_get_pad_template_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -295,21 +286,21 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn get_parent_element(&self) -> Option<Element> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_parent_element(
|
||||
from_glib_full(ffi::gst_pad_get_parent_element(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_peer(&self) -> Option<Pad> {
|
||||
unsafe { from_glib_full(gst_sys::gst_pad_get_peer(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_pad_get_peer(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
fn get_single_internal_link(&self) -> Option<Pad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_single_internal_link(
|
||||
from_glib_full(ffi::gst_pad_get_single_internal_link(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -317,7 +308,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn get_sticky_event(&self, event_type: EventType, idx: u32) -> Option<Event> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_sticky_event(
|
||||
from_glib_full(ffi::gst_pad_get_sticky_event(
|
||||
self.as_ref().to_glib_none().0,
|
||||
event_type.to_glib(),
|
||||
idx,
|
||||
|
@ -328,65 +319,57 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
fn get_stream(&self) -> Option<Stream> {
|
||||
unsafe { from_glib_full(gst_sys::gst_pad_get_stream(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_pad_get_stream(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_stream_id(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_get_stream_id(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
fn get_stream_id(&self) -> Option<glib::GString> {
|
||||
unsafe { from_glib_full(ffi::gst_pad_get_stream_id(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
||||
fn get_task_state(&self) -> TaskState {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_get_task_state(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_pad_get_task_state(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn has_current_caps(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_has_current_caps(
|
||||
from_glib(ffi::gst_pad_has_current_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_active(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_pad_is_active(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_pad_is_active(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn is_blocked(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_pad_is_blocked(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_pad_is_blocked(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn is_blocking(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_pad_is_blocking(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_pad_is_blocking(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn is_linked(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_pad_is_linked(self.as_ref().to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_pad_is_linked(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
//fn iterate_internal_links(&self) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_iterate_internal_links() }
|
||||
// unsafe { TODO: call ffi:gst_pad_iterate_internal_links() }
|
||||
//}
|
||||
|
||||
//fn iterate_internal_links_default<P: IsA<Object>>(&self, parent: Option<&P>) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_iterate_internal_links_default() }
|
||||
// unsafe { TODO: call ffi:gst_pad_iterate_internal_links_default() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_link_maybe_ghosting(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_link_maybe_ghosting(
|
||||
self.as_ref().to_glib_none().0,
|
||||
sink.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -403,8 +386,8 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
flags: PadLinkCheck,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_link_maybe_ghosting_full(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_link_maybe_ghosting_full(
|
||||
self.as_ref().to_glib_none().0,
|
||||
sink.as_ref().to_glib_none().0,
|
||||
flags.to_glib()
|
||||
|
@ -416,13 +399,13 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn mark_reconfigure(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_pad_mark_reconfigure(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_pad_mark_reconfigure(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn needs_reconfigure(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_needs_reconfigure(
|
||||
from_glib(ffi::gst_pad_needs_reconfigure(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -430,8 +413,8 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn pause_task(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_pause_task(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_pause_task(self.as_ref().to_glib_none().0),
|
||||
"Failed to pause pad task"
|
||||
)
|
||||
}
|
||||
|
@ -439,7 +422,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn peer_query_accept_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_peer_query_accept_caps(
|
||||
from_glib(ffi::gst_pad_peer_query_accept_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -448,7 +431,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn peer_query_caps(&self, filter: Option<&Caps>) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_peer_query_caps(
|
||||
from_glib_full(ffi::gst_pad_peer_query_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
filter.to_glib_none().0,
|
||||
))
|
||||
|
@ -457,7 +440,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn query_accept_caps(&self, caps: &Caps) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pad_query_accept_caps(
|
||||
from_glib(ffi::gst_pad_query_accept_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
|
@ -466,7 +449,7 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn query_caps(&self, filter: Option<&Caps>) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_query_caps(
|
||||
from_glib_full(ffi::gst_pad_query_caps(
|
||||
self.as_ref().to_glib_none().0,
|
||||
filter.to_glib_none().0,
|
||||
))
|
||||
|
@ -475,27 +458,27 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_set_active(self.as_ref().to_glib_none().0, active.to_glib()),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_set_active(self.as_ref().to_glib_none().0, active.to_glib()),
|
||||
"Failed to activate pad"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
//fn set_element_private(&self, priv_: /*Unimplemented*/Option<Fundamental: Pointer>) {
|
||||
// unsafe { TODO: call gst_sys:gst_pad_set_element_private() }
|
||||
// unsafe { TODO: call ffi:gst_pad_set_element_private() }
|
||||
//}
|
||||
|
||||
fn set_offset(&self, offset: i64) {
|
||||
unsafe {
|
||||
gst_sys::gst_pad_set_offset(self.as_ref().to_glib_none().0, offset);
|
||||
ffi::gst_pad_set_offset(self.as_ref().to_glib_none().0, offset);
|
||||
}
|
||||
}
|
||||
|
||||
fn stop_task(&self) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_stop_task(self.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_stop_task(self.as_ref().to_glib_none().0),
|
||||
"Failed to stop pad task"
|
||||
)
|
||||
}
|
||||
|
@ -503,8 +486,8 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_pad_unlink(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_pad_unlink(
|
||||
self.as_ref().to_glib_none().0,
|
||||
sinkpad.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -515,15 +498,15 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn use_fixed_caps(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_pad_use_fixed_caps(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_pad_use_fixed_caps(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<Caps as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"caps\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -535,9 +518,9 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
|
||||
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn linked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPad,
|
||||
peer: *mut gst_sys::GstPad,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPad,
|
||||
peer: *mut ffi::GstPad,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pad>,
|
||||
{
|
||||
|
@ -565,9 +548,9 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn unlinked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPad,
|
||||
peer: *mut gst_sys::GstPad,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPad,
|
||||
peer: *mut ffi::GstPad,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pad>,
|
||||
{
|
||||
|
@ -595,9 +578,9 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_caps_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPad,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPad,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pad>,
|
||||
{
|
||||
|
@ -622,9 +605,9 @@ impl<O: IsA<Pad>> PadExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPad,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPad,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pad>,
|
||||
{
|
||||
|
|
|
@ -2,31 +2,26 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Caps;
|
||||
use crate::Object;
|
||||
use crate::Pad;
|
||||
use crate::PadDirection;
|
||||
use crate::PadPresence;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Caps;
|
||||
use Object;
|
||||
use Pad;
|
||||
use PadDirection;
|
||||
use PadPresence;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PadTemplate(Object<gst_sys::GstPadTemplate, gst_sys::GstPadTemplateClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct PadTemplate(Object<ffi::GstPadTemplate, ffi::GstPadTemplateClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_pad_template_get_type(),
|
||||
get_type => || ffi::gst_pad_template_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,13 +34,13 @@ impl PadTemplate {
|
|||
) -> Result<PadTemplate, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_pad_template_new(
|
||||
Option::<_>::from_glib_none(ffi::gst_pad_template_new(
|
||||
name_template.to_glib_none().0,
|
||||
direction.to_glib(),
|
||||
presence.to_glib(),
|
||||
caps.to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create pad template"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create pad template"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,26 +55,26 @@ impl PadTemplate {
|
|||
) -> Result<PadTemplate, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_none(gst_sys::gst_pad_template_new_with_gtype(
|
||||
Option::<_>::from_glib_none(ffi::gst_pad_template_new_with_gtype(
|
||||
name_template.to_glib_none().0,
|
||||
direction.to_glib(),
|
||||
presence.to_glib(),
|
||||
caps.to_glib_none().0,
|
||||
pad_type.to_glib(),
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to create pad template"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to create pad template"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_caps(&self) -> Option<Caps> {
|
||||
unsafe { from_glib_full(gst_sys::gst_pad_template_get_caps(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_pad_template_get_caps(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
pub fn get_documentation_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pad_template_get_documentation_caps(
|
||||
from_glib_full(ffi::gst_pad_template_get_documentation_caps(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -87,10 +82,7 @@ impl PadTemplate {
|
|||
|
||||
pub fn pad_created<P: IsA<Pad>>(&self, pad: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_pad_template_pad_created(
|
||||
self.to_glib_none().0,
|
||||
pad.as_ref().to_glib_none().0,
|
||||
);
|
||||
ffi::gst_pad_template_pad_created(self.to_glib_none().0, pad.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +90,7 @@ impl PadTemplate {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
||||
pub fn set_documentation_caps(&self, caps: &Caps) {
|
||||
unsafe {
|
||||
gst_sys::gst_pad_template_set_documentation_caps(
|
||||
ffi::gst_pad_template_set_documentation_caps(
|
||||
self.to_glib_none().0,
|
||||
caps.to_glib_none().0,
|
||||
);
|
||||
|
@ -108,8 +100,8 @@ impl PadTemplate {
|
|||
pub fn get_property_direction(&self) -> PadDirection {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<PadDirection as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"direction\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -125,8 +117,8 @@ impl PadTemplate {
|
|||
pub fn get_property_gtype(&self) -> glib::types::Type {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<glib::types::Type as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"gtype\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -137,11 +129,11 @@ impl PadTemplate {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_property_name_template(&self) -> Option<GString> {
|
||||
pub fn get_property_name_template(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<GString as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
let mut value = Value::from_type(<glib::GString as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"name-template\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -154,8 +146,8 @@ impl PadTemplate {
|
|||
pub fn get_property_presence(&self) -> PadPresence {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<PadPresence as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.as_ptr() as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.as_ptr() as *mut glib::gobject_ffi::GObject,
|
||||
b"presence\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -173,9 +165,9 @@ impl PadTemplate {
|
|||
unsafe extern "C" fn pad_created_trampoline<
|
||||
F: Fn(&PadTemplate, &Pad) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstPadTemplate,
|
||||
pad: *mut gst_sys::GstPad,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPadTemplate,
|
||||
pad: *mut ffi::GstPad,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(pad))
|
||||
|
|
|
@ -2,27 +2,25 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Bin;
|
||||
use crate::ChildProxy;
|
||||
use crate::Clock;
|
||||
use crate::ClockTime;
|
||||
use crate::Element;
|
||||
use crate::Object;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Bin;
|
||||
use ChildProxy;
|
||||
use Clock;
|
||||
use ClockTime;
|
||||
use Element;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Pipeline(Object<gst_sys::GstPipeline, gst_sys::GstPipelineClass>) @extends Bin, Element, Object, @implements ChildProxy;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Pipeline(Object<ffi::GstPipeline, ffi::GstPipelineClass>) @extends Bin, Element, Object, @implements ChildProxy;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_pipeline_get_type(),
|
||||
get_type => || ffi::gst_pipeline_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,7 +28,7 @@ impl Pipeline {
|
|||
pub fn new(name: Option<&str>) -> Pipeline {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Element::from_glib_none(gst_sys::gst_pipeline_new(name.to_glib_none().0)).unsafe_cast()
|
||||
Element::from_glib_none(ffi::gst_pipeline_new(name.to_glib_none().0)).unsafe_cast()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -78,29 +76,25 @@ pub trait PipelineExt: 'static {
|
|||
impl<O: IsA<Pipeline>> PipelineExt for O {
|
||||
fn auto_clock(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_pipeline_auto_clock(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_pipeline_auto_clock(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn get_auto_flush_bus(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pipeline_get_auto_flush_bus(
|
||||
from_glib(ffi::gst_pipeline_get_auto_flush_bus(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_delay(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pipeline_get_delay(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_pipeline_get_delay(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_latency(&self) -> ClockTime {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_pipeline_get_latency(
|
||||
from_glib(ffi::gst_pipeline_get_latency(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -108,7 +102,7 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
|
||||
fn get_pipeline_clock(&self) -> Option<Clock> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_pipeline_get_pipeline_clock(
|
||||
from_glib_full(ffi::gst_pipeline_get_pipeline_clock(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -116,7 +110,7 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
|
||||
fn set_auto_flush_bus(&self, auto_flush: bool) {
|
||||
unsafe {
|
||||
gst_sys::gst_pipeline_set_auto_flush_bus(
|
||||
ffi::gst_pipeline_set_auto_flush_bus(
|
||||
self.as_ref().to_glib_none().0,
|
||||
auto_flush.to_glib(),
|
||||
);
|
||||
|
@ -125,19 +119,19 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
|
||||
fn set_delay(&self, delay: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_pipeline_set_delay(self.as_ref().to_glib_none().0, delay.to_glib());
|
||||
ffi::gst_pipeline_set_delay(self.as_ref().to_glib_none().0, delay.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn set_latency(&self, latency: ClockTime) {
|
||||
unsafe {
|
||||
gst_sys::gst_pipeline_set_latency(self.as_ref().to_glib_none().0, latency.to_glib());
|
||||
ffi::gst_pipeline_set_latency(self.as_ref().to_glib_none().0, latency.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
fn use_clock<P: IsA<Clock>>(&self, clock: Option<&P>) {
|
||||
unsafe {
|
||||
gst_sys::gst_pipeline_use_clock(
|
||||
ffi::gst_pipeline_use_clock(
|
||||
self.as_ref().to_glib_none().0,
|
||||
clock.map(|p| p.as_ref()).to_glib_none().0,
|
||||
);
|
||||
|
@ -152,9 +146,9 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
P,
|
||||
F: Fn(&P) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstPipeline,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPipeline,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pipeline>,
|
||||
{
|
||||
|
@ -179,9 +173,9 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_delay_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPipeline,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPipeline,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pipeline>,
|
||||
{
|
||||
|
@ -206,9 +200,9 @@ impl<O: IsA<Pipeline>> PipelineExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_latency_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstPipeline,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstPipeline,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<Pipeline>,
|
||||
{
|
||||
|
|
|
@ -2,20 +2,16 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Object;
|
||||
use crate::PluginDependencyFlags;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use std;
|
||||
use std::ptr;
|
||||
use Object;
|
||||
use PluginDependencyFlags;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Plugin(Object<gst_sys::GstPlugin, gst_sys::GstPluginClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Plugin(Object<ffi::GstPlugin, ffi::GstPluginClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_plugin_get_type(),
|
||||
get_type => || ffi::gst_plugin_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +24,7 @@ impl Plugin {
|
|||
flags: PluginDependencyFlags,
|
||||
) {
|
||||
unsafe {
|
||||
gst_sys::gst_plugin_add_dependency(
|
||||
ffi::gst_plugin_add_dependency(
|
||||
self.to_glib_none().0,
|
||||
env_vars.to_glib_none().0,
|
||||
paths.to_glib_none().0,
|
||||
|
@ -46,7 +42,7 @@ impl Plugin {
|
|||
flags: PluginDependencyFlags,
|
||||
) {
|
||||
unsafe {
|
||||
gst_sys::gst_plugin_add_dependency_simple(
|
||||
ffi::gst_plugin_add_dependency_simple(
|
||||
self.to_glib_none().0,
|
||||
env_vars.to_glib_none().0,
|
||||
paths.to_glib_none().0,
|
||||
|
@ -56,58 +52,58 @@ impl Plugin {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn get_description(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_description(self.to_glib_none().0)) }
|
||||
pub fn get_description(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_description(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_filename(&self) -> Option<std::path::PathBuf> {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_filename(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_filename(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_license(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_license(self.to_glib_none().0)) }
|
||||
pub fn get_license(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_license(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_origin(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_origin(self.to_glib_none().0)) }
|
||||
pub fn get_origin(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_origin(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_package(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_package(self.to_glib_none().0)) }
|
||||
pub fn get_package(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_package(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_release_date_string(&self) -> Option<GString> {
|
||||
pub fn get_release_date_string(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_plugin_get_release_date_string(
|
||||
from_glib_none(ffi::gst_plugin_get_release_date_string(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_source(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_source(self.to_glib_none().0)) }
|
||||
pub fn get_source(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_source(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_version(&self) -> GString {
|
||||
unsafe { from_glib_none(gst_sys::gst_plugin_get_version(self.to_glib_none().0)) }
|
||||
pub fn get_version(&self) -> glib::GString {
|
||||
unsafe { from_glib_none(ffi::gst_plugin_get_version(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn is_loaded(&self) -> bool {
|
||||
unsafe { from_glib(gst_sys::gst_plugin_is_loaded(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_plugin_is_loaded(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn load(&self) -> Result<Plugin, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_plugin_load(self.to_glib_none().0))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to load plugin"))
|
||||
Option::<_>::from_glib_full(ffi::gst_plugin_load(self.to_glib_none().0))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to load plugin"))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_by_name(name: &str) -> Result<Plugin, glib::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_plugin_load_by_name(name.to_glib_none().0))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to load plugin"))
|
||||
Option::<_>::from_glib_full(ffi::gst_plugin_load_by_name(name.to_glib_none().0))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to load plugin"))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -115,7 +111,7 @@ impl Plugin {
|
|||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = gst_sys::gst_plugin_load_file(filename.as_ref().to_glib_none().0, &mut error);
|
||||
let ret = ffi::gst_plugin_load_file(filename.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() {
|
||||
Ok(from_glib_full(ret))
|
||||
} else {
|
||||
|
|
|
@ -2,19 +2,16 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Object;
|
||||
use crate::Plugin;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
use Plugin;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct PluginFeature(Object<gst_sys::GstPluginFeature, gst_sys::GstPluginFeatureClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct PluginFeature(Object<ffi::GstPluginFeature, ffi::GstPluginFeatureClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_plugin_feature_get_type(),
|
||||
get_type => || ffi::gst_plugin_feature_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +25,7 @@ pub trait PluginFeatureExt: 'static {
|
|||
|
||||
fn get_plugin(&self) -> Option<Plugin>;
|
||||
|
||||
fn get_plugin_name(&self) -> Option<GString>;
|
||||
fn get_plugin_name(&self) -> Option<glib::GString>;
|
||||
|
||||
fn load(&self) -> Result<PluginFeature, glib::BoolError>;
|
||||
}
|
||||
|
@ -36,7 +33,7 @@ pub trait PluginFeatureExt: 'static {
|
|||
impl<O: IsA<PluginFeature>> PluginFeatureExt for O {
|
||||
fn check_version(&self, min_major: u32, min_minor: u32, min_micro: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_plugin_feature_check_version(
|
||||
from_glib(ffi::gst_plugin_feature_check_version(
|
||||
self.as_ref().to_glib_none().0,
|
||||
min_major,
|
||||
min_minor,
|
||||
|
@ -47,15 +44,15 @@ impl<O: IsA<PluginFeature>> PluginFeatureExt for O {
|
|||
|
||||
fn get_plugin(&self) -> Option<Plugin> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_plugin_feature_get_plugin(
|
||||
from_glib_full(ffi::gst_plugin_feature_get_plugin(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_plugin_name(&self) -> Option<GString> {
|
||||
fn get_plugin_name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_plugin_feature_get_plugin_name(
|
||||
from_glib_none(ffi::gst_plugin_feature_get_plugin_name(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -63,10 +60,10 @@ impl<O: IsA<PluginFeature>> PluginFeatureExt for O {
|
|||
|
||||
fn load(&self) -> Result<PluginFeature, glib::BoolError> {
|
||||
unsafe {
|
||||
Option::<_>::from_glib_full(gst_sys::gst_plugin_feature_load(
|
||||
Option::<_>::from_glib_full(ffi::gst_plugin_feature_load(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
.ok_or_else(|| glib_bool_error!("Failed to load plugin feature"))
|
||||
.ok_or_else(|| glib::glib_bool_error!("Failed to load plugin feature"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,26 +2,22 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use std;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Preset(Interface<gst_sys::GstPreset>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct Preset(Interface<ffi::GstPreset>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_preset_get_type(),
|
||||
get_type => || ffi::gst_preset_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Preset {
|
||||
pub fn get_app_dir() -> Option<std::path::PathBuf> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_none(gst_sys::gst_preset_get_app_dir()) }
|
||||
unsafe { from_glib_none(ffi::gst_preset_get_app_dir()) }
|
||||
}
|
||||
|
||||
pub fn set_app_dir<P: AsRef<std::path::Path>>(
|
||||
|
@ -29,8 +25,8 @@ impl Preset {
|
|||
) -> Result<(), glib::error::BoolError> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_set_app_dir(app_dir.as_ref().to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_set_app_dir(app_dir.as_ref().to_glib_none().0),
|
||||
"Failed to set app preset directory"
|
||||
)
|
||||
}
|
||||
|
@ -45,11 +41,11 @@ pub const NONE_PRESET: Option<&Preset> = None;
|
|||
pub trait PresetExt: 'static {
|
||||
fn delete_preset(&self, name: &str) -> Result<(), glib::error::BoolError>;
|
||||
|
||||
fn get_meta(&self, name: &str, tag: &str) -> Option<GString>;
|
||||
fn get_meta(&self, name: &str, tag: &str) -> Option<glib::GString>;
|
||||
|
||||
fn get_preset_names(&self) -> Vec<GString>;
|
||||
fn get_preset_names(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn get_property_names(&self) -> Vec<GString>;
|
||||
fn get_property_names(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn is_editable(&self) -> bool;
|
||||
|
||||
|
@ -70,8 +66,8 @@ pub trait PresetExt: 'static {
|
|||
impl<O: IsA<Preset>> PresetExt for O {
|
||||
fn delete_preset(&self, name: &str) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_delete_preset(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_delete_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0
|
||||
),
|
||||
|
@ -80,10 +76,10 @@ impl<O: IsA<Preset>> PresetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_meta(&self, name: &str, tag: &str) -> Option<GString> {
|
||||
fn get_meta(&self, name: &str, tag: &str) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
let mut value = ptr::null_mut();
|
||||
let ret = from_glib(gst_sys::gst_preset_get_meta(
|
||||
let ret = from_glib(ffi::gst_preset_get_meta(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
tag.to_glib_none().0,
|
||||
|
@ -97,37 +93,30 @@ impl<O: IsA<Preset>> PresetExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
fn get_preset_names(&self) -> Vec<GString> {
|
||||
fn get_preset_names(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_preset_get_preset_names(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_preset_get_preset_names(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_names(&self) -> Vec<GString> {
|
||||
fn get_property_names(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_preset_get_property_names(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_preset_get_property_names(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn is_editable(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_preset_is_editable(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib(ffi::gst_preset_is_editable(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn load_preset(&self, name: &str) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_load_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0
|
||||
),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_load_preset(self.as_ref().to_glib_none().0, name.to_glib_none().0),
|
||||
"Failed to load preset"
|
||||
)
|
||||
}
|
||||
|
@ -135,8 +124,8 @@ impl<O: IsA<Preset>> PresetExt for O {
|
|||
|
||||
fn rename_preset(&self, old_name: &str, new_name: &str) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_rename_preset(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_rename_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
old_name.to_glib_none().0,
|
||||
new_name.to_glib_none().0
|
||||
|
@ -148,11 +137,8 @@ impl<O: IsA<Preset>> PresetExt for O {
|
|||
|
||||
fn save_preset(&self, name: &str) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_save_preset(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0
|
||||
),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_save_preset(self.as_ref().to_glib_none().0, name.to_glib_none().0),
|
||||
"Failed to save preset"
|
||||
)
|
||||
}
|
||||
|
@ -165,8 +151,8 @@ impl<O: IsA<Preset>> PresetExt for O {
|
|||
value: Option<&str>,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_preset_set_meta(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_preset_set_meta(
|
||||
self.as_ref().to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
tag.to_glib_none().0,
|
||||
|
|
|
@ -2,23 +2,22 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Object;
|
||||
use crate::Pad;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
use Pad;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ProxyPad(Object<gst_sys::GstProxyPad, gst_sys::GstProxyPadClass>) @extends Pad, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct ProxyPad(Object<ffi::GstProxyPad, ffi::GstProxyPadClass>) @extends Pad, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_proxy_pad_get_type(),
|
||||
get_type => || ffi::gst_proxy_pad_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl ProxyPad {
|
||||
//pub fn iterate_internal_links_default<P: IsA<Pad>, Q: IsA<Object>>(pad: &P, parent: Option<&Q>) -> /*Ignored*/Option<Iterator> {
|
||||
// unsafe { TODO: call gst_sys:gst_proxy_pad_iterate_internal_links_default() }
|
||||
// unsafe { TODO: call ffi:gst_proxy_pad_iterate_internal_links_default() }
|
||||
//}
|
||||
}
|
||||
|
||||
|
@ -34,7 +33,7 @@ pub trait ProxyPadExt: 'static {
|
|||
impl<O: IsA<ProxyPad>> ProxyPadExt for O {
|
||||
fn get_internal(&self) -> Option<ProxyPad> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_proxy_pad_get_internal(
|
||||
from_glib_full(ffi::gst_proxy_pad_get_internal(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -2,26 +2,22 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::Object;
|
||||
use crate::Plugin;
|
||||
use crate::PluginFeature;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
use std;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Object;
|
||||
use Plugin;
|
||||
use PluginFeature;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Registry(Object<gst_sys::GstRegistry, gst_sys::GstRegistryClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Registry(Object<ffi::GstRegistry, ffi::GstRegistryClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_registry_get_type(),
|
||||
get_type => || ffi::gst_registry_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,8 +27,8 @@ impl Registry {
|
|||
feature: &P,
|
||||
) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_registry_add_feature(
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_registry_add_feature(
|
||||
self.to_glib_none().0,
|
||||
feature.as_ref().to_glib_none().0
|
||||
),
|
||||
|
@ -43,8 +39,8 @@ impl Registry {
|
|||
|
||||
pub fn add_plugin(&self, plugin: &Plugin) -> Result<(), glib::error::BoolError> {
|
||||
unsafe {
|
||||
glib_result_from_gboolean!(
|
||||
gst_sys::gst_registry_add_plugin(self.to_glib_none().0, plugin.to_glib_none().0),
|
||||
glib::glib_result_from_gboolean!(
|
||||
ffi::gst_registry_add_plugin(self.to_glib_none().0, plugin.to_glib_none().0),
|
||||
"Failed to add plugin"
|
||||
)
|
||||
}
|
||||
|
@ -58,7 +54,7 @@ impl Registry {
|
|||
min_micro: u32,
|
||||
) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_registry_check_feature_version(
|
||||
from_glib(ffi::gst_registry_check_feature_version(
|
||||
self.to_glib_none().0,
|
||||
feature_name.to_glib_none().0,
|
||||
min_major,
|
||||
|
@ -75,9 +71,9 @@ impl Registry {
|
|||
) -> Vec<PluginFeature> {
|
||||
let filter_data: P = filter;
|
||||
unsafe extern "C" fn filter_func<P: FnMut(&PluginFeature) -> bool>(
|
||||
feature: *mut gst_sys::GstPluginFeature,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
feature: *mut ffi::GstPluginFeature,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let feature = from_glib_borrow(feature);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
let res = (*callback)(&feature);
|
||||
|
@ -86,7 +82,7 @@ impl Registry {
|
|||
let filter = Some(filter_func::<P> as _);
|
||||
let super_callback0: &P = &filter_data;
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_registry_feature_filter(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_feature_filter(
|
||||
self.to_glib_none().0,
|
||||
filter,
|
||||
first.to_glib(),
|
||||
|
@ -97,7 +93,7 @@ impl Registry {
|
|||
|
||||
pub fn find_feature(&self, name: &str, type_: glib::types::Type) -> Option<PluginFeature> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_registry_find_feature(
|
||||
from_glib_full(ffi::gst_registry_find_feature(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
type_.to_glib(),
|
||||
|
@ -107,7 +103,7 @@ impl Registry {
|
|||
|
||||
pub fn find_plugin(&self, name: &str) -> Option<Plugin> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_registry_find_plugin(
|
||||
from_glib_full(ffi::gst_registry_find_plugin(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -116,7 +112,7 @@ impl Registry {
|
|||
|
||||
pub fn get_feature_list(&self, type_: glib::types::Type) -> Vec<PluginFeature> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_registry_get_feature_list(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_get_feature_list(
|
||||
self.to_glib_none().0,
|
||||
type_.to_glib(),
|
||||
))
|
||||
|
@ -125,7 +121,7 @@ impl Registry {
|
|||
|
||||
pub fn get_feature_list_by_plugin(&self, name: &str) -> Vec<PluginFeature> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_registry_get_feature_list_by_plugin(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_get_feature_list_by_plugin(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -133,12 +129,12 @@ impl Registry {
|
|||
}
|
||||
|
||||
pub fn get_feature_list_cookie(&self) -> u32 {
|
||||
unsafe { gst_sys::gst_registry_get_feature_list_cookie(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_registry_get_feature_list_cookie(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
pub fn get_plugin_list(&self) -> Vec<Plugin> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_registry_get_plugin_list(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_get_plugin_list(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -146,7 +142,7 @@ impl Registry {
|
|||
|
||||
pub fn lookup(&self, filename: &str) -> Option<Plugin> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_registry_lookup(
|
||||
from_glib_full(ffi::gst_registry_lookup(
|
||||
self.to_glib_none().0,
|
||||
filename.to_glib_none().0,
|
||||
))
|
||||
|
@ -155,7 +151,7 @@ impl Registry {
|
|||
|
||||
pub fn lookup_feature(&self, name: &str) -> Option<PluginFeature> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_registry_lookup_feature(
|
||||
from_glib_full(ffi::gst_registry_lookup_feature(
|
||||
self.to_glib_none().0,
|
||||
name.to_glib_none().0,
|
||||
))
|
||||
|
@ -165,9 +161,9 @@ impl Registry {
|
|||
pub fn plugin_filter<P: FnMut(&Plugin) -> bool>(&self, filter: P, first: bool) -> Vec<Plugin> {
|
||||
let filter_data: P = filter;
|
||||
unsafe extern "C" fn filter_func<P: FnMut(&Plugin) -> bool>(
|
||||
plugin: *mut gst_sys::GstPlugin,
|
||||
user_data: glib_sys::gpointer,
|
||||
) -> glib_sys::gboolean {
|
||||
plugin: *mut ffi::GstPlugin,
|
||||
user_data: glib::ffi::gpointer,
|
||||
) -> glib::ffi::gboolean {
|
||||
let plugin = from_glib_borrow(plugin);
|
||||
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
||||
let res = (*callback)(&plugin);
|
||||
|
@ -176,7 +172,7 @@ impl Registry {
|
|||
let filter = Some(filter_func::<P> as _);
|
||||
let super_callback0: &P = &filter_data;
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(gst_sys::gst_registry_plugin_filter(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::gst_registry_plugin_filter(
|
||||
self.to_glib_none().0,
|
||||
filter,
|
||||
first.to_glib(),
|
||||
|
@ -187,7 +183,7 @@ impl Registry {
|
|||
|
||||
pub fn remove_feature<P: IsA<PluginFeature>>(&self, feature: &P) {
|
||||
unsafe {
|
||||
gst_sys::gst_registry_remove_feature(
|
||||
ffi::gst_registry_remove_feature(
|
||||
self.to_glib_none().0,
|
||||
feature.as_ref().to_glib_none().0,
|
||||
);
|
||||
|
@ -196,13 +192,13 @@ impl Registry {
|
|||
|
||||
pub fn remove_plugin(&self, plugin: &Plugin) {
|
||||
unsafe {
|
||||
gst_sys::gst_registry_remove_plugin(self.to_glib_none().0, plugin.to_glib_none().0);
|
||||
ffi::gst_registry_remove_plugin(self.to_glib_none().0, plugin.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn scan_path<P: AsRef<std::path::Path>>(&self, path: P) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_registry_scan_path(
|
||||
from_glib(ffi::gst_registry_scan_path(
|
||||
self.to_glib_none().0,
|
||||
path.as_ref().to_glib_none().0,
|
||||
))
|
||||
|
@ -211,7 +207,7 @@ impl Registry {
|
|||
|
||||
pub fn get() -> Registry {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_none(gst_sys::gst_registry_get()) }
|
||||
unsafe { from_glib_none(ffi::gst_registry_get()) }
|
||||
}
|
||||
|
||||
pub fn connect_feature_added<F: Fn(&Registry, &PluginFeature) + Send + Sync + 'static>(
|
||||
|
@ -221,9 +217,9 @@ impl Registry {
|
|||
unsafe extern "C" fn feature_added_trampoline<
|
||||
F: Fn(&Registry, &PluginFeature) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstRegistry,
|
||||
feature: *mut gst_sys::GstPluginFeature,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstRegistry,
|
||||
feature: *mut ffi::GstPluginFeature,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(feature))
|
||||
|
@ -248,9 +244,9 @@ impl Registry {
|
|||
unsafe extern "C" fn plugin_added_trampoline<
|
||||
F: Fn(&Registry, &Plugin) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstRegistry,
|
||||
plugin: *mut gst_sys::GstPlugin,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstRegistry,
|
||||
plugin: *mut ffi::GstPlugin,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &from_glib_borrow(plugin))
|
||||
|
|
|
@ -2,6 +2,19 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::Caps;
|
||||
use crate::Object;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::StreamFlags;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::StreamType;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::TagList;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
|
@ -14,36 +27,16 @@ use glib::signal::SignalHandlerId;
|
|||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use glib::GString;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use glib_sys;
|
||||
use gst_sys;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use std::boxed::Box as Box_;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use std::mem::transmute;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use Caps;
|
||||
use Object;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use StreamFlags;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use StreamType;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use TagList;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Stream(Object<gst_sys::GstStream, gst_sys::GstStreamClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct Stream(Object<ffi::GstStream, ffi::GstStreamClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_stream_get_type(),
|
||||
get_type => || ffi::gst_stream_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,38 +44,38 @@ impl Stream {
|
|||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_caps(&self) -> Option<Caps> {
|
||||
unsafe { from_glib_full(gst_sys::gst_stream_get_caps(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_stream_get_caps(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_stream_flags(&self) -> StreamFlags {
|
||||
unsafe { from_glib(gst_sys::gst_stream_get_stream_flags(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_stream_get_stream_flags(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_stream_id(&self) -> Option<GString> {
|
||||
unsafe { from_glib_none(gst_sys::gst_stream_get_stream_id(self.to_glib_none().0)) }
|
||||
pub fn get_stream_id(&self) -> Option<glib::GString> {
|
||||
unsafe { from_glib_none(ffi::gst_stream_get_stream_id(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_stream_type(&self) -> StreamType {
|
||||
unsafe { from_glib(gst_sys::gst_stream_get_stream_type(self.to_glib_none().0)) }
|
||||
unsafe { from_glib(ffi::gst_stream_get_stream_type(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_tags(&self) -> Option<TagList> {
|
||||
unsafe { from_glib_full(gst_sys::gst_stream_get_tags(self.to_glib_none().0)) }
|
||||
unsafe { from_glib_full(ffi::gst_stream_get_tags(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn set_caps(&self, caps: Option<&Caps>) {
|
||||
unsafe {
|
||||
gst_sys::gst_stream_set_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
||||
ffi::gst_stream_set_caps(self.to_glib_none().0, caps.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -90,7 +83,7 @@ impl Stream {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn set_stream_flags(&self, flags: StreamFlags) {
|
||||
unsafe {
|
||||
gst_sys::gst_stream_set_stream_flags(self.to_glib_none().0, flags.to_glib());
|
||||
ffi::gst_stream_set_stream_flags(self.to_glib_none().0, flags.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +91,7 @@ impl Stream {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn set_stream_type(&self, stream_type: StreamType) {
|
||||
unsafe {
|
||||
gst_sys::gst_stream_set_stream_type(self.to_glib_none().0, stream_type.to_glib());
|
||||
ffi::gst_stream_set_stream_type(self.to_glib_none().0, stream_type.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,7 +99,7 @@ impl Stream {
|
|||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn set_tags(&self, tags: Option<&TagList>) {
|
||||
unsafe {
|
||||
gst_sys::gst_stream_set_tags(self.to_glib_none().0, tags.to_glib_none().0);
|
||||
ffi::gst_stream_set_tags(self.to_glib_none().0, tags.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -117,9 +110,9 @@ impl Stream {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_caps_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstStream,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstStream,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
@ -146,9 +139,9 @@ impl Stream {
|
|||
unsafe extern "C" fn notify_stream_flags_trampoline<
|
||||
F: Fn(&Stream) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstStream,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstStream,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
@ -175,9 +168,9 @@ impl Stream {
|
|||
unsafe extern "C" fn notify_stream_type_trampoline<
|
||||
F: Fn(&Stream) + Send + Sync + 'static,
|
||||
>(
|
||||
this: *mut gst_sys::GstStream,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstStream,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
@ -202,9 +195,9 @@ impl Stream {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_tags_trampoline<F: Fn(&Stream) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstStream,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstStream,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
|
|
|
@ -2,21 +2,17 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Object;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use crate::Stream;
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use Object;
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
use Stream;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct StreamCollection(Object<gst_sys::GstStreamCollection, gst_sys::GstStreamCollectionClass>) @extends Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct StreamCollection(Object<ffi::GstStreamCollection, ffi::GstStreamCollectionClass>) @extends Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_stream_collection_get_type(),
|
||||
get_type => || ffi::gst_stream_collection_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,14 +20,14 @@ impl StreamCollection {
|
|||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_size(&self) -> u32 {
|
||||
unsafe { gst_sys::gst_stream_collection_get_size(self.to_glib_none().0) }
|
||||
unsafe { ffi::gst_stream_collection_get_size(self.to_glib_none().0) }
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_stream(&self, index: u32) -> Option<Stream> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_stream_collection_get_stream(
|
||||
from_glib_none(ffi::gst_stream_collection_get_stream(
|
||||
self.to_glib_none().0,
|
||||
index,
|
||||
))
|
||||
|
@ -40,9 +36,9 @@ impl StreamCollection {
|
|||
|
||||
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
||||
pub fn get_upstream_id(&self) -> Option<GString> {
|
||||
pub fn get_upstream_id(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_stream_collection_get_upstream_id(
|
||||
from_glib_none(ffi::gst_stream_collection_get_upstream_id(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
|
|
@ -2,6 +2,9 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Clock;
|
||||
use crate::ClockType;
|
||||
use crate::Object;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::connect_raw;
|
||||
|
@ -9,33 +12,27 @@ use glib::signal::SignalHandlerId;
|
|||
use glib::translate::*;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use gst_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem::transmute;
|
||||
use Clock;
|
||||
use ClockType;
|
||||
use Object;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct SystemClock(Object<gst_sys::GstSystemClock, gst_sys::GstSystemClockClass>) @extends Clock, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct SystemClock(Object<ffi::GstSystemClock, ffi::GstSystemClockClass>) @extends Clock, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_system_clock_get_type(),
|
||||
get_type => || ffi::gst_system_clock_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl SystemClock {
|
||||
pub fn obtain() -> Clock {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { from_glib_full(gst_sys::gst_system_clock_obtain()) }
|
||||
unsafe { from_glib_full(ffi::gst_system_clock_obtain()) }
|
||||
}
|
||||
|
||||
pub fn set_default<P: IsA<Clock>>(new_clock: Option<&P>) {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe {
|
||||
gst_sys::gst_system_clock_set_default(new_clock.map(|p| p.as_ref()).to_glib_none().0);
|
||||
ffi::gst_system_clock_set_default(new_clock.map(|p| p.as_ref()).to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +57,8 @@ impl<O: IsA<SystemClock>> SystemClockExt for O {
|
|||
fn get_property_clock_type(&self) -> ClockType {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<ClockType as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_get_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"clock-type\0".as_ptr() as *const _,
|
||||
value.to_glib_none_mut().0,
|
||||
);
|
||||
|
@ -74,8 +71,8 @@ impl<O: IsA<SystemClock>> SystemClockExt for O {
|
|||
|
||||
fn set_property_clock_type(&self, clock_type: ClockType) {
|
||||
unsafe {
|
||||
gobject_sys::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut gobject_sys::GObject,
|
||||
glib::gobject_ffi::g_object_set_property(
|
||||
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
||||
b"clock-type\0".as_ptr() as *const _,
|
||||
Value::from(&clock_type).to_glib_none().0,
|
||||
);
|
||||
|
@ -87,9 +84,9 @@ impl<O: IsA<SystemClock>> SystemClockExt for O {
|
|||
f: F,
|
||||
) -> SignalHandlerId {
|
||||
unsafe extern "C" fn notify_clock_type_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
||||
this: *mut gst_sys::GstSystemClock,
|
||||
_param_spec: glib_sys::gpointer,
|
||||
f: glib_sys::gpointer,
|
||||
this: *mut ffi::GstSystemClock,
|
||||
_param_spec: glib::ffi::gpointer,
|
||||
f: glib::ffi::gpointer,
|
||||
) where
|
||||
P: IsA<SystemClock>,
|
||||
{
|
||||
|
|
|
@ -2,19 +2,18 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Element;
|
||||
use crate::Object;
|
||||
use crate::TagList;
|
||||
use crate::TagMergeMode;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use Element;
|
||||
use Object;
|
||||
use TagList;
|
||||
use TagMergeMode;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TagSetter(Interface<gst_sys::GstTagSetter>) @requires Element, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct TagSetter(Interface<ffi::GstTagSetter>) @requires Element, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_tag_setter_get_type(),
|
||||
get_type => || ffi::gst_tag_setter_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -45,24 +44,24 @@ pub trait TagSetterExt: 'static {
|
|||
|
||||
impl<O: IsA<TagSetter>> TagSetterExt for O {
|
||||
//fn add_tag_valist(&self, mode: TagMergeMode, tag: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call gst_sys:gst_tag_setter_add_tag_valist() }
|
||||
// unsafe { TODO: call ffi:gst_tag_setter_add_tag_valist() }
|
||||
//}
|
||||
|
||||
//fn add_tag_valist_values(&self, mode: TagMergeMode, tag: &str, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) {
|
||||
// unsafe { TODO: call gst_sys:gst_tag_setter_add_tag_valist_values() }
|
||||
// unsafe { TODO: call ffi:gst_tag_setter_add_tag_valist_values() }
|
||||
//}
|
||||
|
||||
//fn add_tag_values(&self, mode: TagMergeMode, tag: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_tag_setter_add_tag_values() }
|
||||
// unsafe { TODO: call ffi:gst_tag_setter_add_tag_values() }
|
||||
//}
|
||||
|
||||
//fn add_tags(&self, mode: TagMergeMode, tag: &str, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call gst_sys:gst_tag_setter_add_tags() }
|
||||
// unsafe { TODO: call ffi:gst_tag_setter_add_tags() }
|
||||
//}
|
||||
|
||||
fn get_tag_list(&self) -> Option<TagList> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_tag_setter_get_tag_list(
|
||||
from_glib_none(ffi::gst_tag_setter_get_tag_list(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -70,7 +69,7 @@ impl<O: IsA<TagSetter>> TagSetterExt for O {
|
|||
|
||||
fn get_tag_merge_mode(&self) -> TagMergeMode {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_tag_setter_get_tag_merge_mode(
|
||||
from_glib(ffi::gst_tag_setter_get_tag_merge_mode(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ impl<O: IsA<TagSetter>> TagSetterExt for O {
|
|||
|
||||
fn merge_tags(&self, list: &TagList, mode: TagMergeMode) {
|
||||
unsafe {
|
||||
gst_sys::gst_tag_setter_merge_tags(
|
||||
ffi::gst_tag_setter_merge_tags(
|
||||
self.as_ref().to_glib_none().0,
|
||||
list.to_glib_none().0,
|
||||
mode.to_glib(),
|
||||
|
@ -88,16 +87,13 @@ impl<O: IsA<TagSetter>> TagSetterExt for O {
|
|||
|
||||
fn reset_tags(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_tag_setter_reset_tags(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_tag_setter_reset_tags(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_tag_merge_mode(&self, mode: TagMergeMode) {
|
||||
unsafe {
|
||||
gst_sys::gst_tag_setter_set_tag_merge_mode(
|
||||
self.as_ref().to_glib_none().0,
|
||||
mode.to_glib(),
|
||||
);
|
||||
ffi::gst_tag_setter_set_tag_merge_mode(self.as_ref().to_glib_none().0, mode.to_glib());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Element;
|
||||
use crate::Object;
|
||||
use crate::Toc;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use gst_sys;
|
||||
use Element;
|
||||
use Object;
|
||||
use Toc;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TocSetter(Interface<gst_sys::GstTocSetter>) @requires Element, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct TocSetter(Interface<ffi::GstTocSetter>) @requires Element, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_toc_setter_get_type(),
|
||||
get_type => || ffi::gst_toc_setter_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -32,22 +31,18 @@ pub trait TocSetterExt: 'static {
|
|||
|
||||
impl<O: IsA<TocSetter>> TocSetterExt for O {
|
||||
fn get_toc(&self) -> Option<Toc> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_toc_setter_get_toc(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_full(ffi::gst_toc_setter_get_toc(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn reset(&self) {
|
||||
unsafe {
|
||||
gst_sys::gst_toc_setter_reset(self.as_ref().to_glib_none().0);
|
||||
ffi::gst_toc_setter_reset(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_toc(&self, toc: Option<&Toc>) {
|
||||
unsafe {
|
||||
gst_sys::gst_toc_setter_set_toc(self.as_ref().to_glib_none().0, toc.to_glib_none().0);
|
||||
ffi::gst_toc_setter_set_toc(self.as_ref().to_glib_none().0, toc.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,37 +2,31 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::Caps;
|
||||
use crate::Object;
|
||||
use crate::PluginFeature;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use Caps;
|
||||
use Object;
|
||||
use PluginFeature;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct TypeFindFactory(Object<gst_sys::GstTypeFindFactory, gst_sys::GstTypeFindFactoryClass>) @extends PluginFeature, Object;
|
||||
glib::glib_wrapper! {
|
||||
pub struct TypeFindFactory(Object<ffi::GstTypeFindFactory, ffi::GstTypeFindFactoryClass>) @extends PluginFeature, Object;
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_type_find_factory_get_type(),
|
||||
get_type => || ffi::gst_type_find_factory_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl TypeFindFactory {
|
||||
//pub fn call_function(&self, find: /*Ignored*/&mut TypeFind) {
|
||||
// unsafe { TODO: call gst_sys:gst_type_find_factory_call_function() }
|
||||
// unsafe { TODO: call ffi:gst_type_find_factory_call_function() }
|
||||
//}
|
||||
|
||||
pub fn get_caps(&self) -> Option<Caps> {
|
||||
unsafe {
|
||||
from_glib_none(gst_sys::gst_type_find_factory_get_caps(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
unsafe { from_glib_none(ffi::gst_type_find_factory_get_caps(self.to_glib_none().0)) }
|
||||
}
|
||||
|
||||
pub fn get_extensions(&self) -> Vec<GString> {
|
||||
pub fn get_extensions(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(gst_sys::gst_type_find_factory_get_extensions(
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_type_find_factory_get_extensions(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -40,7 +34,7 @@ impl TypeFindFactory {
|
|||
|
||||
pub fn has_function(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_type_find_factory_has_function(
|
||||
from_glib(ffi::gst_type_find_factory_has_function(
|
||||
self.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -48,7 +42,7 @@ impl TypeFindFactory {
|
|||
|
||||
pub fn get_list() -> Vec<TypeFindFactory> {
|
||||
assert_initialized_main_thread!();
|
||||
unsafe { FromGlibPtrContainer::from_glib_full(gst_sys::gst_type_find_factory_get_list()) }
|
||||
unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_type_find_factory_get_list()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,19 +2,16 @@
|
|||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::URIType;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use gst_sys;
|
||||
use std::ptr;
|
||||
use URIType;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct URIHandler(Interface<gst_sys::GstURIHandler>);
|
||||
glib::glib_wrapper! {
|
||||
pub struct URIHandler(Interface<ffi::GstURIHandler>);
|
||||
|
||||
match fn {
|
||||
get_type => || gst_sys::gst_uri_handler_get_type(),
|
||||
get_type => || ffi::gst_uri_handler_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -24,9 +21,9 @@ unsafe impl Sync for URIHandler {}
|
|||
pub const NONE_URI_HANDLER: Option<&URIHandler> = None;
|
||||
|
||||
pub trait URIHandlerExt: 'static {
|
||||
fn get_protocols(&self) -> Vec<GString>;
|
||||
fn get_protocols(&self) -> Vec<glib::GString>;
|
||||
|
||||
fn get_uri(&self) -> Option<GString>;
|
||||
fn get_uri(&self) -> Option<glib::GString>;
|
||||
|
||||
fn get_uri_type(&self) -> URIType;
|
||||
|
||||
|
@ -34,25 +31,21 @@ pub trait URIHandlerExt: 'static {
|
|||
}
|
||||
|
||||
impl<O: IsA<URIHandler>> URIHandlerExt for O {
|
||||
fn get_protocols(&self) -> Vec<GString> {
|
||||
fn get_protocols(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(gst_sys::gst_uri_handler_get_protocols(
|
||||
FromGlibPtrContainer::from_glib_none(ffi::gst_uri_handler_get_protocols(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uri(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_full(gst_sys::gst_uri_handler_get_uri(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
fn get_uri(&self) -> Option<glib::GString> {
|
||||
unsafe { from_glib_full(ffi::gst_uri_handler_get_uri(self.as_ref().to_glib_none().0)) }
|
||||
}
|
||||
|
||||
fn get_uri_type(&self) -> URIType {
|
||||
unsafe {
|
||||
from_glib(gst_sys::gst_uri_handler_get_uri_type(
|
||||
from_glib(ffi::gst_uri_handler_get_uri_type(
|
||||
self.as_ref().to_glib_none().0,
|
||||
))
|
||||
}
|
||||
|
@ -61,7 +54,7 @@ impl<O: IsA<URIHandler>> URIHandlerExt for O {
|
|||
fn set_uri(&self, uri: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = gst_sys::gst_uri_handler_set_uri(
|
||||
let _ = ffi::gst_uri_handler_set_uri(
|
||||
self.as_ref().to_glib_none().0,
|
||||
uri.to_glib_none().0,
|
||||
&mut error,
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ 062b3d6)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ b84cead5)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 694b4b8)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 58bda97d)
|
||||
|
|
Loading…
Reference in a new issue