Initial commit

Requires
  https://github.com/gtk-rs/gir/pull/365
  https://github.com/gtk-rs/gir/pull/364
to be merged for autogeneration of the bindings.

Requires
  https://github.com/gtk-rs/gir/issues/367
for fixing memory leaks.
This commit is contained in:
Sebastian Dröge 2017-05-12 14:24:03 +02:00
commit 15b08a4293
29 changed files with 157381 additions and 0 deletions

92
Cargo.lock generated Normal file
View file

@ -0,0 +1,92 @@
[root]
name = "gstreamer"
version = "0.1.0"
dependencies = [
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glib 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gstreamer-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "bitflags"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "glib"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "glib-sys"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gobject-sys"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gstreamer-sys"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"glib-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"gobject-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23"
"checksum bitflags 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1370e9fc2a6ae53aea8b7a5110edbd08836ed87c88736dfabccade1c2b44bff4"
"checksum glib 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "81f514a8abd315ede0e94e39ce5987fdb99191c5f812e5066bc5bdb965104fc4"
"checksum glib-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8826cbc94631507bdd91ee40f7e099bfaa3cc4f43c086b4d1c15cff5b4e8220b"
"checksum gobject-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "87373f64e136e9ea192ff5d3ef676a51e9ac6ab06b629223a081e0523c5f04e2"
"checksum gstreamer-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "455214f6423a4db5727adf781355a3df068fc48c61c05ddb597aaadd51fe43ab"
"checksum lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf"
"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"

5
Cargo.toml Normal file
View file

@ -0,0 +1,5 @@
[workspace]
members = [
"gstreamer",
]

41
Gir_Gst.toml Normal file
View file

@ -0,0 +1,41 @@
[options]
girs_dir = "gir-files"
library = "Gst"
version = "1.0"
min_cfg_version = "1.0"
target_path = "gstreamer"
work_mode = "normal"
external_libraries = [
"GLib",
"GObject",
]
generate = [
"Gst.Object",
"Gst.Bus",
"Gst.Clock",
"Gst.ClockTime",
"Gst.Element",
"Gst.Bin",
"Gst.Pipeline",
"Gst.State",
"Gst.StateChangeReturn",
"Gst.StateChange",
"Gst.SeekFlags",
"Gst.SeekType",
"Gst.Pad",
"Gst.FlowReturn",
"Gst.PadDirection",
"Gst.PadTemplate",
"Gst.URIHandler",
"Gst.URIType",
"Gst.ElementFactory",
"Gst.ElementFactoryListType",
"Gst.Format",
]
manual = [
"GLib.Error",
#"Gst.Message",
]

48803
gir-files/GLib-2.0.gir Normal file

File diff suppressed because it is too large Load diff

277
gir-files/GModule-2.0.gir Normal file
View file

@ -0,0 +1,277 @@
<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations. -->
<repository version="1.2"
xmlns="http://www.gtk.org/introspection/core/1.0"
xmlns:c="http://www.gtk.org/introspection/c/1.0"
xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
<include name="GLib" version="2.0"/>
<package name="gmodule-2.0"/>
<c:include name="gmodule.h"/>
<namespace name="GModule"
version="2.0"
shared-library="libgmodule-2.0.so.0"
c:identifier-prefixes="G"
c:symbol-prefixes="g">
<record name="Module" c:type="GModule" disguised="1">
<doc xml:space="preserve">The #GModule struct is an opaque data structure to represent a
[dynamically-loaded module][glib-Dynamic-Loading-of-Modules].
It should only be accessed via the following functions.</doc>
<method name="close" c:identifier="g_module_close">
<doc xml:space="preserve">Closes a module.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">a #GModule to close</doc>
<type name="Module" c:type="GModule*"/>
</instance-parameter>
</parameters>
</method>
<method name="make_resident" c:identifier="g_module_make_resident">
<doc xml:space="preserve">Ensures that a module will never be unloaded.
Any future g_module_close() calls on the module will be ignored.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<instance-parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">a #GModule to make permanently resident</doc>
<type name="Module" c:type="GModule*"/>
</instance-parameter>
</parameters>
</method>
<method name="name" c:identifier="g_module_name">
<doc xml:space="preserve">Returns the filename that the module was opened with.
If @module refers to the application itself, "main" is returned.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">the filename of the module</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<instance-parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">a #GModule</doc>
<type name="Module" c:type="GModule*"/>
</instance-parameter>
</parameters>
</method>
<method name="symbol" c:identifier="g_module_symbol">
<doc xml:space="preserve">Gets a symbol pointer from a module, such as one exported
by #G_MODULE_EXPORT. Note that a valid symbol can be %NULL.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE on success</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
<parameters>
<instance-parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">a #GModule</doc>
<type name="Module" c:type="GModule*"/>
</instance-parameter>
<parameter name="symbol_name" transfer-ownership="none">
<doc xml:space="preserve">the name of the symbol to find</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="symbol"
direction="out"
caller-allocates="0"
transfer-ownership="full"
nullable="1">
<doc xml:space="preserve">returns the pointer to the symbol value</doc>
<type name="gpointer" c:type="gpointer*"/>
</parameter>
</parameters>
</method>
<function name="build_path" c:identifier="g_module_build_path">
<doc xml:space="preserve">A portable way to build the filename of a module. The platform-specific
prefix and suffix are added to the filename, if needed, and the result
is added to the directory, using the correct separator character.
The directory should specify the directory where the module can be found.
It can be %NULL or an empty string to indicate that the module is in a
standard platform-specific directory, though this is not recommended
since the wrong module may be found.
For example, calling g_module_build_path() on a Linux system with a
@directory of `/lib` and a @module_name of "mylibrary" will return
`/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the
directory it will return `\Windows\mylibrary.dll`.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">the complete path of the module, including the standard library
prefix and suffix. This should be freed when no longer needed</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
<parameter name="directory"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">the directory where the module is. This can be
%NULL or the empty string to indicate that the standard platform-specific
directories will be used, though that is not recommended</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="module_name" transfer-ownership="none">
<doc xml:space="preserve">the name of the module</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</function>
<function name="error" c:identifier="g_module_error">
<doc xml:space="preserve">Gets a string describing the last module error.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a string describing the last module error</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
</function>
<function name="open" c:identifier="g_module_open" introspectable="0">
<doc xml:space="preserve">Opens a module. If the module has already been opened,
its reference count is incremented.
First of all g_module_open() tries to open @file_name as a module.
If that fails and @file_name has the ".la"-suffix (and is a libtool
archive) it tries to open the corresponding module. If that fails
and it doesn't have the proper module suffix for the platform
(#G_MODULE_SUFFIX), this suffix will be appended and the corresponding
module will be opended. If that fails and @file_name doesn't have the
".la"-suffix, this suffix is appended and g_module_open() tries to open
the corresponding module. If eventually that fails as well, %NULL is
returned.</doc>
<return-value>
<doc xml:space="preserve">a #GModule on success, or %NULL on failure</doc>
<type name="Module" c:type="GModule*"/>
</return-value>
<parameters>
<parameter name="file_name"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">the name of the file containing the module, or %NULL
to obtain a #GModule representing the main program itself</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="flags" transfer-ownership="none">
<doc xml:space="preserve">the flags used for opening the module. This can be the
logical OR of any of the #GModuleFlags</doc>
<type name="ModuleFlags" c:type="GModuleFlags"/>
</parameter>
</parameters>
</function>
<function name="supported" c:identifier="g_module_supported">
<doc xml:space="preserve">Checks if modules are supported on the current platform.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if modules are supported</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
</function>
</record>
<callback name="ModuleCheckInit" c:type="GModuleCheckInit">
<doc xml:space="preserve">Specifies the type of the module initialization function.
If a module contains a function named g_module_check_init() it is called
automatically when the module is loaded. It is passed the #GModule structure
and should return %NULL on success or a string describing the initialization
error.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%NULL on success, or a string describing the initialization error</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
<parameters>
<parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">the #GModule corresponding to the module which has just been loaded</doc>
<type name="Module" c:type="GModule*"/>
</parameter>
</parameters>
</callback>
<bitfield name="ModuleFlags" c:type="GModuleFlags">
<doc xml:space="preserve">Flags passed to g_module_open().
Note that these flags are not supported on all platforms.</doc>
<member name="lazy" value="1" c:identifier="G_MODULE_BIND_LAZY">
<doc xml:space="preserve">specifies that symbols are only resolved when
needed. The default action is to bind all symbols when the module
is loaded.</doc>
</member>
<member name="local" value="2" c:identifier="G_MODULE_BIND_LOCAL">
<doc xml:space="preserve">specifies that symbols in the module should
not be added to the global name space. The default action on most
platforms is to place symbols in the module in the global name space,
which may cause conflicts with existing symbols.</doc>
</member>
<member name="mask" value="3" c:identifier="G_MODULE_BIND_MASK">
<doc xml:space="preserve">mask for all flags.</doc>
</member>
</bitfield>
<callback name="ModuleUnload" c:type="GModuleUnload">
<doc xml:space="preserve">Specifies the type of the module function called when it is unloaded.
If a module contains a function named g_module_unload() it is called
automatically when the module is unloaded.
It is passed the #GModule structure.</doc>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="module" transfer-ownership="none">
<doc xml:space="preserve">the #GModule about to be unloaded</doc>
<type name="Module" c:type="GModule*"/>
</parameter>
</parameters>
</callback>
<function name="module_build_path"
c:identifier="g_module_build_path"
moved-to="Module.build_path">
<doc xml:space="preserve">A portable way to build the filename of a module. The platform-specific
prefix and suffix are added to the filename, if needed, and the result
is added to the directory, using the correct separator character.
The directory should specify the directory where the module can be found.
It can be %NULL or an empty string to indicate that the module is in a
standard platform-specific directory, though this is not recommended
since the wrong module may be found.
For example, calling g_module_build_path() on a Linux system with a
@directory of `/lib` and a @module_name of "mylibrary" will return
`/lib/libmylibrary.so`. On a Windows system, using `\Windows` as the
directory it will return `\Windows\mylibrary.dll`.</doc>
<return-value transfer-ownership="full">
<doc xml:space="preserve">the complete path of the module, including the standard library
prefix and suffix. This should be freed when no longer needed</doc>
<type name="utf8" c:type="gchar*"/>
</return-value>
<parameters>
<parameter name="directory"
transfer-ownership="none"
nullable="1"
allow-none="1">
<doc xml:space="preserve">the directory where the module is. This can be
%NULL or the empty string to indicate that the standard platform-specific
directories will be used, though that is not recommended</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
<parameter name="module_name" transfer-ownership="none">
<doc xml:space="preserve">the name of the module</doc>
<type name="utf8" c:type="const gchar*"/>
</parameter>
</parameters>
</function>
<function name="module_error"
c:identifier="g_module_error"
moved-to="Module.error">
<doc xml:space="preserve">Gets a string describing the last module error.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">a string describing the last module error</doc>
<type name="utf8" c:type="const gchar*"/>
</return-value>
</function>
<function name="module_supported"
c:identifier="g_module_supported"
moved-to="Module.supported">
<doc xml:space="preserve">Checks if modules are supported on the current platform.</doc>
<return-value transfer-ownership="none">
<doc xml:space="preserve">%TRUE if modules are supported</doc>
<type name="gboolean" c:type="gboolean"/>
</return-value>
</function>
</namespace>
</repository>

15763
gir-files/GObject-2.0.gir Normal file

File diff suppressed because it is too large Load diff

48176
gir-files/Gst-1.0.gir Normal file

File diff suppressed because it is too large Load diff

1824
gir-files/GstApp-1.0.gir Normal file

File diff suppressed because it is too large Load diff

8932
gir-files/GstAudio-1.0.gir Normal file

File diff suppressed because it is too large Load diff

11120
gir-files/GstBase-1.0.gir Normal file

File diff suppressed because it is too large Load diff

3976
gir-files/GstPbutils-1.0.gir Normal file

File diff suppressed because it is too large Load diff

1799
gir-files/GstTag-1.0.gir Normal file

File diff suppressed because it is too large Load diff

13325
gir-files/GstVideo-1.0.gir Normal file

File diff suppressed because it is too large Load diff

12
gstreamer/Cargo.toml Normal file
View file

@ -0,0 +1,12 @@
[package]
name = "gstreamer"
version = "0.1.0"
authors = ["Sebastian Dröge <sebastian@centricular.com>"]
[dependencies]
bitflags = "0.8"
libc = "0.2"
glib-sys = "0.3.4"
gobject-sys = "0.3.4"
gstreamer-sys = "0.1.1"
glib = "0.1.3"

View file

@ -0,0 +1,5 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
pub type ClockTime = u64;
pub type ElementFactoryListType = u64;

297
gstreamer/src/auto/bin.rs Normal file
View file

@ -0,0 +1,297 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Element;
use Object;
use Pad;
use PadDirection;
use ffi;
use glib;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct Bin(Object<ffi::GstBin>): Element, Object;
match fn {
get_type => || ffi::gst_bin_get_type(),
}
}
impl Bin {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P) -> Bin {
let name = name.into();
let name = name.to_glib_none();
unsafe {
Element::from_glib_none(ffi::gst_bin_new(name.0)).downcast_unchecked()
}
}
}
pub trait BinExt {
fn add<P: IsA<Element>>(&self, element: &P) -> bool;
//fn add_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
fn find_unlinked_pad(&self, direction: PadDirection) -> Option<Pad>;
fn get_by_interface(&self, iface: glib::types::Type) -> Option<Element>;
fn get_by_name(&self, name: &str) -> Option<Element>;
fn get_by_name_recurse_up(&self, name: &str) -> Option<Element>;
//#[cfg(feature = "v1_10")]
//fn get_suppressed_flags(&self) -> /*Ignored*/ElementFlags;
//fn iterate_all_by_interface(&self, iface: glib::types::Type) -> /*Ignored*/Option<Iterator>;
//fn iterate_elements(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_recurse(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_sinks(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_sorted(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_sources(&self) -> /*Ignored*/Option<Iterator>;
fn recalculate_latency(&self) -> bool;
fn remove<P: IsA<Element>>(&self, element: &P) -> bool;
//fn remove_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
//#[cfg(feature = "v1_10")]
//fn set_suppressed_flags(&self, flags: /*Ignored*/ElementFlags);
#[cfg(feature = "v1_6")]
fn sync_children_states(&self) -> bool;
fn get_property_async_handling(&self) -> bool;
fn set_property_async_handling(&self, async_handling: bool);
fn get_property_message_forward(&self) -> bool;
fn set_property_message_forward(&self, message_forward: bool);
#[cfg(feature = "v1_10")]
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64;
#[cfg(feature = "v1_10")]
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64;
fn connect_do_latency<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> u64;
fn connect_element_added<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64;
fn connect_element_removed<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Bin> + IsA<glib::object::Object>> BinExt for O {
fn add<P: IsA<Element>>(&self, element: &P) -> bool {
unsafe {
from_glib(ffi::gst_bin_add(self.to_glib_none().0, element.to_glib_full()))
}
}
//fn add_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_bin_add_many() }
//}
fn find_unlinked_pad(&self, direction: PadDirection) -> Option<Pad> {
unsafe {
from_glib_full(ffi::gst_bin_find_unlinked_pad(self.to_glib_none().0, direction.to_glib()))
}
}
fn get_by_interface(&self, iface: glib::types::Type) -> Option<Element> {
unsafe {
from_glib_full(ffi::gst_bin_get_by_interface(self.to_glib_none().0, iface.to_glib()))
}
}
fn get_by_name(&self, name: &str) -> Option<Element> {
unsafe {
from_glib_full(ffi::gst_bin_get_by_name(self.to_glib_none().0, name.to_glib_none().0))
}
}
fn get_by_name_recurse_up(&self, name: &str) -> Option<Element> {
unsafe {
from_glib_full(ffi::gst_bin_get_by_name_recurse_up(self.to_glib_none().0, name.to_glib_none().0))
}
}
//#[cfg(feature = "v1_10")]
//fn get_suppressed_flags(&self) -> /*Ignored*/ElementFlags {
// unsafe { TODO: call ffi::gst_bin_get_suppressed_flags() }
//}
//fn iterate_all_by_interface(&self, iface: glib::types::Type) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_all_by_interface() }
//}
//fn iterate_elements(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_elements() }
//}
//fn iterate_recurse(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_recurse() }
//}
//fn iterate_sinks(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_sinks() }
//}
//fn iterate_sorted(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_sorted() }
//}
//fn iterate_sources(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_bin_iterate_sources() }
//}
fn recalculate_latency(&self) -> bool {
unsafe {
from_glib(ffi::gst_bin_recalculate_latency(self.to_glib_none().0))
}
}
fn remove<P: IsA<Element>>(&self, element: &P) -> bool {
unsafe {
from_glib(ffi::gst_bin_remove(self.to_glib_none().0, element.to_glib_none().0))
}
}
//fn remove_many<P: IsA<Element>>(&self, element_1: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_bin_remove_many() }
//}
//#[cfg(feature = "v1_10")]
//fn set_suppressed_flags(&self, flags: /*Ignored*/ElementFlags) {
// unsafe { TODO: call ffi::gst_bin_set_suppressed_flags() }
//}
#[cfg(feature = "v1_6")]
fn sync_children_states(&self) -> bool {
unsafe {
from_glib(ffi::gst_bin_sync_children_states(self.to_glib_none().0))
}
}
fn get_property_async_handling(&self) -> bool {
let mut value = Value::from(&false);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "async-handling".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
fn set_property_async_handling(&self, async_handling: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "async-handling".to_glib_none().0, Value::from(&async_handling).to_glib_none().0);
}
}
fn get_property_message_forward(&self) -> bool {
let mut value = Value::from(&false);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "message-forward".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
fn set_property_message_forward(&self, message_forward: bool) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "message-forward".to_glib_none().0, Value::from(&message_forward).to_glib_none().0);
}
}
#[cfg(feature = "v1_10")]
fn connect_deep_element_added<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "deep-element-added",
transmute(deep_element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
#[cfg(feature = "v1_10")]
fn connect_deep_element_removed<F: Fn(&Self, &Bin, &Element) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Bin, &Element) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "deep-element-removed",
transmute(deep_element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_do_latency<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self) -> bool + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "do-latency",
transmute(do_latency_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_element_added<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "element-added",
transmute(element_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_element_removed<F: Fn(&Self, &Element) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Element) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "element-removed",
transmute(element_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
#[cfg(feature = "v1_10")]
unsafe extern "C" fn deep_element_added_trampoline<P>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Bin, &Element) + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(sub_bin), &from_glib_none(element))
}
#[cfg(feature = "v1_10")]
unsafe extern "C" fn deep_element_removed_trampoline<P>(this: *mut ffi::GstBin, sub_bin: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Bin, &Element) + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(sub_bin), &from_glib_none(element))
}
unsafe extern "C" fn do_latency_trampoline<P>(this: *mut ffi::GstBin, f: glib_ffi::gpointer) -> glib_ffi::gboolean
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P) -> bool + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked()).to_glib()
}
unsafe extern "C" fn element_added_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Element) + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element))
}
unsafe extern "C" fn element_removed_trampoline<P>(this: *mut ffi::GstBin, element: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Bin> {
callback_guard!();
let f: &Box_<Fn(&P, &Element) + 'static> = transmute(f);
f(&Bin::from_glib_none(this).downcast_unchecked(), &from_glib_none(element))
}

183
gstreamer/src/auto/bus.rs Normal file
View file

@ -0,0 +1,183 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Object;
use ffi;
use glib::object::IsA;
use glib::translate::*;
glib_wrapper! {
pub struct Bus(Object<ffi::GstBus>): Object;
match fn {
get_type => || ffi::gst_bus_get_type(),
}
}
impl Bus {
pub fn new() -> Bus {
unsafe {
from_glib_full(ffi::gst_bus_new())
}
}
}
pub trait BusExt {
fn add_signal_watch(&self);
fn add_signal_watch_full(&self, priority: i32);
//fn add_watch<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/BusFunc, user_data: P) -> u32;
//fn add_watch_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priority: i32, func: /*Unknown conversion*//*Unimplemented*/BusFunc, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> u32;
//fn async_signal_func<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: /*Ignored*/&mut Message, data: P) -> bool;
//fn create_watch(&self) -> /*Ignored*/Option<glib::Source>;
fn disable_sync_message_emission(&self);
fn enable_sync_message_emission(&self);
fn have_pending(&self) -> bool;
//fn peek(&self) -> /*Ignored*/Option<Message>;
//fn poll(&self, events: /*Ignored*/MessageType, timeout: ClockTime) -> /*Ignored*/Option<Message>;
//fn pop(&self) -> /*Ignored*/Option<Message>;
//fn pop_filtered(&self, types: /*Ignored*/MessageType) -> /*Ignored*/Option<Message>;
//fn post(&self, message: /*Ignored*/&mut Message) -> bool;
fn remove_signal_watch(&self);
#[cfg(feature = "v1_6")]
fn remove_watch(&self) -> bool;
fn set_flushing(&self, flushing: bool);
//fn set_sync_handler<'a, P: Into<Option<&'a /*Unimplemented*/BusSyncHandler>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn sync_signal_handler<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: /*Ignored*/&mut Message, data: P) -> /*Ignored*/BusSyncReply;
//fn timed_pop(&self, timeout: ClockTime) -> /*Ignored*/Option<Message>;
//fn timed_pop_filtered(&self, timeout: ClockTime, types: /*Ignored*/MessageType) -> /*Ignored*/Option<Message>;
//fn connect_message<Unsupported or ignored types>(&self, f: F) -> u64;
//fn connect_sync_message<Unsupported or ignored types>(&self, f: F) -> u64;
}
impl<O: IsA<Bus>> BusExt for O {
fn add_signal_watch(&self) {
unsafe {
ffi::gst_bus_add_signal_watch(self.to_glib_none().0);
}
}
fn add_signal_watch_full(&self, priority: i32) {
unsafe {
ffi::gst_bus_add_signal_watch_full(self.to_glib_none().0, priority);
}
}
//fn add_watch<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/BusFunc, user_data: P) -> u32 {
// unsafe { TODO: call ffi::gst_bus_add_watch() }
//}
//fn add_watch_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priority: i32, func: /*Unknown conversion*//*Unimplemented*/BusFunc, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> u32 {
// unsafe { TODO: call ffi::gst_bus_add_watch_full() }
//}
//fn async_signal_func<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: /*Ignored*/&mut Message, data: P) -> bool {
// unsafe { TODO: call ffi::gst_bus_async_signal_func() }
//}
//fn create_watch(&self) -> /*Ignored*/Option<glib::Source> {
// unsafe { TODO: call ffi::gst_bus_create_watch() }
//}
fn disable_sync_message_emission(&self) {
unsafe {
ffi::gst_bus_disable_sync_message_emission(self.to_glib_none().0);
}
}
fn enable_sync_message_emission(&self) {
unsafe {
ffi::gst_bus_enable_sync_message_emission(self.to_glib_none().0);
}
}
fn have_pending(&self) -> bool {
unsafe {
from_glib(ffi::gst_bus_have_pending(self.to_glib_none().0))
}
}
//fn peek(&self) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_peek() }
//}
//fn poll(&self, events: /*Ignored*/MessageType, timeout: ClockTime) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_poll() }
//}
//fn pop(&self) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_pop() }
//}
//fn pop_filtered(&self, types: /*Ignored*/MessageType) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_pop_filtered() }
//}
//fn post(&self, message: /*Ignored*/&mut Message) -> bool {
// unsafe { TODO: call ffi::gst_bus_post() }
//}
fn remove_signal_watch(&self) {
unsafe {
ffi::gst_bus_remove_signal_watch(self.to_glib_none().0);
}
}
#[cfg(feature = "v1_6")]
fn remove_watch(&self) -> bool {
unsafe {
from_glib(ffi::gst_bus_remove_watch(self.to_glib_none().0))
}
}
fn set_flushing(&self, flushing: bool) {
unsafe {
ffi::gst_bus_set_flushing(self.to_glib_none().0, flushing.to_glib());
}
}
//fn set_sync_handler<'a, P: Into<Option<&'a /*Unimplemented*/BusSyncHandler>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: P, user_data: Q, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_bus_set_sync_handler() }
//}
//fn sync_signal_handler<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, message: /*Ignored*/&mut Message, data: P) -> /*Ignored*/BusSyncReply {
// unsafe { TODO: call ffi::gst_bus_sync_signal_handler() }
//}
//fn timed_pop(&self, timeout: ClockTime) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_timed_pop() }
//}
//fn timed_pop_filtered(&self, timeout: ClockTime, types: /*Ignored*/MessageType) -> /*Ignored*/Option<Message> {
// unsafe { TODO: call ffi::gst_bus_timed_pop_filtered() }
//}
//fn connect_message<Unsupported or ignored types>(&self, f: F) -> u64 {
// Ignored message: Gst.Message
//}
//fn connect_sync_message<Unsupported or ignored types>(&self, f: F) -> u64 {
// Ignored message: Gst.Message
//}
}

324
gstreamer/src/auto/clock.rs Normal file
View file

@ -0,0 +1,324 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use ClockTime;
use Object;
use ffi;
use glib;
use glib::Value;
#[cfg(feature = "v1_6")]
use glib::object::Downcast;
use glib::object::IsA;
#[cfg(feature = "v1_6")]
use glib::signal::connect;
use glib::translate::*;
#[cfg(feature = "v1_6")]
use glib_ffi;
use gobject_ffi;
#[cfg(feature = "v1_6")]
use std::boxed::Box as Box_;
use std::mem;
#[cfg(feature = "v1_6")]
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct Clock(Object<ffi::GstClock>): Object;
match fn {
get_type => || ffi::gst_clock_get_type(),
}
}
impl Clock {
//pub fn id_compare_func<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(id1: P, id2: Q) -> i32 {
// unsafe { TODO: call ffi::gst_clock_id_compare_func() }
//}
//pub fn id_get_time(id: /*Unimplemented*/ClockID) -> ClockTime {
// unsafe { TODO: call ffi::gst_clock_id_get_time() }
//}
//pub fn id_ref(id: /*Unimplemented*/ClockID) -> /*Unimplemented*/Option<ClockID> {
// unsafe { TODO: call ffi::gst_clock_id_ref() }
//}
//pub fn id_unref(id: /*Unimplemented*/ClockID) {
// unsafe { TODO: call ffi::gst_clock_id_unref() }
//}
//pub fn id_unschedule(id: /*Unimplemented*/ClockID) {
// unsafe { TODO: call ffi::gst_clock_id_unschedule() }
//}
//pub fn id_wait(id: /*Unimplemented*/ClockID) -> (/*Ignored*/ClockReturn, ClockTimeDiff) {
// unsafe { TODO: call ffi::gst_clock_id_wait() }
//}
//pub fn id_wait_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(id: /*Unimplemented*/ClockID, func: /*Unknown conversion*//*Unimplemented*/ClockCallback, user_data: P, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> /*Ignored*/ClockReturn {
// unsafe { TODO: call ffi::gst_clock_id_wait_async() }
//}
}
pub trait ClockExt {
fn add_observation(&self, slave: ClockTime, master: ClockTime) -> Option<f64>;
#[cfg(feature = "v1_6")]
fn add_observation_unapplied(&self, slave: ClockTime, master: ClockTime) -> Option<(f64, ClockTime, ClockTime, ClockTime, ClockTime)>;
fn adjust_unlocked(&self, internal: ClockTime) -> ClockTime;
#[cfg(feature = "v1_6")]
fn adjust_with_calibration(&self, internal_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime;
fn get_calibration(&self) -> (ClockTime, ClockTime, ClockTime, ClockTime);
fn get_internal_time(&self) -> ClockTime;
fn get_master(&self) -> Option<Clock>;
fn get_resolution(&self) -> ClockTime;
fn get_time(&self) -> ClockTime;
fn get_timeout(&self) -> ClockTime;
#[cfg(feature = "v1_6")]
fn is_synced(&self) -> bool;
//fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> /*Unimplemented*/Option<ClockID>;
//fn new_single_shot_id(&self, time: ClockTime) -> /*Unimplemented*/Option<ClockID>;
//fn periodic_id_reinit(&self, id: /*Unimplemented*/ClockID, start_time: ClockTime, interval: ClockTime) -> bool;
fn set_calibration(&self, internal: ClockTime, external: ClockTime, rate_num: ClockTime, rate_denom: ClockTime);
fn set_master<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, master: Q) -> bool;
fn set_resolution(&self, resolution: ClockTime) -> ClockTime;
#[cfg(feature = "v1_6")]
fn set_synced(&self, synced: bool);
fn set_timeout(&self, timeout: ClockTime);
//fn single_shot_id_reinit(&self, id: /*Unimplemented*/ClockID, time: ClockTime) -> bool;
fn unadjust_unlocked(&self, external: ClockTime) -> ClockTime;
#[cfg(feature = "v1_8")]
fn unadjust_with_calibration(&self, external_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime;
#[cfg(feature = "v1_6")]
fn wait_for_sync(&self, timeout: ClockTime) -> bool;
fn get_property_window_size(&self) -> i32;
fn set_property_window_size(&self, window_size: i32);
fn get_property_window_threshold(&self) -> i32;
fn set_property_window_threshold(&self, window_threshold: i32);
#[cfg(feature = "v1_6")]
fn connect_synced<F: Fn(&Self, bool) + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Clock> + IsA<glib::object::Object>> ClockExt for O {
fn add_observation(&self, slave: ClockTime, master: ClockTime) -> Option<f64> {
unsafe {
let mut r_squared = mem::uninitialized();
let ret = from_glib(ffi::gst_clock_add_observation(self.to_glib_none().0, slave, master, &mut r_squared));
if ret { Some(r_squared) } else { None }
}
}
#[cfg(feature = "v1_6")]
fn add_observation_unapplied(&self, slave: ClockTime, master: ClockTime) -> Option<(f64, ClockTime, ClockTime, ClockTime, ClockTime)> {
unsafe {
let mut r_squared = mem::uninitialized();
let mut internal = mem::uninitialized();
let mut external = mem::uninitialized();
let mut rate_num = mem::uninitialized();
let mut rate_denom = mem::uninitialized();
let ret = from_glib(ffi::gst_clock_add_observation_unapplied(self.to_glib_none().0, slave, master, &mut r_squared, &mut internal, &mut external, &mut rate_num, &mut rate_denom));
if ret { Some((r_squared, internal, external, rate_num, rate_denom)) } else { None }
}
}
fn adjust_unlocked(&self, internal: ClockTime) -> ClockTime {
unsafe {
ffi::gst_clock_adjust_unlocked(self.to_glib_none().0, internal)
}
}
#[cfg(feature = "v1_6")]
fn adjust_with_calibration(&self, internal_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime {
unsafe {
ffi::gst_clock_adjust_with_calibration(self.to_glib_none().0, internal_target, cinternal, cexternal, cnum, cdenom)
}
}
fn get_calibration(&self) -> (ClockTime, ClockTime, ClockTime, ClockTime) {
unsafe {
let mut internal = mem::uninitialized();
let mut external = mem::uninitialized();
let mut rate_num = mem::uninitialized();
let mut rate_denom = mem::uninitialized();
ffi::gst_clock_get_calibration(self.to_glib_none().0, &mut internal, &mut external, &mut rate_num, &mut rate_denom);
(internal, external, rate_num, rate_denom)
}
}
fn get_internal_time(&self) -> ClockTime {
unsafe {
ffi::gst_clock_get_internal_time(self.to_glib_none().0)
}
}
fn get_master(&self) -> Option<Clock> {
unsafe {
from_glib_full(ffi::gst_clock_get_master(self.to_glib_none().0))
}
}
fn get_resolution(&self) -> ClockTime {
unsafe {
ffi::gst_clock_get_resolution(self.to_glib_none().0)
}
}
fn get_time(&self) -> ClockTime {
unsafe {
ffi::gst_clock_get_time(self.to_glib_none().0)
}
}
fn get_timeout(&self) -> ClockTime {
unsafe {
ffi::gst_clock_get_timeout(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_6")]
fn is_synced(&self) -> bool {
unsafe {
from_glib(ffi::gst_clock_is_synced(self.to_glib_none().0))
}
}
//fn new_periodic_id(&self, start_time: ClockTime, interval: ClockTime) -> /*Unimplemented*/Option<ClockID> {
// unsafe { TODO: call ffi::gst_clock_new_periodic_id() }
//}
//fn new_single_shot_id(&self, time: ClockTime) -> /*Unimplemented*/Option<ClockID> {
// 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 ffi::gst_clock_periodic_id_reinit() }
//}
fn set_calibration(&self, internal: ClockTime, external: ClockTime, rate_num: ClockTime, rate_denom: ClockTime) {
unsafe {
ffi::gst_clock_set_calibration(self.to_glib_none().0, internal, external, rate_num, rate_denom);
}
}
fn set_master<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, master: Q) -> bool {
let master = master.into();
let master = master.to_glib_none();
unsafe {
from_glib(ffi::gst_clock_set_master(self.to_glib_none().0, master.0))
}
}
fn set_resolution(&self, resolution: ClockTime) -> ClockTime {
unsafe {
ffi::gst_clock_set_resolution(self.to_glib_none().0, resolution)
}
}
#[cfg(feature = "v1_6")]
fn set_synced(&self, synced: bool) {
unsafe {
ffi::gst_clock_set_synced(self.to_glib_none().0, synced.to_glib());
}
}
fn set_timeout(&self, timeout: ClockTime) {
unsafe {
ffi::gst_clock_set_timeout(self.to_glib_none().0, timeout);
}
}
//fn single_shot_id_reinit(&self, id: /*Unimplemented*/ClockID, time: ClockTime) -> bool {
// unsafe { TODO: call ffi::gst_clock_single_shot_id_reinit() }
//}
fn unadjust_unlocked(&self, external: ClockTime) -> ClockTime {
unsafe {
ffi::gst_clock_unadjust_unlocked(self.to_glib_none().0, external)
}
}
#[cfg(feature = "v1_8")]
fn unadjust_with_calibration(&self, external_target: ClockTime, cinternal: ClockTime, cexternal: ClockTime, cnum: ClockTime, cdenom: ClockTime) -> ClockTime {
unsafe {
ffi::gst_clock_unadjust_with_calibration(self.to_glib_none().0, external_target, cinternal, cexternal, cnum, cdenom)
}
}
#[cfg(feature = "v1_6")]
fn wait_for_sync(&self, timeout: ClockTime) -> bool {
unsafe {
from_glib(ffi::gst_clock_wait_for_sync(self.to_glib_none().0, timeout))
}
}
fn get_property_window_size(&self) -> i32 {
let mut value = Value::from(&0);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-size".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
fn set_property_window_size(&self, window_size: i32) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "window-size".to_glib_none().0, Value::from(&window_size).to_glib_none().0);
}
}
fn get_property_window_threshold(&self) -> i32 {
let mut value = Value::from(&0);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "window-threshold".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get().unwrap()
}
fn set_property_window_threshold(&self, window_threshold: i32) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "window-threshold".to_glib_none().0, Value::from(&window_threshold).to_glib_none().0);
}
}
#[cfg(feature = "v1_6")]
fn connect_synced<F: Fn(&Self, bool) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, bool) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "synced",
transmute(synced_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
#[cfg(feature = "v1_6")]
unsafe extern "C" fn synced_trampoline<P>(this: *mut ffi::GstClock, synced: glib_ffi::gboolean, f: glib_ffi::gpointer)
where P: IsA<Clock> {
callback_guard!();
let f: &Box_<Fn(&P, bool) + 'static> = transmute(f);
f(&Clock::from_glib_none(this).downcast_unchecked(), from_glib(synced))
}

View file

@ -0,0 +1,587 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Bus;
use Clock;
use ClockTime;
use ElementFactory;
use Error;
use Format;
use Object;
use Pad;
use PadTemplate;
use SeekFlags;
use SeekType;
use State;
use StateChange;
use StateChangeReturn;
use URIType;
use ffi;
use glib;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
#[cfg(feature = "v1_10")]
use libc;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct Element(Object<ffi::GstElement>): Object;
match fn {
get_type => || ffi::gst_element_get_type(),
}
}
impl Element {
pub fn make_from_uri<'a, P: Into<Option<&'a str>>>(type_: URIType, uri: &str, elementname: P) -> Result<Element, Error> {
let elementname = elementname.into();
let elementname = elementname.to_glib_none();
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::gst_element_make_from_uri(type_.to_glib(), uri.to_glib_none().0, elementname.0, &mut error);
if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) }
}
}
//pub fn register<'a, P: Into<Option<&'a /*Ignored*/Plugin>>>(plugin: P, name: &str, rank: u32, type_: glib::types::Type) -> bool {
// unsafe { TODO: call ffi::gst_element_register() }
//}
pub fn state_change_return_get_name(state_ret: StateChangeReturn) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_element_state_change_return_get_name(state_ret.to_glib()))
}
}
pub fn state_get_name(state: State) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_element_state_get_name(state.to_glib()))
}
}
}
pub trait ElementExt {
fn abort_state(&self);
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> bool;
#[cfg(feature = "v1_10")]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong;
#[cfg(feature = "v1_10")]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong;
//#[cfg(feature = "v1_10")]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn change_state(&self, transition: StateChange) -> StateChangeReturn;
fn continue_state(&self, ret: StateChangeReturn) -> StateChangeReturn;
fn create_all_pads(&self);
fn get_base_time(&self) -> ClockTime;
fn get_bus(&self) -> Option<Bus>;
fn get_clock(&self) -> Option<Clock>;
//fn get_compatible_pad<'a, P: IsA<Pad>, Q: Into<Option<&'a /*Ignored*/Caps>>>(&self, pad: &P, caps: Q) -> Option<Pad>;
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate>;
//#[cfg(feature = "v1_8")]
//fn get_context(&self, context_type: &str) -> /*Ignored*/Option<Context>;
//#[cfg(feature = "v1_8")]
//fn get_context_unlocked(&self, context_type: &str) -> /*Ignored*/Option<Context>;
//#[cfg(feature = "v1_8")]
//fn get_contexts(&self) -> /*Ignored*/Vec<Context>;
fn get_factory(&self) -> Option<ElementFactory>;
fn get_request_pad(&self, name: &str) -> Option<Pad>;
fn get_start_time(&self) -> ClockTime;
fn get_state(&self, timeout: ClockTime) -> (StateChangeReturn, State, State);
fn get_static_pad(&self, name: &str) -> Option<Pad>;
fn is_locked_state(&self) -> bool;
//fn iterate_pads(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_sink_pads(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_src_pads(&self) -> /*Ignored*/Option<Iterator>;
fn link<P: IsA<Element>>(&self, dest: &P) -> bool;
//fn link_filtered<'a, P: IsA<Element>, Q: Into<Option<&'a /*Ignored*/Caps>>>(&self, dest: &P, filter: Q) -> bool;
//fn link_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> bool;
fn link_pads<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> bool;
//fn link_pads_filtered<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>, S: Into<Option<&'c /*Ignored*/Caps>>>(&self, srcpadname: P, dest: &Q, destpadname: R, filter: S) -> bool;
//fn link_pads_full<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>>(&self, srcpadname: P, dest: &Q, destpadname: R, flags: /*Ignored*/PadLinkCheck) -> bool;
fn lost_state(&self);
//fn message_full<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: P, debug: Q, file: &str, function: &str, line: i32);
//#[cfg(feature = "v1_10")]
//fn message_full_with_details<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: P, debug: Q, file: &str, function: &str, line: i32, structure: /*Ignored*/&mut Structure);
fn no_more_pads(&self);
//fn post_message(&self, message: /*Ignored*/&mut Message) -> bool;
fn provide_clock(&self) -> Option<Clock>;
//fn query(&self, query: /*Ignored*/&mut Query) -> bool;
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64>;
fn query_duration(&self, format: Format) -> Option<i64>;
fn query_position(&self, format: Format) -> Option<i64>;
fn release_request_pad<P: IsA<Pad>>(&self, pad: &P);
fn remove_pad<P: IsA<Pad>>(&self, pad: &P) -> bool;
#[cfg(feature = "v1_10")]
fn remove_property_notify_watch(&self, watch_id: libc::c_ulong);
//fn request_pad<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b /*Ignored*/Caps>>>(&self, templ: &PadTemplate, name: P, caps: Q) -> Option<Pad>;
fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> bool;
fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> bool;
//fn send_event(&self, event: /*Ignored*/&mut Event) -> bool;
fn set_base_time(&self, time: ClockTime);
fn set_bus(&self, bus: &Bus);
fn set_clock<P: IsA<Clock>>(&self, clock: &P) -> bool;
//fn set_context(&self, context: /*Ignored*/&mut Context);
fn set_locked_state(&self, locked_state: bool) -> bool;
fn set_start_time(&self, time: ClockTime);
fn set_state(&self, state: State) -> StateChangeReturn;
fn sync_state_with_parent(&self) -> bool;
fn unlink<P: IsA<Element>>(&self, dest: &P);
//fn unlink_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
fn unlink_pads<P: IsA<Element>>(&self, srcpadname: &str, dest: &P, destpadname: &str);
fn connect_no_more_pads<F: Fn(&Self) + 'static>(&self, f: F) -> u64;
fn connect_pad_added<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_pad_removed<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
fn abort_state(&self) {
unsafe {
ffi::gst_element_abort_state(self.to_glib_none().0);
}
}
fn add_pad<P: IsA<Pad>>(&self, pad: &P) -> bool {
unsafe {
from_glib(ffi::gst_element_add_pad(self.to_glib_none().0, pad.to_glib_full()))
}
}
#[cfg(feature = "v1_10")]
fn add_property_deep_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
ffi::gst_element_add_property_deep_notify_watch(self.to_glib_none().0, property_name.0, include_value.to_glib())
}
}
#[cfg(feature = "v1_10")]
fn add_property_notify_watch<'a, P: Into<Option<&'a str>>>(&self, property_name: P, include_value: bool) -> libc::c_ulong {
let property_name = property_name.into();
let property_name = property_name.to_glib_none();
unsafe {
ffi::gst_element_add_property_notify_watch(self.to_glib_none().0, property_name.0, include_value.to_glib())
}
}
//#[cfg(feature = "v1_10")]
//fn call_async<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/ElementCallAsyncFunc, user_data: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_element_call_async() }
//}
fn change_state(&self, transition: StateChange) -> StateChangeReturn {
unsafe {
from_glib(ffi::gst_element_change_state(self.to_glib_none().0, transition.to_glib()))
}
}
fn continue_state(&self, ret: StateChangeReturn) -> StateChangeReturn {
unsafe {
from_glib(ffi::gst_element_continue_state(self.to_glib_none().0, ret.to_glib()))
}
}
fn create_all_pads(&self) {
unsafe {
ffi::gst_element_create_all_pads(self.to_glib_none().0);
}
}
fn get_base_time(&self) -> ClockTime {
unsafe {
ffi::gst_element_get_base_time(self.to_glib_none().0)
}
}
fn get_bus(&self) -> Option<Bus> {
unsafe {
from_glib_full(ffi::gst_element_get_bus(self.to_glib_none().0))
}
}
fn get_clock(&self) -> Option<Clock> {
unsafe {
from_glib_full(ffi::gst_element_get_clock(self.to_glib_none().0))
}
}
//fn get_compatible_pad<'a, P: IsA<Pad>, Q: Into<Option<&'a /*Ignored*/Caps>>>(&self, pad: &P, caps: Q) -> Option<Pad> {
// unsafe { TODO: call ffi::gst_element_get_compatible_pad() }
//}
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate> {
unsafe {
from_glib_none(ffi::gst_element_get_compatible_pad_template(self.to_glib_none().0, compattempl.to_glib_none().0))
}
}
//#[cfg(feature = "v1_8")]
//fn get_context(&self, context_type: &str) -> /*Ignored*/Option<Context> {
// unsafe { TODO: call ffi::gst_element_get_context() }
//}
//#[cfg(feature = "v1_8")]
//fn get_context_unlocked(&self, context_type: &str) -> /*Ignored*/Option<Context> {
// unsafe { TODO: call ffi::gst_element_get_context_unlocked() }
//}
//#[cfg(feature = "v1_8")]
//fn get_contexts(&self) -> /*Ignored*/Vec<Context> {
// unsafe { TODO: call ffi::gst_element_get_contexts() }
//}
fn get_factory(&self) -> Option<ElementFactory> {
unsafe {
from_glib_none(ffi::gst_element_get_factory(self.to_glib_none().0))
}
}
fn get_request_pad(&self, name: &str) -> Option<Pad> {
unsafe {
from_glib_full(ffi::gst_element_get_request_pad(self.to_glib_none().0, name.to_glib_none().0))
}
}
fn get_start_time(&self) -> ClockTime {
unsafe {
ffi::gst_element_get_start_time(self.to_glib_none().0)
}
}
fn get_state(&self, timeout: ClockTime) -> (StateChangeReturn, State, State) {
unsafe {
let mut state = mem::uninitialized();
let mut pending = mem::uninitialized();
let ret = from_glib(ffi::gst_element_get_state(self.to_glib_none().0, &mut state, &mut pending, timeout));
(ret, from_glib(state), from_glib(pending))
}
}
fn get_static_pad(&self, name: &str) -> Option<Pad> {
unsafe {
from_glib_full(ffi::gst_element_get_static_pad(self.to_glib_none().0, name.to_glib_none().0))
}
}
fn is_locked_state(&self) -> bool {
unsafe {
from_glib(ffi::gst_element_is_locked_state(self.to_glib_none().0))
}
}
//fn iterate_pads(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_element_iterate_pads() }
//}
//fn iterate_sink_pads(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_element_iterate_sink_pads() }
//}
//fn iterate_src_pads(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_element_iterate_src_pads() }
//}
fn link<P: IsA<Element>>(&self, dest: &P) -> bool {
unsafe {
from_glib(ffi::gst_element_link(self.to_glib_none().0, dest.to_glib_none().0))
}
}
//fn link_filtered<'a, P: IsA<Element>, Q: Into<Option<&'a /*Ignored*/Caps>>>(&self, dest: &P, filter: Q) -> bool {
// unsafe { TODO: call ffi::gst_element_link_filtered() }
//}
//fn link_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> bool {
// unsafe { TODO: call ffi::gst_element_link_many() }
//}
fn link_pads<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>>(&self, srcpadname: P, dest: &Q, destpadname: R) -> bool {
let srcpadname = srcpadname.into();
let srcpadname = srcpadname.to_glib_none();
let destpadname = destpadname.into();
let destpadname = destpadname.to_glib_none();
unsafe {
from_glib(ffi::gst_element_link_pads(self.to_glib_none().0, srcpadname.0, dest.to_glib_none().0, destpadname.0))
}
}
//fn link_pads_filtered<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>, S: Into<Option<&'c /*Ignored*/Caps>>>(&self, srcpadname: P, dest: &Q, destpadname: R, filter: S) -> bool {
// unsafe { TODO: call ffi::gst_element_link_pads_filtered() }
//}
//fn link_pads_full<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>>(&self, srcpadname: P, dest: &Q, destpadname: R, flags: /*Ignored*/PadLinkCheck) -> bool {
// unsafe { TODO: call ffi::gst_element_link_pads_full() }
//}
fn lost_state(&self) {
unsafe {
ffi::gst_element_lost_state(self.to_glib_none().0);
}
}
//fn message_full<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: P, debug: Q, file: &str, function: &str, line: i32) {
// unsafe { TODO: call ffi::gst_element_message_full() }
//}
//#[cfg(feature = "v1_10")]
//fn message_full_with_details<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, type_: /*Ignored*/MessageType, domain: /*Ignored*/glib::Quark, code: i32, text: P, debug: Q, file: &str, function: &str, line: i32, structure: /*Ignored*/&mut Structure) {
// unsafe { TODO: call ffi::gst_element_message_full_with_details() }
//}
fn no_more_pads(&self) {
unsafe {
ffi::gst_element_no_more_pads(self.to_glib_none().0);
}
}
//fn post_message(&self, message: /*Ignored*/&mut Message) -> bool {
// unsafe { TODO: call ffi::gst_element_post_message() }
//}
fn provide_clock(&self) -> Option<Clock> {
unsafe {
from_glib_full(ffi::gst_element_provide_clock(self.to_glib_none().0))
}
}
//fn query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_element_query() }
//}
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64> {
unsafe {
let mut dest_val = mem::uninitialized();
let ret = from_glib(ffi::gst_element_query_convert(self.to_glib_none().0, src_format.to_glib(), src_val, dest_format.to_glib(), &mut dest_val));
if ret { Some(dest_val) } else { None }
}
}
fn query_duration(&self, format: Format) -> Option<i64> {
unsafe {
let mut duration = mem::uninitialized();
let ret = from_glib(ffi::gst_element_query_duration(self.to_glib_none().0, format.to_glib(), &mut duration));
if ret { Some(duration) } else { None }
}
}
fn query_position(&self, format: Format) -> Option<i64> {
unsafe {
let mut cur = mem::uninitialized();
let ret = from_glib(ffi::gst_element_query_position(self.to_glib_none().0, format.to_glib(), &mut cur));
if ret { Some(cur) } else { None }
}
}
fn release_request_pad<P: IsA<Pad>>(&self, pad: &P) {
unsafe {
ffi::gst_element_release_request_pad(self.to_glib_none().0, pad.to_glib_none().0);
}
}
fn remove_pad<P: IsA<Pad>>(&self, pad: &P) -> bool {
unsafe {
from_glib(ffi::gst_element_remove_pad(self.to_glib_none().0, pad.to_glib_full()))
}
}
#[cfg(feature = "v1_10")]
fn remove_property_notify_watch(&self, watch_id: libc::c_ulong) {
unsafe {
ffi::gst_element_remove_property_notify_watch(self.to_glib_none().0, watch_id);
}
}
//fn request_pad<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b /*Ignored*/Caps>>>(&self, templ: &PadTemplate, name: P, caps: Q) -> Option<Pad> {
// unsafe { TODO: call ffi::gst_element_request_pad() }
//}
fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> bool {
unsafe {
from_glib(ffi::gst_element_seek(self.to_glib_none().0, rate, format.to_glib(), flags.to_glib(), start_type.to_glib(), start, stop_type.to_glib(), stop))
}
}
fn seek_simple(&self, format: Format, seek_flags: SeekFlags, seek_pos: i64) -> bool {
unsafe {
from_glib(ffi::gst_element_seek_simple(self.to_glib_none().0, format.to_glib(), seek_flags.to_glib(), seek_pos))
}
}
//fn send_event(&self, event: /*Ignored*/&mut Event) -> bool {
// unsafe { TODO: call ffi::gst_element_send_event() }
//}
fn set_base_time(&self, time: ClockTime) {
unsafe {
ffi::gst_element_set_base_time(self.to_glib_none().0, time);
}
}
fn set_bus(&self, bus: &Bus) {
unsafe {
ffi::gst_element_set_bus(self.to_glib_none().0, bus.to_glib_none().0);
}
}
fn set_clock<P: IsA<Clock>>(&self, clock: &P) -> bool {
unsafe {
from_glib(ffi::gst_element_set_clock(self.to_glib_none().0, clock.to_glib_none().0))
}
}
//fn set_context(&self, context: /*Ignored*/&mut Context) {
// unsafe { TODO: call ffi::gst_element_set_context() }
//}
fn set_locked_state(&self, locked_state: bool) -> bool {
unsafe {
from_glib(ffi::gst_element_set_locked_state(self.to_glib_none().0, locked_state.to_glib()))
}
}
fn set_start_time(&self, time: ClockTime) {
unsafe {
ffi::gst_element_set_start_time(self.to_glib_none().0, time);
}
}
fn set_state(&self, state: State) -> StateChangeReturn {
unsafe {
from_glib(ffi::gst_element_set_state(self.to_glib_none().0, state.to_glib()))
}
}
fn sync_state_with_parent(&self) -> bool {
unsafe {
from_glib(ffi::gst_element_sync_state_with_parent(self.to_glib_none().0))
}
}
fn unlink<P: IsA<Element>>(&self, dest: &P) {
unsafe {
ffi::gst_element_unlink(self.to_glib_none().0, dest.to_glib_none().0);
}
}
//fn unlink_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
// unsafe { TODO: call ffi::gst_element_unlink_many() }
//}
fn unlink_pads<P: IsA<Element>>(&self, srcpadname: &str, dest: &P, destpadname: &str) {
unsafe {
ffi::gst_element_unlink_pads(self.to_glib_none().0, srcpadname.to_glib_none().0, dest.to_glib_none().0, destpadname.to_glib_none().0);
}
}
fn connect_no_more_pads<F: Fn(&Self) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "no-more-pads",
transmute(no_more_pads_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_pad_added<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pad-added",
transmute(pad_added_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_pad_removed<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pad-removed",
transmute(pad_removed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe extern "C" fn no_more_pads_trampoline<P>(this: *mut ffi::GstElement, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P) + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked())
}
unsafe extern "C" fn pad_added_trampoline<P>(this: *mut ffi::GstElement, new_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(new_pad))
}
unsafe extern "C" fn pad_removed_trampoline<P>(this: *mut ffi::GstElement, old_pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Element> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
f(&Element::from_glib_none(this).downcast_unchecked(), &from_glib_none(old_pad))
}

View file

@ -0,0 +1,151 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Element;
use ElementFactoryListType;
use Object;
use URIType;
use ffi;
use glib;
use glib::object::IsA;
use glib::translate::*;
glib_wrapper! {
pub struct ElementFactory(Object<ffi::GstElementFactory>): Object;
match fn {
get_type => || ffi::gst_element_factory_get_type(),
}
}
impl ElementFactory {
pub fn find(name: &str) -> Option<ElementFactory> {
unsafe {
from_glib_full(ffi::gst_element_factory_find(name.to_glib_none().0))
}
}
//pub fn list_filter(list: &[ElementFactory], caps: /*Ignored*/&Caps, direction: PadDirection, subsetonly: bool) -> Vec<ElementFactory> {
// unsafe { TODO: call ffi::gst_element_factory_list_filter() }
//}
//pub fn list_get_elements(type_: ElementFactoryListType, minrank: /*Ignored*/Rank) -> Vec<ElementFactory> {
// unsafe { TODO: call ffi::gst_element_factory_list_get_elements() }
//}
pub fn make<'a, P: Into<Option<&'a str>>>(factoryname: &str, name: P) -> Option<Element> {
let name = name.into();
let name = name.to_glib_none();
unsafe {
from_glib_none(ffi::gst_element_factory_make(factoryname.to_glib_none().0, name.0))
}
}
}
pub trait ElementFactoryExt {
//fn can_sink_all_caps(&self, caps: /*Ignored*/&Caps) -> bool;
//fn can_sink_any_caps(&self, caps: /*Ignored*/&Caps) -> bool;
//fn can_src_all_caps(&self, caps: /*Ignored*/&Caps) -> bool;
//fn can_src_any_caps(&self, caps: /*Ignored*/&Caps) -> bool;
fn create<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element>;
fn get_element_type(&self) -> glib::types::Type;
fn get_metadata(&self, key: &str) -> Option<String>;
fn get_metadata_keys(&self) -> Vec<String>;
fn get_num_pad_templates(&self) -> u32;
//fn get_static_pad_templates(&self) -> /*Ignored*/Vec<StaticPadTemplate>;
fn get_uri_protocols(&self) -> Vec<String>;
fn get_uri_type(&self) -> URIType;
fn has_interface(&self, interfacename: &str) -> bool;
fn list_is_type(&self, type_: ElementFactoryListType) -> bool;
}
impl<O: IsA<ElementFactory>> ElementFactoryExt for O {
//fn can_sink_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_sink_all_caps() }
//}
//fn can_sink_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_sink_any_caps() }
//}
//fn can_src_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_src_all_caps() }
//}
//fn can_src_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_src_any_caps() }
//}
fn create<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element> {
let name = name.into();
let name = name.to_glib_none();
unsafe {
from_glib_none(ffi::gst_element_factory_create(self.to_glib_none().0, name.0))
}
}
fn get_element_type(&self) -> glib::types::Type {
unsafe {
from_glib(ffi::gst_element_factory_get_element_type(self.to_glib_none().0))
}
}
fn get_metadata(&self, key: &str) -> Option<String> {
unsafe {
from_glib_none(ffi::gst_element_factory_get_metadata(self.to_glib_none().0, key.to_glib_none().0))
}
}
fn get_metadata_keys(&self) -> Vec<String> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_get_metadata_keys(self.to_glib_none().0))
}
}
fn get_num_pad_templates(&self) -> u32 {
unsafe {
ffi::gst_element_factory_get_num_pad_templates(self.to_glib_none().0)
}
}
//fn get_static_pad_templates(&self) -> /*Ignored*/Vec<StaticPadTemplate> {
// unsafe { TODO: call ffi::gst_element_factory_get_static_pad_templates() }
//}
fn get_uri_protocols(&self) -> Vec<String> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_uri_protocols(self.to_glib_none().0))
}
}
fn get_uri_type(&self) -> URIType {
unsafe {
from_glib(ffi::gst_element_factory_get_uri_type(self.to_glib_none().0))
}
}
fn has_interface(&self, interfacename: &str) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_has_interface(self.to_glib_none().0, interfacename.to_glib_none().0))
}
}
fn list_is_type(&self, type_: ElementFactoryListType) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_list_is_type(self.to_glib_none().0, type_))
}
}
}

335
gstreamer/src/auto/enums.rs Normal file
View file

@ -0,0 +1,335 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use ffi;
use glib::translate::*;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum FlowReturn {
CustomSuccess2,
CustomSuccess1,
CustomSuccess,
Ok,
NotLinked,
Flushing,
Eos,
NotNegotiated,
Error,
NotSupported,
CustomError,
CustomError1,
CustomError2,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for FlowReturn {
type GlibType = ffi::GstFlowReturn;
fn to_glib(&self) -> ffi::GstFlowReturn {
match *self {
FlowReturn::CustomSuccess2 => ffi::GST_FLOW_CUSTOM_SUCCESS_2,
FlowReturn::CustomSuccess1 => ffi::GST_FLOW_CUSTOM_SUCCESS_1,
FlowReturn::CustomSuccess => ffi::GST_FLOW_CUSTOM_SUCCESS,
FlowReturn::Ok => ffi::GST_FLOW_OK,
FlowReturn::NotLinked => ffi::GST_FLOW_NOT_LINKED,
FlowReturn::Flushing => ffi::GST_FLOW_FLUSHING,
FlowReturn::Eos => ffi::GST_FLOW_EOS,
FlowReturn::NotNegotiated => ffi::GST_FLOW_NOT_NEGOTIATED,
FlowReturn::Error => ffi::GST_FLOW_ERROR,
FlowReturn::NotSupported => ffi::GST_FLOW_NOT_SUPPORTED,
FlowReturn::CustomError => ffi::GST_FLOW_CUSTOM_ERROR,
FlowReturn::CustomError1 => ffi::GST_FLOW_CUSTOM_ERROR_1,
FlowReturn::CustomError2 => ffi::GST_FLOW_CUSTOM_ERROR_2,
FlowReturn::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstFlowReturn> for FlowReturn {
fn from_glib(value: ffi::GstFlowReturn) -> Self {
match value {
ffi::GST_FLOW_CUSTOM_SUCCESS_2 => FlowReturn::CustomSuccess2,
ffi::GST_FLOW_CUSTOM_SUCCESS_1 => FlowReturn::CustomSuccess1,
ffi::GST_FLOW_CUSTOM_SUCCESS => FlowReturn::CustomSuccess,
ffi::GST_FLOW_OK => FlowReturn::Ok,
ffi::GST_FLOW_NOT_LINKED => FlowReturn::NotLinked,
ffi::GST_FLOW_FLUSHING => FlowReturn::Flushing,
ffi::GST_FLOW_EOS => FlowReturn::Eos,
ffi::GST_FLOW_NOT_NEGOTIATED => FlowReturn::NotNegotiated,
ffi::GST_FLOW_ERROR => FlowReturn::Error,
ffi::GST_FLOW_NOT_SUPPORTED => FlowReturn::NotSupported,
ffi::GST_FLOW_CUSTOM_ERROR => FlowReturn::CustomError,
ffi::GST_FLOW_CUSTOM_ERROR_1 => FlowReturn::CustomError1,
ffi::GST_FLOW_CUSTOM_ERROR_2 => FlowReturn::CustomError2,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum Format {
Undefined,
Default,
Bytes,
Time,
Buffers,
Percent,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for Format {
type GlibType = ffi::GstFormat;
fn to_glib(&self) -> ffi::GstFormat {
match *self {
Format::Undefined => ffi::GST_FORMAT_UNDEFINED,
Format::Default => ffi::GST_FORMAT_DEFAULT,
Format::Bytes => ffi::GST_FORMAT_BYTES,
Format::Time => ffi::GST_FORMAT_TIME,
Format::Buffers => ffi::GST_FORMAT_BUFFERS,
Format::Percent => ffi::GST_FORMAT_PERCENT,
Format::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstFormat> for Format {
fn from_glib(value: ffi::GstFormat) -> Self {
match value {
ffi::GST_FORMAT_UNDEFINED => Format::Undefined,
ffi::GST_FORMAT_DEFAULT => Format::Default,
ffi::GST_FORMAT_BYTES => Format::Bytes,
ffi::GST_FORMAT_TIME => Format::Time,
ffi::GST_FORMAT_BUFFERS => Format::Buffers,
ffi::GST_FORMAT_PERCENT => Format::Percent,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum PadDirection {
Unknown,
Src,
Sink,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for PadDirection {
type GlibType = ffi::GstPadDirection;
fn to_glib(&self) -> ffi::GstPadDirection {
match *self {
PadDirection::Unknown => ffi::GST_PAD_UNKNOWN,
PadDirection::Src => ffi::GST_PAD_SRC,
PadDirection::Sink => ffi::GST_PAD_SINK,
PadDirection::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstPadDirection> for PadDirection {
fn from_glib(value: ffi::GstPadDirection) -> Self {
match value {
ffi::GST_PAD_UNKNOWN => PadDirection::Unknown,
ffi::GST_PAD_SRC => PadDirection::Src,
ffi::GST_PAD_SINK => PadDirection::Sink,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum SeekType {
None,
Set,
End,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for SeekType {
type GlibType = ffi::GstSeekType;
fn to_glib(&self) -> ffi::GstSeekType {
match *self {
SeekType::None => ffi::GST_SEEK_TYPE_NONE,
SeekType::Set => ffi::GST_SEEK_TYPE_SET,
SeekType::End => ffi::GST_SEEK_TYPE_END,
SeekType::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstSeekType> for SeekType {
fn from_glib(value: ffi::GstSeekType) -> Self {
match value {
ffi::GST_SEEK_TYPE_NONE => SeekType::None,
ffi::GST_SEEK_TYPE_SET => SeekType::Set,
ffi::GST_SEEK_TYPE_END => SeekType::End,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum State {
VoidPending,
Null,
Ready,
Paused,
Playing,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for State {
type GlibType = ffi::GstState;
fn to_glib(&self) -> ffi::GstState {
match *self {
State::VoidPending => ffi::GST_STATE_VOID_PENDING,
State::Null => ffi::GST_STATE_NULL,
State::Ready => ffi::GST_STATE_READY,
State::Paused => ffi::GST_STATE_PAUSED,
State::Playing => ffi::GST_STATE_PLAYING,
State::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstState> for State {
fn from_glib(value: ffi::GstState) -> Self {
match value {
ffi::GST_STATE_VOID_PENDING => State::VoidPending,
ffi::GST_STATE_NULL => State::Null,
ffi::GST_STATE_READY => State::Ready,
ffi::GST_STATE_PAUSED => State::Paused,
ffi::GST_STATE_PLAYING => State::Playing,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum StateChange {
NullToReady,
ReadyToPaused,
PausedToPlaying,
PlayingToPaused,
PausedToReady,
ReadyToNull,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for StateChange {
type GlibType = ffi::GstStateChange;
fn to_glib(&self) -> ffi::GstStateChange {
match *self {
StateChange::NullToReady => ffi::GST_STATE_CHANGE_NULL_TO_READY,
StateChange::ReadyToPaused => ffi::GST_STATE_CHANGE_READY_TO_PAUSED,
StateChange::PausedToPlaying => ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING,
StateChange::PlayingToPaused => ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED,
StateChange::PausedToReady => ffi::GST_STATE_CHANGE_PAUSED_TO_READY,
StateChange::ReadyToNull => ffi::GST_STATE_CHANGE_READY_TO_NULL,
StateChange::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstStateChange> for StateChange {
fn from_glib(value: ffi::GstStateChange) -> Self {
match value {
ffi::GST_STATE_CHANGE_NULL_TO_READY => StateChange::NullToReady,
ffi::GST_STATE_CHANGE_READY_TO_PAUSED => StateChange::ReadyToPaused,
ffi::GST_STATE_CHANGE_PAUSED_TO_PLAYING => StateChange::PausedToPlaying,
ffi::GST_STATE_CHANGE_PLAYING_TO_PAUSED => StateChange::PlayingToPaused,
ffi::GST_STATE_CHANGE_PAUSED_TO_READY => StateChange::PausedToReady,
ffi::GST_STATE_CHANGE_READY_TO_NULL => StateChange::ReadyToNull,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum StateChangeReturn {
Failure,
Success,
Async,
NoPreroll,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for StateChangeReturn {
type GlibType = ffi::GstStateChangeReturn;
fn to_glib(&self) -> ffi::GstStateChangeReturn {
match *self {
StateChangeReturn::Failure => ffi::GST_STATE_CHANGE_FAILURE,
StateChangeReturn::Success => ffi::GST_STATE_CHANGE_SUCCESS,
StateChangeReturn::Async => ffi::GST_STATE_CHANGE_ASYNC,
StateChangeReturn::NoPreroll => ffi::GST_STATE_CHANGE_NO_PREROLL,
StateChangeReturn::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstStateChangeReturn> for StateChangeReturn {
fn from_glib(value: ffi::GstStateChangeReturn) -> Self {
match value {
ffi::GST_STATE_CHANGE_FAILURE => StateChangeReturn::Failure,
ffi::GST_STATE_CHANGE_SUCCESS => StateChangeReturn::Success,
ffi::GST_STATE_CHANGE_ASYNC => StateChangeReturn::Async,
ffi::GST_STATE_CHANGE_NO_PREROLL => StateChangeReturn::NoPreroll,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum URIType {
Unknown,
Sink,
Src,
#[doc(hidden)]
__Nonexhaustive(()),
}
#[doc(hidden)]
impl ToGlib for URIType {
type GlibType = ffi::GstURIType;
fn to_glib(&self) -> ffi::GstURIType {
match *self {
URIType::Unknown => ffi::GST_URI_UNKNOWN,
URIType::Sink => ffi::GST_URI_SINK,
URIType::Src => ffi::GST_URI_SRC,
URIType::__Nonexhaustive(_) => panic!(),
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstURIType> for URIType {
fn from_glib(value: ffi::GstURIType) -> Self {
match value {
ffi::GST_URI_UNKNOWN => URIType::Unknown,
ffi::GST_URI_SINK => URIType::Sink,
ffi::GST_URI_SRC => URIType::Src,
}
}
}

View file

@ -0,0 +1,39 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use ffi;
use glib::translate::*;
bitflags! {
pub flags SeekFlags: u32 {
const SEEK_FLAG_NONE = 0,
const SEEK_FLAG_FLUSH = 1,
const SEEK_FLAG_ACCURATE = 2,
const SEEK_FLAG_KEY_UNIT = 4,
const SEEK_FLAG_SEGMENT = 8,
const SEEK_FLAG_TRICKMODE = 16,
const SEEK_FLAG_SKIP = 16,
const SEEK_FLAG_SNAP_BEFORE = 32,
const SEEK_FLAG_SNAP_AFTER = 64,
const SEEK_FLAG_SNAP_NEAREST = 96,
const SEEK_FLAG_TRICKMODE_KEY_UNITS = 128,
const SEEK_FLAG_TRICKMODE_NO_AUDIO = 256,
}
}
#[doc(hidden)]
impl ToGlib for SeekFlags {
type GlibType = ffi::GstSeekFlags;
fn to_glib(&self) -> ffi::GstSeekFlags {
ffi::GstSeekFlags::from_bits_truncate(self.bits())
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstSeekFlags> for SeekFlags {
fn from_glib(value: ffi::GstSeekFlags) -> SeekFlags {
SeekFlags::from_bits_truncate(value.bits())
}
}

85
gstreamer/src/auto/mod.rs Normal file
View file

@ -0,0 +1,85 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
mod bin;
pub use self::bin::Bin;
pub use self::bin::BinExt;
mod bus;
pub use self::bus::Bus;
pub use self::bus::BusExt;
mod clock;
pub use self::clock::Clock;
pub use self::clock::ClockExt;
mod element;
pub use self::element::Element;
pub use self::element::ElementExt;
mod element_factory;
pub use self::element_factory::ElementFactory;
pub use self::element_factory::ElementFactoryExt;
mod object;
pub use self::object::Object;
pub use self::object::ObjectExt;
mod pad;
pub use self::pad::Pad;
pub use self::pad::PadExt;
mod pad_template;
pub use self::pad_template::PadTemplate;
pub use self::pad_template::PadTemplateExt;
mod pipeline;
pub use self::pipeline::Pipeline;
pub use self::pipeline::PipelineExt;
mod u_r_i_handler;
pub use self::u_r_i_handler::URIHandler;
pub use self::u_r_i_handler::URIHandlerExt;
mod enums;
pub use self::enums::FlowReturn;
pub use self::enums::Format;
pub use self::enums::PadDirection;
pub use self::enums::SeekType;
pub use self::enums::State;
pub use self::enums::StateChange;
pub use self::enums::StateChangeReturn;
pub use self::enums::URIType;
mod flags;
pub use self::flags::SeekFlags;
pub use self::flags::SEEK_FLAG_NONE;
pub use self::flags::SEEK_FLAG_FLUSH;
pub use self::flags::SEEK_FLAG_ACCURATE;
pub use self::flags::SEEK_FLAG_KEY_UNIT;
pub use self::flags::SEEK_FLAG_SEGMENT;
pub use self::flags::SEEK_FLAG_TRICKMODE;
pub use self::flags::SEEK_FLAG_SKIP;
pub use self::flags::SEEK_FLAG_SNAP_BEFORE;
pub use self::flags::SEEK_FLAG_SNAP_AFTER;
pub use self::flags::SEEK_FLAG_SNAP_NEAREST;
pub use self::flags::SEEK_FLAG_TRICKMODE_KEY_UNITS;
pub use self::flags::SEEK_FLAG_TRICKMODE_NO_AUDIO;
mod alias;
pub use self::alias::ClockTime;
pub use self::alias::ElementFactoryListType;
#[doc(hidden)]
pub mod traits {
pub use super::BinExt;
pub use super::BusExt;
pub use super::ClockExt;
pub use super::ElementExt;
pub use super::ElementFactoryExt;
pub use super::ObjectExt;
pub use super::PadExt;
pub use super::PadTemplateExt;
pub use super::PipelineExt;
pub use super::URIHandlerExt;
}

View file

@ -0,0 +1,224 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use ClockTime;
use Error;
use ffi;
use glib::object::IsA;
use glib::translate::*;
glib_wrapper! {
pub struct Object(Object<ffi::GstObject>);
match fn {
get_type => || ffi::gst_object_get_type(),
}
}
impl Object {
pub fn check_uniqueness(list: &[Object], name: &str) -> bool {
unsafe {
from_glib(ffi::gst_object_check_uniqueness(list.to_glib_none().0, name.to_glib_none().0))
}
}
//pub fn default_deep_notify<P: IsA</*Ignored*/glib::Object>, Q: IsA<Object>, R: IsA</*Ignored*/glib::ParamSpec>>(object: &P, orig: &Q, pspec: &R, excluded_props: &[&str]) {
// unsafe { TODO: call ffi::gst_object_default_deep_notify() }
//}
//pub fn ref_sink<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(object: P) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::gst_object_ref_sink() }
//}
//pub fn replace<'a, 'b, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>, R: IsA<Object> + 'b, S: Into<Option<&'b R>>>(oldobj: Q, newobj: S) -> bool {
// unsafe { TODO: call ffi::gst_object_replace() }
//}
}
pub trait ObjectExt {
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P);
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<ControlBinding>;
fn get_control_rate(&self) -> ClockTime;
//fn get_g_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Ignored*/&mut glib::Value) -> bool;
fn get_name(&self) -> Option<String>;
fn get_parent(&self) -> Option<Object>;
fn get_path_string(&self) -> Option<String>;
//fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value>;
//fn get_value_array<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: P) -> bool;
fn has_active_control_bindings(&self) -> bool;
fn has_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool;
fn has_as_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool;
#[cfg(feature = "v1_6")]
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool;
//fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool;
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool);
fn set_control_bindings_disabled(&self, disabled: bool);
fn set_control_rate(&self, control_rate: ClockTime);
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool;
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> bool;
fn suggest_next_sync(&self) -> ClockTime;
fn sync_values(&self, timestamp: ClockTime) -> bool;
fn unparent(&self);
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> u64;
}
impl<O: IsA<Object>> ObjectExt for O {
//fn add_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
// unsafe { TODO: call ffi::gst_object_add_control_binding() }
//}
fn default_error<'a, P: Into<Option<&'a str>>>(&self, error: &Error, debug: P) {
let debug = debug.into();
let debug = debug.to_glib_none();
unsafe {
ffi::gst_object_default_error(self.to_glib_none().0, error.to_glib_none().0, debug.0);
}
}
//fn get_control_binding(&self, property_name: &str) -> /*Ignored*/Option<ControlBinding> {
// unsafe { TODO: call ffi::gst_object_get_control_binding() }
//}
fn get_control_rate(&self) -> ClockTime {
unsafe {
ffi::gst_object_get_control_rate(self.to_glib_none().0)
}
}
//fn get_g_value_array(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: /*Ignored*/&mut glib::Value) -> bool {
// unsafe { TODO: call ffi::gst_object_get_g_value_array() }
//}
fn get_name(&self) -> Option<String> {
unsafe {
from_glib_full(ffi::gst_object_get_name(self.to_glib_none().0))
}
}
fn get_parent(&self) -> Option<Object> {
unsafe {
from_glib_full(ffi::gst_object_get_parent(self.to_glib_none().0))
}
}
fn get_path_string(&self) -> Option<String> {
unsafe {
from_glib_full(ffi::gst_object_get_path_string(self.to_glib_none().0))
}
}
//fn get_value(&self, property_name: &str, timestamp: ClockTime) -> /*Ignored*/Option<glib::Value> {
// unsafe { TODO: call ffi::gst_object_get_value() }
//}
//fn get_value_array<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, property_name: &str, timestamp: ClockTime, interval: ClockTime, n_values: u32, values: P) -> bool {
// unsafe { TODO: call ffi::gst_object_get_value_array() }
//}
fn has_active_control_bindings(&self) -> bool {
unsafe {
from_glib(ffi::gst_object_has_active_control_bindings(self.to_glib_none().0))
}
}
fn has_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
unsafe {
from_glib(ffi::gst_object_has_ancestor(self.to_glib_none().0, ancestor.to_glib_none().0))
}
}
fn has_as_ancestor<P: IsA<Object>>(&self, ancestor: &P) -> bool {
unsafe {
from_glib(ffi::gst_object_has_as_ancestor(self.to_glib_none().0, ancestor.to_glib_none().0))
}
}
#[cfg(feature = "v1_6")]
fn has_as_parent<P: IsA<Object>>(&self, parent: &P) -> bool {
unsafe {
from_glib(ffi::gst_object_has_as_parent(self.to_glib_none().0, parent.to_glib_none().0))
}
}
//fn remove_control_binding(&self, binding: /*Ignored*/&ControlBinding) -> bool {
// unsafe { TODO: call ffi::gst_object_remove_control_binding() }
//}
fn set_control_binding_disabled(&self, property_name: &str, disabled: bool) {
unsafe {
ffi::gst_object_set_control_binding_disabled(self.to_glib_none().0, property_name.to_glib_none().0, disabled.to_glib());
}
}
fn set_control_bindings_disabled(&self, disabled: bool) {
unsafe {
ffi::gst_object_set_control_bindings_disabled(self.to_glib_none().0, disabled.to_glib());
}
}
fn set_control_rate(&self, control_rate: ClockTime) {
unsafe {
ffi::gst_object_set_control_rate(self.to_glib_none().0, control_rate);
}
}
fn set_name<'a, P: Into<Option<&'a str>>>(&self, name: P) -> bool {
let name = name.into();
let name = name.to_glib_none();
unsafe {
from_glib(ffi::gst_object_set_name(self.to_glib_none().0, name.0))
}
}
fn set_parent<P: IsA<Object>>(&self, parent: &P) -> bool {
unsafe {
from_glib(ffi::gst_object_set_parent(self.to_glib_none().0, parent.to_glib_none().0))
}
}
fn suggest_next_sync(&self) -> ClockTime {
unsafe {
ffi::gst_object_suggest_next_sync(self.to_glib_none().0)
}
}
fn sync_values(&self, timestamp: ClockTime) -> bool {
unsafe {
from_glib(ffi::gst_object_sync_values(self.to_glib_none().0, timestamp))
}
}
fn unparent(&self) {
unsafe {
ffi::gst_object_unparent(self.to_glib_none().0);
}
}
//fn connect_deep_notify<Unsupported or ignored types>(&self, f: F) -> u64 {
// Ignored prop: GObject.ParamSpec
//}
}

702
gstreamer/src/auto/pad.rs Normal file
View file

@ -0,0 +1,702 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Element;
#[cfg(feature = "v1_4")]
use FlowReturn;
use Format;
use Object;
use PadDirection;
use PadTemplate;
use ffi;
use glib;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use libc;
use std::boxed::Box as Box_;
use std::mem;
use std::mem::transmute;
glib_wrapper! {
pub struct Pad(Object<ffi::GstPad>): Object;
match fn {
get_type => || ffi::gst_pad_get_type(),
}
}
impl Pad {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P, direction: PadDirection) -> Pad {
let name = name.into();
let name = name.to_glib_none();
unsafe {
from_glib_none(ffi::gst_pad_new(name.0, direction.to_glib()))
}
}
//pub fn new_from_static_template(templ: /*Ignored*/&mut StaticPadTemplate, name: &str) -> Pad {
// unsafe { TODO: call ffi::gst_pad_new_from_static_template() }
//}
pub fn new_from_template<'a, P: Into<Option<&'a str>>>(templ: &PadTemplate, name: P) -> Pad {
let name = name.into();
let name = name.to_glib_none();
unsafe {
from_glib_none(ffi::gst_pad_new_from_template(templ.to_glib_none().0, name.0))
}
}
//#[cfg(feature = "v1_4")]
//pub fn link_get_name(ret: /*Ignored*/PadLinkReturn) -> Option<String> {
// unsafe { TODO: call ffi::gst_pad_link_get_name() }
//}
}
pub trait PadExt {
//fn activate_mode(&self, mode: /*Ignored*/PadMode, active: bool) -> bool;
//fn add_probe<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, mask: /*Ignored*/PadProbeType, callback: /*Unknown conversion*//*Unimplemented*/PadProbeCallback, user_data: P, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> libc::c_ulong;
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool;
//fn chain(&self, buffer: /*Ignored*/&mut Buffer) -> FlowReturn;
//fn chain_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn;
fn check_reconfigure(&self) -> bool;
fn create_stream_id<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q) -> Option<String>;
//fn create_stream_id_printf<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<String>;
//fn create_stream_id_printf_valist<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<String>;
//fn event_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, event: /*Ignored*/&mut Event) -> bool;
//fn forward<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, forward: /*Unknown conversion*//*Unimplemented*/PadForwardFunction, user_data: P) -> bool;
//fn get_allowed_caps(&self) -> /*Ignored*/Option<Caps>;
//fn get_current_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_direction(&self) -> PadDirection;
//fn get_element_private(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;
#[cfg(feature = "v1_4")]
fn get_last_flow_return(&self) -> FlowReturn;
fn get_offset(&self) -> i64;
fn get_pad_template(&self) -> Option<PadTemplate>;
//fn get_pad_template_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_parent_element(&self) -> Option<Element>;
fn get_peer(&self) -> Option<Pad>;
//fn get_range(&self, offset: u64, size: u32, buffer: /*Ignored*/Buffer) -> FlowReturn;
//fn get_sticky_event(&self, event_type: /*Ignored*/EventType, idx: u32) -> /*Ignored*/Option<Event>;
//#[cfg(feature = "v1_10")]
//fn get_stream(&self) -> /*Ignored*/Option<Stream>;
#[cfg(feature = "v1_2")]
fn get_stream_id(&self) -> Option<String>;
//#[cfg(feature = "v1_12")]
//fn get_task_state(&self) -> /*Ignored*/TaskState;
fn has_current_caps(&self) -> bool;
fn is_active(&self) -> bool;
fn is_blocked(&self) -> bool;
fn is_blocking(&self) -> bool;
fn is_linked(&self) -> bool;
//fn iterate_internal_links(&self) -> /*Ignored*/Option<Iterator>;
//fn iterate_internal_links_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q) -> /*Ignored*/Option<Iterator>;
//fn link<P: IsA<Pad>>(&self, sinkpad: &P) -> /*Ignored*/PadLinkReturn;
//fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: /*Ignored*/PadLinkCheck) -> /*Ignored*/PadLinkReturn;
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> bool;
//#[cfg(feature = "v1_10")]
//fn link_maybe_ghosting_full<P: IsA<Pad>>(&self, sink: &P, flags: /*Ignored*/PadLinkCheck) -> bool;
fn mark_reconfigure(&self);
fn needs_reconfigure(&self) -> bool;
fn pause_task(&self) -> bool;
//fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool;
//fn peer_query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool;
//fn peer_query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps>;
fn peer_query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64>;
fn peer_query_duration(&self, format: Format) -> Option<i64>;
fn peer_query_position(&self, format: Format) -> Option<i64>;
//fn proxy_query_accept_caps(&self, query: /*Ignored*/&mut Query) -> bool;
//fn proxy_query_caps(&self, query: /*Ignored*/&mut Query) -> bool;
//fn pull_range(&self, offset: u64, size: u32, buffer: /*Ignored*/Buffer) -> FlowReturn;
//fn push(&self, buffer: /*Ignored*/&mut Buffer) -> FlowReturn;
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool;
//fn push_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn;
//fn query(&self, query: /*Ignored*/&mut Query) -> bool;
//fn query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool;
//fn query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps>;
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64>;
//fn query_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, query: /*Ignored*/&mut Query) -> bool;
fn query_duration(&self, format: Format) -> Option<i64>;
fn query_position(&self, format: Format) -> Option<i64>;
fn remove_probe(&self, id: libc::c_ulong);
//fn send_event(&self, event: /*Ignored*/&mut Event) -> bool;
//fn set_activate_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, activate: /*Unknown conversion*//*Unimplemented*/PadActivateFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_activatemode_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, activatemode: /*Unknown conversion*//*Unimplemented*/PadActivateModeFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn set_active(&self, active: bool) -> bool;
//fn set_chain_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, chain: /*Unknown conversion*//*Unimplemented*/PadChainFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_chain_list_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, chainlist: /*Unknown conversion*//*Unimplemented*/PadChainListFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_element_private<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priv_: P);
//#[cfg(feature = "v1_8")]
//fn set_event_full_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFullFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_event_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_getrange_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, get: /*Unknown conversion*//*Unimplemented*/PadGetRangeFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_iterate_internal_links_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, iterintlink: /*Unknown conversion*//*Unimplemented*/PadIterIntLinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_link_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, link: /*Unknown conversion*//*Unimplemented*/PadLinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
fn set_offset(&self, offset: i64);
//fn set_query_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, query: /*Unknown conversion*//*Unimplemented*/PadQueryFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn set_unlink_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, unlink: /*Unknown conversion*//*Unimplemented*/PadUnlinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify);
//fn start_task<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/TaskFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> bool;
//fn sticky_events_foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, foreach_func: /*Unknown conversion*//*Unimplemented*/PadStickyEventsForeachFunction, user_data: P);
fn stop_task(&self) -> bool;
//#[cfg(feature = "v1_2")]
//fn store_sticky_event(&self, event: /*Ignored*/&mut Event) -> FlowReturn;
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> bool;
fn use_fixed_caps(&self);
//fn get_property_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_property_template(&self) -> Option<PadTemplate>;
fn set_property_template(&self, template: Option<&PadTemplate>);
fn connect_linked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
fn connect_unlinked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
//fn activate_mode(&self, mode: /*Ignored*/PadMode, active: bool) -> bool {
// unsafe { TODO: call ffi::gst_pad_activate_mode() }
//}
//fn add_probe<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, mask: /*Ignored*/PadProbeType, callback: /*Unknown conversion*//*Unimplemented*/PadProbeCallback, user_data: P, destroy_data: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> libc::c_ulong {
// unsafe { TODO: call ffi::gst_pad_add_probe() }
//}
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool {
unsafe {
from_glib(ffi::gst_pad_can_link(self.to_glib_none().0, sinkpad.to_glib_none().0))
}
}
//fn chain(&self, buffer: /*Ignored*/&mut Buffer) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_chain() }
//}
//fn chain_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_chain_list() }
//}
fn check_reconfigure(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_check_reconfigure(self.to_glib_none().0))
}
}
fn create_stream_id<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q) -> Option<String> {
let stream_id = stream_id.into();
let stream_id = stream_id.to_glib_none();
unsafe {
from_glib_full(ffi::gst_pad_create_stream_id(self.to_glib_none().0, parent.to_glib_none().0, stream_id.0))
}
}
//fn create_stream_id_printf<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> Option<String> {
// unsafe { TODO: call ffi::gst_pad_create_stream_id_printf() }
//}
//fn create_stream_id_printf_valist<'a, P: IsA<Element>, Q: Into<Option<&'a str>>>(&self, parent: &P, stream_id: Q, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> Option<String> {
// unsafe { TODO: call ffi::gst_pad_create_stream_id_printf_valist() }
//}
//fn event_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, event: /*Ignored*/&mut Event) -> bool {
// unsafe { TODO: call ffi::gst_pad_event_default() }
//}
//fn forward<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, forward: /*Unknown conversion*//*Unimplemented*/PadForwardFunction, user_data: P) -> bool {
// unsafe { TODO: call ffi::gst_pad_forward() }
//}
//fn get_allowed_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_get_allowed_caps() }
//}
//fn get_current_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_get_current_caps() }
//}
fn get_direction(&self) -> PadDirection {
unsafe {
from_glib(ffi::gst_pad_get_direction(self.to_glib_none().0))
}
}
//fn get_element_private(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
// unsafe { TODO: call ffi::gst_pad_get_element_private() }
//}
#[cfg(feature = "v1_4")]
fn get_last_flow_return(&self) -> FlowReturn {
unsafe {
from_glib(ffi::gst_pad_get_last_flow_return(self.to_glib_none().0))
}
}
fn get_offset(&self) -> i64 {
unsafe {
ffi::gst_pad_get_offset(self.to_glib_none().0)
}
}
fn get_pad_template(&self) -> Option<PadTemplate> {
unsafe {
from_glib_full(ffi::gst_pad_get_pad_template(self.to_glib_none().0))
}
}
//fn get_pad_template_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_get_pad_template_caps() }
//}
fn get_parent_element(&self) -> Option<Element> {
unsafe {
from_glib_full(ffi::gst_pad_get_parent_element(self.to_glib_none().0))
}
}
fn get_peer(&self) -> Option<Pad> {
unsafe {
from_glib_full(ffi::gst_pad_get_peer(self.to_glib_none().0))
}
}
//fn get_range(&self, offset: u64, size: u32, buffer: /*Ignored*/Buffer) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_get_range() }
//}
//fn get_sticky_event(&self, event_type: /*Ignored*/EventType, idx: u32) -> /*Ignored*/Option<Event> {
// unsafe { TODO: call ffi::gst_pad_get_sticky_event() }
//}
//#[cfg(feature = "v1_10")]
//fn get_stream(&self) -> /*Ignored*/Option<Stream> {
// unsafe { TODO: call ffi::gst_pad_get_stream() }
//}
#[cfg(feature = "v1_2")]
fn get_stream_id(&self) -> Option<String> {
unsafe {
from_glib_full(ffi::gst_pad_get_stream_id(self.to_glib_none().0))
}
}
//#[cfg(feature = "v1_12")]
//fn get_task_state(&self) -> /*Ignored*/TaskState {
// unsafe { TODO: call ffi::gst_pad_get_task_state() }
//}
fn has_current_caps(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_has_current_caps(self.to_glib_none().0))
}
}
fn is_active(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_is_active(self.to_glib_none().0))
}
}
fn is_blocked(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_is_blocked(self.to_glib_none().0))
}
}
fn is_blocking(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_is_blocking(self.to_glib_none().0))
}
}
fn is_linked(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_is_linked(self.to_glib_none().0))
}
}
//fn iterate_internal_links(&self) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_pad_iterate_internal_links() }
//}
//fn iterate_internal_links_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q) -> /*Ignored*/Option<Iterator> {
// unsafe { TODO: call ffi::gst_pad_iterate_internal_links_default() }
//}
//fn link<P: IsA<Pad>>(&self, sinkpad: &P) -> /*Ignored*/PadLinkReturn {
// unsafe { TODO: call ffi::gst_pad_link() }
//}
//fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: /*Ignored*/PadLinkCheck) -> /*Ignored*/PadLinkReturn {
// unsafe { TODO: call ffi::gst_pad_link_full() }
//}
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> bool {
unsafe {
from_glib(ffi::gst_pad_link_maybe_ghosting(self.to_glib_none().0, sink.to_glib_none().0))
}
}
//#[cfg(feature = "v1_10")]
//fn link_maybe_ghosting_full<P: IsA<Pad>>(&self, sink: &P, flags: /*Ignored*/PadLinkCheck) -> bool {
// unsafe { TODO: call ffi::gst_pad_link_maybe_ghosting_full() }
//}
fn mark_reconfigure(&self) {
unsafe {
ffi::gst_pad_mark_reconfigure(self.to_glib_none().0);
}
}
fn needs_reconfigure(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_needs_reconfigure(self.to_glib_none().0))
}
}
fn pause_task(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_pause_task(self.to_glib_none().0))
}
}
//fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_peer_query() }
//}
//fn peer_query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool {
// unsafe { TODO: call ffi::gst_pad_peer_query_accept_caps() }
//}
//fn peer_query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_peer_query_caps() }
//}
fn peer_query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64> {
unsafe {
let mut dest_val = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_peer_query_convert(self.to_glib_none().0, src_format.to_glib(), src_val, dest_format.to_glib(), &mut dest_val));
if ret { Some(dest_val) } else { None }
}
}
fn peer_query_duration(&self, format: Format) -> Option<i64> {
unsafe {
let mut duration = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_peer_query_duration(self.to_glib_none().0, format.to_glib(), &mut duration));
if ret { Some(duration) } else { None }
}
}
fn peer_query_position(&self, format: Format) -> Option<i64> {
unsafe {
let mut cur = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_peer_query_position(self.to_glib_none().0, format.to_glib(), &mut cur));
if ret { Some(cur) } else { None }
}
}
//fn proxy_query_accept_caps(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_proxy_query_accept_caps() }
//}
//fn proxy_query_caps(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_proxy_query_caps() }
//}
//fn pull_range(&self, offset: u64, size: u32, buffer: /*Ignored*/Buffer) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_pull_range() }
//}
//fn push(&self, buffer: /*Ignored*/&mut Buffer) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_push() }
//}
//fn push_event(&self, event: /*Ignored*/&mut Event) -> bool {
// unsafe { TODO: call ffi::gst_pad_push_event() }
//}
//fn push_list(&self, list: /*Ignored*/&mut BufferList) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_push_list() }
//}
//fn query(&self, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_query() }
//}
//fn query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool {
// unsafe { TODO: call ffi::gst_pad_query_accept_caps() }
//}
//fn query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_query_caps() }
//}
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64> {
unsafe {
let mut dest_val = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_query_convert(self.to_glib_none().0, src_format.to_glib(), src_val, dest_format.to_glib(), &mut dest_val));
if ret { Some(dest_val) } else { None }
}
}
//fn query_default<'a, P: IsA<Object> + 'a, Q: Into<Option<&'a P>>>(&self, parent: Q, query: /*Ignored*/&mut Query) -> bool {
// unsafe { TODO: call ffi::gst_pad_query_default() }
//}
fn query_duration(&self, format: Format) -> Option<i64> {
unsafe {
let mut duration = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_query_duration(self.to_glib_none().0, format.to_glib(), &mut duration));
if ret { Some(duration) } else { None }
}
}
fn query_position(&self, format: Format) -> Option<i64> {
unsafe {
let mut cur = mem::uninitialized();
let ret = from_glib(ffi::gst_pad_query_position(self.to_glib_none().0, format.to_glib(), &mut cur));
if ret { Some(cur) } else { None }
}
}
fn remove_probe(&self, id: libc::c_ulong) {
unsafe {
ffi::gst_pad_remove_probe(self.to_glib_none().0, id);
}
}
//fn send_event(&self, event: /*Ignored*/&mut Event) -> bool {
// unsafe { TODO: call ffi::gst_pad_send_event() }
//}
//fn set_activate_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, activate: /*Unknown conversion*//*Unimplemented*/PadActivateFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_activate_function_full() }
//}
//fn set_activatemode_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, activatemode: /*Unknown conversion*//*Unimplemented*/PadActivateModeFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_activatemode_function_full() }
//}
fn set_active(&self, active: bool) -> bool {
unsafe {
from_glib(ffi::gst_pad_set_active(self.to_glib_none().0, active.to_glib()))
}
}
//fn set_chain_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, chain: /*Unknown conversion*//*Unimplemented*/PadChainFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_chain_function_full() }
//}
//fn set_chain_list_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, chainlist: /*Unknown conversion*//*Unimplemented*/PadChainListFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_chain_list_function_full() }
//}
//fn set_element_private<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, priv_: P) {
// unsafe { TODO: call ffi::gst_pad_set_element_private() }
//}
//#[cfg(feature = "v1_8")]
//fn set_event_full_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFullFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_event_full_function_full() }
//}
//fn set_event_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, event: /*Unknown conversion*//*Unimplemented*/PadEventFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_event_function_full() }
//}
//fn set_getrange_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, get: /*Unknown conversion*//*Unimplemented*/PadGetRangeFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_getrange_function_full() }
//}
//fn set_iterate_internal_links_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, iterintlink: /*Unknown conversion*//*Unimplemented*/PadIterIntLinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_iterate_internal_links_function_full() }
//}
//fn set_link_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, link: /*Unknown conversion*//*Unimplemented*/PadLinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_link_function_full() }
//}
fn set_offset(&self, offset: i64) {
unsafe {
ffi::gst_pad_set_offset(self.to_glib_none().0, offset);
}
}
//fn set_query_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, query: /*Unknown conversion*//*Unimplemented*/PadQueryFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_query_function_full() }
//}
//fn set_unlink_function_full<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, unlink: /*Unknown conversion*//*Unimplemented*/PadUnlinkFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
// unsafe { TODO: call ffi::gst_pad_set_unlink_function_full() }
//}
//fn start_task<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, func: /*Unknown conversion*//*Unimplemented*/TaskFunction, user_data: P, notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> bool {
// unsafe { TODO: call ffi::gst_pad_start_task() }
//}
//fn sticky_events_foreach<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(&self, foreach_func: /*Unknown conversion*//*Unimplemented*/PadStickyEventsForeachFunction, user_data: P) {
// unsafe { TODO: call ffi::gst_pad_sticky_events_foreach() }
//}
fn stop_task(&self) -> bool {
unsafe {
from_glib(ffi::gst_pad_stop_task(self.to_glib_none().0))
}
}
//#[cfg(feature = "v1_2")]
//fn store_sticky_event(&self, event: /*Ignored*/&mut Event) -> FlowReturn {
// unsafe { TODO: call ffi::gst_pad_store_sticky_event() }
//}
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> bool {
unsafe {
from_glib(ffi::gst_pad_unlink(self.to_glib_none().0, sinkpad.to_glib_none().0))
}
}
fn use_fixed_caps(&self) {
unsafe {
ffi::gst_pad_use_fixed_caps(self.to_glib_none().0);
}
}
//fn get_property_caps(&self) -> /*Ignored*/Option<Caps> {
// let mut value = Value::from(None::<&/*Ignored*/Caps>);
// unsafe {
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "caps".to_glib_none().0, value.to_glib_none_mut().0);
// }
// value.get()
//}
fn get_property_template(&self) -> Option<PadTemplate> {
let mut value = Value::from(None::<&PadTemplate>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "template".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
fn set_property_template(&self, template: Option<&PadTemplate>) {
unsafe {
gobject_ffi::g_object_set_property(self.to_glib_none().0, "template".to_glib_none().0, Value::from(template).to_glib_none().0);
}
}
fn connect_linked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "linked",
transmute(linked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
fn connect_unlinked<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "unlinked",
transmute(unlinked_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe extern "C" fn linked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer))
}
unsafe extern "C" fn unlinked_trampoline<P>(this: *mut ffi::GstPad, peer: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<Pad> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
f(&Pad::from_glib_none(this).downcast_unchecked(), &from_glib_none(peer))
}

View file

@ -0,0 +1,96 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Object;
use Pad;
use PadDirection;
use ffi;
use glib;
use glib::Value;
use glib::object::Downcast;
use glib::object::IsA;
use glib::signal::connect;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::boxed::Box as Box_;
use std::mem::transmute;
glib_wrapper! {
pub struct PadTemplate(Object<ffi::GstPadTemplate>): Object;
match fn {
get_type => || ffi::gst_pad_template_get_type(),
}
}
impl PadTemplate {
//pub fn new(name_template: &str, direction: PadDirection, presence: /*Ignored*/PadPresence, caps: /*Ignored*/&mut Caps) -> PadTemplate {
// unsafe { TODO: call ffi::gst_pad_template_new() }
//}
}
pub trait PadTemplateExt {
//fn get_caps(&self) -> /*Ignored*/Option<Caps>;
fn pad_created<P: IsA<Pad>>(&self, pad: &P);
fn get_property_direction(&self) -> PadDirection;
fn get_property_name_template(&self) -> Option<String>;
//fn get_property_presence(&self) -> /*Ignored*/PadPresence;
fn connect_pad_created<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64;
}
impl<O: IsA<PadTemplate> + IsA<glib::object::Object>> PadTemplateExt for O {
//fn get_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_template_get_caps() }
//}
fn pad_created<P: IsA<Pad>>(&self, pad: &P) {
unsafe {
ffi::gst_pad_template_pad_created(self.to_glib_none().0, pad.to_glib_none().0);
}
}
fn get_property_direction(&self) -> PadDirection {
let mut value = Value::from(&0);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "direction".to_glib_none().0, value.to_glib_none_mut().0);
from_glib(transmute(value.get::<i32>().unwrap()))
}
}
fn get_property_name_template(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
gobject_ffi::g_object_get_property(self.to_glib_none().0, "name-template".to_glib_none().0, value.to_glib_none_mut().0);
}
value.get()
}
//fn get_property_presence(&self) -> /*Ignored*/PadPresence {
// let mut value = Value::from(&0);
// unsafe {
// gobject_ffi::g_object_get_property(self.to_glib_none().0, "presence".to_glib_none().0, value.to_glib_none_mut().0);
// from_glib(transmute(value.get::<i32>().unwrap()))
// }
//}
fn connect_pad_created<F: Fn(&Self, &Pad) + 'static>(&self, f: F) -> u64 {
unsafe {
let f: Box_<Box_<Fn(&Self, &Pad) + 'static>> = Box_::new(Box_::new(f));
connect(self.to_glib_none().0, "pad-created",
transmute(pad_created_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
}
}
}
unsafe extern "C" fn pad_created_trampoline<P>(this: *mut ffi::GstPadTemplate, pad: *mut ffi::GstPad, f: glib_ffi::gpointer)
where P: IsA<PadTemplate> {
callback_guard!();
let f: &Box_<Fn(&P, &Pad) + 'static> = transmute(f);
f(&PadTemplate::from_glib_none(this).downcast_unchecked(), &from_glib_none(pad))
}

View file

@ -0,0 +1,114 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Bin;
use Clock;
use ClockTime;
use Element;
use Object;
use ffi;
use glib::object::Downcast;
use glib::object::IsA;
use glib::translate::*;
glib_wrapper! {
pub struct Pipeline(Object<ffi::GstPipeline>): Bin, Element, Object;
match fn {
get_type => || ffi::gst_pipeline_get_type(),
}
}
impl Pipeline {
pub fn new<'a, P: Into<Option<&'a str>>>(name: P) -> Pipeline {
let name = name.into();
let name = name.to_glib_none();
unsafe {
Element::from_glib_none(ffi::gst_pipeline_new(name.0)).downcast_unchecked()
}
}
}
pub trait PipelineExt {
fn auto_clock(&self);
fn get_auto_flush_bus(&self) -> bool;
fn get_delay(&self) -> ClockTime;
#[cfg(feature = "v1_6")]
fn get_latency(&self) -> ClockTime;
#[cfg(feature = "v1_6")]
fn get_pipeline_clock(&self) -> Option<Clock>;
fn set_auto_flush_bus(&self, auto_flush: bool);
fn set_delay(&self, delay: ClockTime);
#[cfg(feature = "v1_6")]
fn set_latency(&self, latency: ClockTime);
fn use_clock<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, clock: Q);
}
impl<O: IsA<Pipeline>> PipelineExt for O {
fn auto_clock(&self) {
unsafe {
ffi::gst_pipeline_auto_clock(self.to_glib_none().0);
}
}
fn get_auto_flush_bus(&self) -> bool {
unsafe {
from_glib(ffi::gst_pipeline_get_auto_flush_bus(self.to_glib_none().0))
}
}
fn get_delay(&self) -> ClockTime {
unsafe {
ffi::gst_pipeline_get_delay(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_6")]
fn get_latency(&self) -> ClockTime {
unsafe {
ffi::gst_pipeline_get_latency(self.to_glib_none().0)
}
}
#[cfg(feature = "v1_6")]
fn get_pipeline_clock(&self) -> Option<Clock> {
unsafe {
from_glib_full(ffi::gst_pipeline_get_pipeline_clock(self.to_glib_none().0))
}
}
fn set_auto_flush_bus(&self, auto_flush: bool) {
unsafe {
ffi::gst_pipeline_set_auto_flush_bus(self.to_glib_none().0, auto_flush.to_glib());
}
}
fn set_delay(&self, delay: ClockTime) {
unsafe {
ffi::gst_pipeline_set_delay(self.to_glib_none().0, delay);
}
}
#[cfg(feature = "v1_6")]
fn set_latency(&self, latency: ClockTime) {
unsafe {
ffi::gst_pipeline_set_latency(self.to_glib_none().0, latency);
}
}
fn use_clock<'a, P: IsA<Clock> + 'a, Q: Into<Option<&'a P>>>(&self, clock: Q) {
let clock = clock.into();
let clock = clock.to_glib_none();
unsafe {
ffi::gst_pipeline_use_clock(self.to_glib_none().0, clock.0);
}
}
}

View file

@ -0,0 +1,55 @@
// This file was generated by gir (57b38ba) from gir-files (???)
// DO NOT EDIT
use Error;
use URIType;
use ffi;
use glib::object::IsA;
use glib::translate::*;
use std::ptr;
glib_wrapper! {
pub struct URIHandler(Object<ffi::GstURIHandler>);
match fn {
get_type => || ffi::gst_uri_handler_get_type(),
}
}
pub trait URIHandlerExt {
fn get_protocols(&self) -> Vec<String>;
fn get_uri(&self) -> Option<String>;
fn get_uri_type(&self) -> URIType;
fn set_uri(&self, uri: &str) -> Result<(), Error>;
}
impl<O: IsA<URIHandler>> URIHandlerExt for O {
fn get_protocols(&self) -> Vec<String> {
unsafe {
FromGlibPtrContainer::from_glib_none(ffi::gst_uri_handler_get_protocols(self.to_glib_none().0))
}
}
fn get_uri(&self) -> Option<String> {
unsafe {
from_glib_full(ffi::gst_uri_handler_get_uri(self.to_glib_none().0))
}
}
fn get_uri_type(&self) -> URIType {
unsafe {
from_glib(ffi::gst_uri_handler_get_uri_type(self.to_glib_none().0))
}
}
fn set_uri(&self, uri: &str) -> Result<(), Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ffi::gst_uri_handler_set_uri(self.to_glib_none().0, uri.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
}

39
gstreamer/src/lib.rs Normal file
View file

@ -0,0 +1,39 @@
#[macro_use]
extern crate bitflags;
extern crate libc;
extern crate glib_sys as glib_ffi;
extern crate gobject_sys as gobject_ffi;
extern crate gstreamer_sys as ffi;
#[macro_use]
extern crate glib;
macro_rules! callback_guard {
() => (
let _guard = ::glib::CallbackGuard::new();
)
}
pub use glib::{
Cast,
Continue,
Error,
IsA,
StaticType,
ToValue,
Type,
TypedValue,
Value,
};
pub use auto::*;
mod auto;
use std::ptr;
pub fn init() {
unsafe {
ffi::gst_init(ptr::null_mut(), ptr::null_mut())
}
}