Add auto-generated Segment bindings

This commit is contained in:
Sebastian Dröge 2017-07-28 17:38:52 +01:00
parent b5d8b44725
commit 7926257c3c
25 changed files with 208 additions and 28 deletions

View file

@ -361,6 +361,11 @@ status = "generate"
# Has setter/getter functions # Has setter/getter functions
ignore = true ignore = true
[[object]]
name = "Gst.Segment"
status = "generate"
concurrency = "send"
[[object]] [[object]]
name = "Gst.Plugin" name = "Gst.Plugin"
status = "generate" status = "generate"

View file

@ -34672,7 +34672,12 @@ has been changed but not the playback position.</doc>
<doc xml:space="preserve">the seek stop value</doc> <doc xml:space="preserve">the seek stop value</doc>
<type name="guint64" c:type="guint64"/> <type name="guint64" c:type="guint64"/>
</parameter> </parameter>
<parameter name="update" transfer-ownership="none"> <parameter name="update"
direction="out"
caller-allocates="0"
transfer-ownership="full"
optional="1"
allow-none="1">
<doc xml:space="preserve">boolean holding whether position was updated.</doc> <doc xml:space="preserve">boolean holding whether position was updated.</doc>
<type name="gboolean" c:type="gboolean*"/> <type name="gboolean" c:type="gboolean*"/>
</parameter> </parameter>
@ -34815,7 +34820,10 @@ to get the real negative segment position.</doc>
<doc xml:space="preserve">the running-time</doc> <doc xml:space="preserve">the running-time</doc>
<type name="guint64" c:type="guint64"/> <type name="guint64" c:type="guint64"/>
</parameter> </parameter>
<parameter name="position" transfer-ownership="none"> <parameter name="position"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">the resulting position in the segment</doc> <doc xml:space="preserve">the resulting position in the segment</doc>
<type name="guint64" c:type="guint64*"/> <type name="guint64" c:type="guint64*"/>
</parameter> </parameter>
@ -34881,7 +34889,10 @@ to get the real negative segment position.</doc>
<doc xml:space="preserve">the stream-time</doc> <doc xml:space="preserve">the stream-time</doc>
<type name="guint64" c:type="guint64"/> <type name="guint64" c:type="guint64"/>
</parameter> </parameter>
<parameter name="position" transfer-ownership="none"> <parameter name="position"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">the resulting position in the segment</doc> <doc xml:space="preserve">the resulting position in the segment</doc>
<type name="guint64" c:type="guint64*"/> <type name="guint64" c:type="guint64*"/>
</parameter> </parameter>
@ -35002,7 +35013,12 @@ to get the real negative running time.</doc>
<doc xml:space="preserve">the position in the segment</doc> <doc xml:space="preserve">the position in the segment</doc>
<type name="guint64" c:type="guint64"/> <type name="guint64" c:type="guint64"/>
</parameter> </parameter>
<parameter name="running_time" transfer-ownership="none"> <parameter name="running_time"
direction="out"
caller-allocates="0"
transfer-ownership="full"
optional="1"
allow-none="1">
<doc xml:space="preserve">result running-time</doc> <doc xml:space="preserve">result running-time</doc>
<type name="guint64" c:type="guint64*"/> <type name="guint64" c:type="guint64*"/>
</parameter> </parameter>
@ -35076,7 +35092,10 @@ to get the real negative stream time.</doc>
<doc xml:space="preserve">the position in the segment</doc> <doc xml:space="preserve">the position in the segment</doc>
<type name="guint64" c:type="guint64"/> <type name="guint64" c:type="guint64"/>
</parameter> </parameter>
<parameter name="stream_time" transfer-ownership="none"> <parameter name="stream_time"
direction="out"
caller-allocates="0"
transfer-ownership="full">
<doc xml:space="preserve">result stream-time</doc> <doc xml:space="preserve">result stream-time</doc>
<type name="guint64" c:type="guint64*"/> <type name="guint64" c:type="guint64*"/>
</parameter> </parameter>
@ -45943,7 +45962,9 @@ indicated by that system ID, or %NULL if no element has been found.</doc>
<doc xml:space="preserve">A null terminated array of strings <doc xml:space="preserve">A null terminated array of strings
that contains the UUID values of each protection system that is to be that contains the UUID values of each protection system that is to be
checked.</doc> checked.</doc>
<type name="utf8" c:type="const gchar**"/> <array c:type="gchar**">
<type name="utf8" c:type="gchar*"/>
</array>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
#[allow(unused_imports)] #[allow(unused_imports)]

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Element; use Element;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use DeviceProvider; use DeviceProvider;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bus; use Bus;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ffi; use ffi;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bin; use Bin;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
mod bin; mod bin;
@ -72,6 +72,9 @@ mod u_r_i_handler;
pub use self::u_r_i_handler::URIHandler; pub use self::u_r_i_handler::URIHandler;
pub use self::u_r_i_handler::URIHandlerExt; pub use self::u_r_i_handler::URIHandlerExt;
mod segment;
pub use self::segment::Segment;
mod enums; mod enums;
pub use self::enums::BufferingMode; pub use self::enums::BufferingMode;
pub use self::enums::BusSyncReply; pub use self::enums::BusSyncReply;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use ClockTime; use ClockTime;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Caps; use Caps;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Bin; use Bin;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Error; use Error;

View file

@ -0,0 +1,151 @@
// This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT
use Format;
use SeekFlags;
use SeekType;
use ffi;
use glib::translate::*;
use glib_ffi;
use gobject_ffi;
use std::mem;
use std::ptr;
glib_wrapper! {
pub struct Segment(Boxed<ffi::GstSegment>);
match fn {
copy => |ptr| ffi::gst_segment_copy(mut_override(ptr)),
free => |ptr| ffi::gst_segment_free(ptr),
get_type => || ffi::gst_segment_get_type(),
}
}
impl Segment {
pub fn new() -> Segment {
assert_initialized_main_thread!();
unsafe {
from_glib_full(ffi::gst_segment_new())
}
}
pub fn clip(&self, format: Format, start: u64, stop: u64) -> Option<(u64, u64)> {
unsafe {
let mut clip_start = mem::uninitialized();
let mut clip_stop = mem::uninitialized();
let ret = from_glib(ffi::gst_segment_clip(self.to_glib_none().0, format.to_glib(), start, stop, &mut clip_start, &mut clip_stop));
if ret { Some((clip_start, clip_stop)) } else { None }
}
}
pub fn copy_into(&self, dest: &mut Segment) {
unsafe {
ffi::gst_segment_copy_into(self.to_glib_none().0, dest.to_glib_none_mut().0);
}
}
pub fn do_seek(&mut self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: u64, stop_type: SeekType, stop: u64) -> Option<bool> {
unsafe {
let mut update = mem::uninitialized();
let ret = from_glib(ffi::gst_segment_do_seek(self.to_glib_none_mut().0, rate, format.to_glib(), flags.to_glib(), start_type.to_glib(), start, stop_type.to_glib(), stop, &mut update));
if ret { Some(from_glib(update)) } else { None }
}
}
pub fn init(&mut self, format: Format) {
unsafe {
ffi::gst_segment_init(self.to_glib_none_mut().0, format.to_glib());
}
}
fn is_equal(&self, s1: &Segment) -> bool {
unsafe {
from_glib(ffi::gst_segment_is_equal(self.to_glib_none().0, s1.to_glib_none().0))
}
}
pub fn offset_running_time(&mut self, format: Format, offset: i64) -> bool {
unsafe {
from_glib(ffi::gst_segment_offset_running_time(self.to_glib_none_mut().0, format.to_glib(), offset))
}
}
pub fn position_from_running_time(&self, format: Format, running_time: u64) -> u64 {
unsafe {
ffi::gst_segment_position_from_running_time(self.to_glib_none().0, format.to_glib(), running_time)
}
}
pub fn position_from_running_time_full(&self, format: Format, running_time: u64) -> (i32, u64) {
unsafe {
let mut position = mem::uninitialized();
let ret = ffi::gst_segment_position_from_running_time_full(self.to_glib_none().0, format.to_glib(), running_time, &mut position);
(ret, position)
}
}
pub fn position_from_stream_time(&self, format: Format, stream_time: u64) -> u64 {
unsafe {
ffi::gst_segment_position_from_stream_time(self.to_glib_none().0, format.to_glib(), stream_time)
}
}
pub fn position_from_stream_time_full(&self, format: Format, stream_time: u64) -> (i32, u64) {
unsafe {
let mut position = mem::uninitialized();
let ret = ffi::gst_segment_position_from_stream_time_full(self.to_glib_none().0, format.to_glib(), stream_time, &mut position);
(ret, position)
}
}
pub fn set_running_time(&mut self, format: Format, running_time: u64) -> bool {
unsafe {
from_glib(ffi::gst_segment_set_running_time(self.to_glib_none_mut().0, format.to_glib(), running_time))
}
}
pub fn to_position(&self, format: Format, running_time: u64) -> u64 {
unsafe {
ffi::gst_segment_to_position(self.to_glib_none().0, format.to_glib(), running_time)
}
}
pub fn to_running_time(&self, format: Format, position: u64) -> u64 {
unsafe {
ffi::gst_segment_to_running_time(self.to_glib_none().0, format.to_glib(), position)
}
}
pub fn to_running_time_full(&self, format: Format, position: u64) -> (i32, u64) {
unsafe {
let mut running_time = mem::uninitialized();
let ret = ffi::gst_segment_to_running_time_full(self.to_glib_none().0, format.to_glib(), position, &mut running_time);
(ret, running_time)
}
}
pub fn to_stream_time(&self, format: Format, position: u64) -> u64 {
unsafe {
ffi::gst_segment_to_stream_time(self.to_glib_none().0, format.to_glib(), position)
}
}
pub fn to_stream_time_full(&self, format: Format, position: u64) -> (i32, u64) {
unsafe {
let mut stream_time = mem::uninitialized();
let ret = ffi::gst_segment_to_stream_time_full(self.to_glib_none().0, format.to_glib(), position, &mut stream_time);
(ret, stream_time)
}
}
}
impl PartialEq for Segment {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.is_equal(other)
}
}
impl Eq for Segment {}
unsafe impl Send for Segment {}

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
#[cfg(feature = "v1_10")] #[cfg(feature = "v1_10")]

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Object; use Object;

View file

@ -1,4 +1,4 @@
// This file was generated by gir (5c71144) from gir-files (???) // This file was generated by gir (a01311c+) from gir-files (???)
// DO NOT EDIT // DO NOT EDIT
use Error; use Error;