Commit c0707bed authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

Add initial caps bindings

parent 944c71f9
......@@ -24,6 +24,7 @@ generate = [
"Gst.FlowReturn",
"Gst.PadDirection",
"Gst.PadTemplate",
"Gst.PadPresence",
"Gst.URIHandler",
"Gst.URIType",
"Gst.ElementFactoryListType",
......@@ -100,6 +101,11 @@ trait = false
# Uses enum as flags
ignore = true
[[object]]
name = "Gst.Caps"
status = "manual"
ref_mode = "ref"
[[object]]
name = "Gst.Clock"
status = "generate"
......@@ -131,11 +137,21 @@ status = "generate"
[object.function.return]
bool_return_is_error = "Failed to link elements"
[[object.function]]
name = "link_filtered"
[object.function.return]
bool_return_is_error = "Failed to link elements"
[[object.function]]
name = "link_pads"
[object.function.return]
bool_return_is_error = "Failed to link pads"
[[object.function]]
name = "link_pads_filtered"
[object.function.return]
bool_return_is_error = "Failed to link pads"
[[object.function]]
name = "seek"
[object.function.return]
......@@ -164,14 +180,14 @@ trait = false
[[object]]
name = "Gst.Device"
status = "generate"
[[object.function]]
name = "get_properties"
[[object.property]]
name = "properties"
# Structure is not a GObject
ignore = true
[[object.property]]
name = "properties"
# Structure is not a GObject
name = "caps"
# Caps is not a GObject
ignore = true
......@@ -231,6 +247,11 @@ status = "generate"
[object.function.return]
bool_return_is_error = "Failed to activate pad"
[[object.property]]
name = "caps"
# Caps is not a GObject
ignore = true
[[object]]
name = "Gst.Plugin"
status = "generate"
......
......@@ -4,10 +4,6 @@ use gst::ObjectExt as GstObjectExt;
extern crate glib;
use glib::ObjectExt;
use glib::translate::{from_glib_none, ToGlibPtr};
extern crate gstreamer_sys as gst_ffi;
extern crate gobject_sys as gobject_ffi;
use std::env;
use std::u64;
......@@ -36,12 +32,10 @@ fn main() {
decodebin.connect_pad_added(move |_, src_pad| {
let ref pipeline = pipeline_clone;
// FIXME: Needs caps/structure bindings
let (is_audio, is_video) = unsafe {
let caps = gst_ffi::gst_pad_get_current_caps(src_pad.to_glib_none().0);
let structure = gst_ffi::gst_caps_get_structure(caps, 0);
let name: String = from_glib_none(gst_ffi::gst_structure_get_name(structure));
let (is_audio, is_video) = {
let caps = src_pad.get_current_caps().unwrap();
let structure = caps.get_structure(0).unwrap();
let name = structure.get_name();
(name.starts_with("audio/"), name.starts_with("video/"))
};
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
pub type ClockTime = u64;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Element;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Caps;
use Element;
use Object;
use Structure;
use ffi;
use glib;
use glib::Value;
......@@ -29,20 +31,20 @@ unsafe impl Sync for Device {}
pub trait DeviceExt {
fn create_element<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element>;
//fn get_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_caps(&self) -> Option<Caps>;
fn get_device_class(&self) -> Option<String>;
fn get_display_name(&self) -> Option<String>;
fn get_properties(&self) -> Option<Structure>;
fn has_classes(&self, classes: &str) -> bool;
fn has_classesv(&self, classes: &[&str]) -> bool;
fn reconfigure_element<P: IsA<Element>>(&self, element: &P) -> bool;
//fn get_property_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_property_device_class(&self) -> Option<String>;
fn get_property_display_name(&self) -> Option<String>;
......@@ -59,9 +61,11 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
}
}
//fn get_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_device_get_caps() }
//}
fn get_caps(&self) -> Option<Caps> {
unsafe {
from_glib_full(ffi::gst_device_get_caps(self.to_glib_none().0))
}
}
fn get_device_class(&self) -> Option<String> {
unsafe {
......@@ -75,6 +79,12 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
}
}
fn get_properties(&self) -> Option<Structure> {
unsafe {
from_glib_full(ffi::gst_device_get_properties(self.to_glib_none().0))
}
}
fn has_classes(&self, classes: &str) -> bool {
unsafe {
from_glib(ffi::gst_device_has_classes(self.to_glib_none().0, classes.to_glib_none().0))
......@@ -93,14 +103,6 @@ impl<O: IsA<Device> + IsA<glib::object::Object>> DeviceExt for O {
}
}
//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_device_class(&self) -> Option<String> {
let mut value = Value::from(None::<&str>);
unsafe {
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Bus;
use Caps;
use Device;
use Object;
use ffi;
......@@ -32,7 +33,7 @@ unsafe impl Send for DeviceMonitor {}
unsafe impl Sync for DeviceMonitor {}
pub trait DeviceMonitorExt {
//fn add_filter<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b /*Ignored*/Caps>>>(&self, classes: P, caps: Q) -> u32;
fn add_filter<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(&self, classes: P, caps: Q) -> u32;
fn get_bus(&self) -> Option<Bus>;
......@@ -56,9 +57,15 @@ pub trait DeviceMonitorExt {
}
impl<O: IsA<DeviceMonitor> + IsA<glib::object::Object>> DeviceMonitorExt for O {
//fn add_filter<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b /*Ignored*/Caps>>>(&self, classes: P, caps: Q) -> u32 {
// unsafe { TODO: call ffi::gst_device_monitor_add_filter() }
//}
fn add_filter<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(&self, classes: P, caps: Q) -> u32 {
let classes = classes.into();
let classes = classes.to_glib_none();
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
ffi::gst_device_monitor_add_filter(self.to_glib_none().0, classes.0, caps.0)
}
}
fn get_bus(&self) -> Option<Bus> {
unsafe {
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Bus;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use DeviceProvider;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Bus;
use Caps;
use Clock;
use ClockTime;
use ElementFactory;
......@@ -105,7 +106,7 @@ pub trait ElementExt {
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<'a, P: IsA<Pad>, Q: Into<Option<&'a Caps>>>(&self, pad: &P, caps: Q) -> Option<Pad>;
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate>;
......@@ -135,13 +136,13 @@ pub trait ElementExt {
fn link<P: IsA<Element>>(&self, dest: &P) -> Result<(), glib::error::BoolError>;
//fn link_filtered<'a, P: IsA<Element>, Q: Into<Option<&'a /*Ignored*/Caps>>>(&self, dest: &P, filter: Q) -> bool;
fn link_filtered<'a, P: IsA<Element>, Q: Into<Option<&'a Caps>>>(&self, dest: &P, filter: Q) -> Result<(), glib::error::BoolError>;
//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) -> Result<(), glib::error::BoolError>;
//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_filtered<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>, S: Into<Option<&'c Caps>>>(&self, srcpadname: P, dest: &Q, destpadname: R, filter: S) -> Result<(), glib::error::BoolError>;
//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;
......@@ -173,7 +174,7 @@ pub trait ElementExt {
#[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 request_pad<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b 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) -> Result<(), glib::error::BoolError>;
......@@ -282,9 +283,13 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
//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<'a, P: IsA<Pad>, Q: Into<Option<&'a Caps>>>(&self, pad: &P, caps: Q) -> Option<Pad> {
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
from_glib_full(ffi::gst_element_get_compatible_pad(self.to_glib_none().0, pad.to_glib_none().0, caps.0))
}
}
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate> {
unsafe {
......@@ -361,9 +366,13 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
//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_filtered<'a, P: IsA<Element>, Q: Into<Option<&'a Caps>>>(&self, dest: &P, filter: Q) -> Result<(), glib::error::BoolError> {
let filter = filter.into();
let filter = filter.to_glib_none();
unsafe {
glib::error::BoolError::from_glib(ffi::gst_element_link_filtered(self.to_glib_none().0, dest.to_glib_none().0, filter.0), "Failed to link elements")
}
}
//fn link_many<P: IsA<Element>>(&self, element_2: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> bool {
// unsafe { TODO: call ffi::gst_element_link_many() }
......@@ -379,9 +388,17 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
//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_filtered<'a, 'b, 'c, P: Into<Option<&'a str>>, Q: IsA<Element>, R: Into<Option<&'b str>>, S: Into<Option<&'c Caps>>>(&self, srcpadname: P, dest: &Q, destpadname: R, filter: S) -> Result<(), glib::error::BoolError> {
let srcpadname = srcpadname.into();
let srcpadname = srcpadname.to_glib_none();
let destpadname = destpadname.into();
let destpadname = destpadname.to_glib_none();
let filter = filter.into();
let filter = filter.to_glib_none();
unsafe {
glib::error::BoolError::from_glib(ffi::gst_element_link_pads_filtered(self.to_glib_none().0, srcpadname.0, dest.to_glib_none().0, destpadname.0, filter.0), "Failed to link pads")
}
}
//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() }
......@@ -467,9 +484,15 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
//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 request_pad<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b Caps>>>(&self, templ: &PadTemplate, name: P, caps: Q) -> Option<Pad> {
let name = name.into();
let name = name.to_glib_none();
let caps = caps.into();
let caps = caps.to_glib_none();
unsafe {
from_glib_full(ffi::gst_element_request_pad(self.to_glib_none().0, templ.to_glib_none().0, name.0, caps.0))
}
}
fn seek(&self, rate: f64, format: Format, flags: SeekFlags, start_type: SeekType, start: i64, stop_type: SeekType, stop: i64) -> Result<(), glib::error::BoolError> {
unsafe {
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Caps;
use Element;
use ElementFactoryListType;
use Object;
use PadDirection;
use URIType;
use ffi;
use glib;
......@@ -18,21 +20,29 @@ glib_wrapper! {
}
impl ElementFactory {
//pub fn can_sink_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_sink_all_caps() }
//}
pub fn can_sink_all_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_can_sink_all_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
//pub fn can_sink_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_sink_any_caps() }
//}
pub fn can_sink_any_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_can_sink_any_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
//pub fn can_src_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_src_all_caps() }
//}
pub fn can_src_all_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_can_src_all_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
//pub fn can_src_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
// unsafe { TODO: call ffi::gst_element_factory_can_src_any_caps() }
//}
pub fn can_src_any_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_element_factory_can_src_any_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
pub fn create<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element> {
let name = name.into();
......@@ -101,9 +111,12 @@ impl ElementFactory {
}
}
//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_filter(list: &[ElementFactory], caps: &Caps, direction: PadDirection, subsetonly: bool) -> Vec<ElementFactory> {
assert_initialized_main_thread!();
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_list_filter(list.to_glib_none().0, caps.to_glib_none().0, direction.to_glib(), subsetonly.to_glib()))
}
}
//pub fn list_get_elements(type_: ElementFactoryListType, minrank: /*Ignored*/Rank) -> Vec<ElementFactory> {
// unsafe { TODO: call ffi::gst_element_factory_list_get_elements() }
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use ffi;
......@@ -419,6 +419,42 @@ impl FromGlib<ffi::GstPadLinkReturn> for PadLinkReturn {
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum PadPresence {
Always,
Sometimes,
Request,
#[doc(hidden)]
__Unknown(i32),
}
#[doc(hidden)]
impl ToGlib for PadPresence {
type GlibType = ffi::GstPadPresence;
fn to_glib(&self) -> ffi::GstPadPresence {
match *self {
PadPresence::Always => ffi::GST_PAD_ALWAYS,
PadPresence::Sometimes => ffi::GST_PAD_SOMETIMES,
PadPresence::Request => ffi::GST_PAD_REQUEST,
PadPresence::__Unknown(value) => unsafe{std::mem::transmute(value)}
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstPadPresence> for PadPresence {
fn from_glib(value: ffi::GstPadPresence) -> Self {
skip_assert_initialized!();
match value as i32 {
0 => PadPresence::Always,
1 => PadPresence::Sometimes,
2 => PadPresence::Request,
value => PadPresence::__Unknown(value),
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
pub enum ParseError {
Syntax,
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use ffi;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Bin;
......@@ -628,7 +628,7 @@ pub fn util_uint64_scale_round(val: u64, num: u64, denom: u64) -> u64 {
// unsafe { TODO: call ffi::gst_value_get_bitmask() }
//}
//pub fn value_get_caps(value: /*Ignored*/&glib::Value) -> /*Ignored*/Option<Caps> {
//pub fn value_get_caps(value: /*Ignored*/&glib::Value) -> Option<Caps> {
// unsafe { TODO: call ffi::gst_value_get_caps() }
//}
......@@ -724,7 +724,7 @@ pub fn util_uint64_scale_round(val: u64, num: u64, denom: u64) -> u64 {
// unsafe { TODO: call ffi::gst_value_set_bitmask() }
//}
//pub fn value_set_caps(value: /*Ignored*/&mut glib::Value, caps: /*Ignored*/&Caps) {
//pub fn value_set_caps(value: /*Ignored*/&mut glib::Value, caps: &Caps) {
// unsafe { TODO: call ffi::gst_value_set_caps() }
//}
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
mod bin;
......@@ -80,6 +80,7 @@ pub use self::enums::Format;
pub use self::enums::LibraryError;
pub use self::enums::PadDirection;
pub use self::enums::PadLinkReturn;
pub use self::enums::PadPresence;
pub use self::enums::ParseError;
pub use self::enums::PluginError;
pub use self::enums::ProgressType;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use ClockTime;
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Caps;
use Element;
use FlowReturn;
use Format;
......@@ -89,9 +90,9 @@ pub trait PadExt {
//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_allowed_caps(&self) -> Option<Caps>;
//fn get_current_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_current_caps(&self) -> Option<Caps>;
fn get_direction(&self) -> PadDirection;
......@@ -103,7 +104,7 @@ pub trait PadExt {
fn get_pad_template(&self) -> Option<PadTemplate>;
//fn get_pad_template_caps(&self) -> /*Ignored*/Option<Caps>;
fn get_pad_template_caps(&self) -> Option<Caps>;
fn get_parent_element(&self) -> Option<Element>;
......@@ -153,9 +154,9 @@ pub trait PadExt {
//fn peer_query(&self, query: /*Ignored*/&mut Query) -> bool;
//fn peer_query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool;
fn peer_query_accept_caps(&self, caps: &Caps) -> bool;
//fn peer_query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps>;
fn peer_query_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps>;
fn peer_query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64>;
......@@ -177,9 +178,9 @@ pub trait PadExt {
//fn query(&self, query: /*Ignored*/&mut Query) -> bool;
//fn query_accept_caps(&self, caps: /*Ignored*/&mut Caps) -> bool;
fn query_accept_caps(&self, caps: &Caps) -> bool;
//fn query_caps<'a, P: Into<Option<&'a /*Ignored*/Caps>>>(&self, filter: P) -> /*Ignored*/Option<Caps>;
fn query_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps>;
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64>;
......@@ -233,8 +234,6 @@ pub trait PadExt {
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>);
......@@ -297,13 +296,17 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
// 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_allowed_caps(&self) -> Option<Caps> {
unsafe {
from_glib_full(ffi::gst_pad_get_allowed_caps(self.to_glib_none().0))
}
}
//fn get_current_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_get_current_caps() }
//}
fn get_current_caps(&self) -> Option<Caps> {
unsafe {
from_glib_full(ffi::gst_pad_get_current_caps(self.to_glib_none().0))
}
}
fn get_direction(&self) -> PadDirection {
unsafe {
......@@ -333,9 +336,11 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
//fn get_pad_template_caps(&self) -> /*Ignored*/Option<Caps> {
// unsafe { TODO: call ffi::gst_pad_get_pad_template_caps() }
//}
fn get_pad_template_caps(&self) -> Option<Caps> {
unsafe {
from_glib_full(ffi::gst_pad_get_pad_template_caps(self.to_glib_none().0))
}
}
fn get_parent_element(&self) -> Option<Element> {
unsafe {
......@@ -457,13 +462,19 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
// 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_accept_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_pad_peer_query_accept_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
//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_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps> {
let filter = filter.into();
let filter = filter.to_glib_none();
unsafe {
from_glib_full(ffi::gst_pad_peer_query_caps(self.to_glib_none().0, filter.0))
}
}
fn peer_query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64> {
unsafe {
......@@ -517,13 +528,19 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
// 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_accept_caps(&self, caps: &Caps) -> bool {
unsafe {
from_glib(ffi::gst_pad_query_accept_caps(self.to_glib_none().0, caps.to_glib_none().0))
}
}
//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_caps<'a, P: Into<Option<&'a Caps>>>(&self, filter: P) -> Option<Caps> {
let filter = filter.into();
let filter = filter.to_glib_none();
unsafe {
from_glib_full(ffi::gst_pad_query_caps(self.to_glib_none().0, filter.0))
}
}
fn query_convert(&self, src_format: Format, src_val: i64, dest_format: Format) -> Option<i64> {
unsafe {
......@@ -653,14 +670,6 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
//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 {
......
// This file was generated by gir (33e9567) from gir-files (???)
// This file was generated by gir (33e9567+) from gir-files (???)
// DO NOT EDIT
use Caps;
use Object;
use Pad;
use PadDirection;
use PadPresence;
use ffi;
use glib;
use glib::Value;
......@@ -25,16 +27,19 @@ glib_wrapper! {
}
impl PadTemplate {