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

Add GstPadLinkCheck

parent 97bca104
......@@ -69,6 +69,7 @@ generate = [
"Gst.ClockReturn",
"Gst.ElementFlags",
"Gst.Rank",
"Gst.PadLinkCheck",
]
manual = [
......
......@@ -13,6 +13,7 @@ use Iterator;
use Message;
use Object;
use Pad;
use PadLinkCheck;
use PadTemplate;
use Plugin;
use SeekFlags;
......@@ -145,7 +146,7 @@ pub trait ElementExt {
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;
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: PadLinkCheck) -> bool;
fn lost_state(&self);
......@@ -403,9 +404,15 @@ impl<O: IsA<Element> + IsA<glib::object::Object>> ElementExt for O {
}
}
//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 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: PadLinkCheck) -> 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_full(self.to_glib_none().0, srcpadname.0, dest.to_glib_none().0, destpadname.0, flags.to_glib()))
}
}
fn lost_state(&self) {
unsafe {
......
......@@ -120,6 +120,58 @@ impl SetValue for ElementFlags {
}
}
bitflags! {
pub struct PadLinkCheck: u32 {
const PAD_LINK_CHECK_NOTHING = 0;
const PAD_LINK_CHECK_HIERARCHY = 1;
const PAD_LINK_CHECK_TEMPLATE_CAPS = 2;
const PAD_LINK_CHECK_CAPS = 4;
const PAD_LINK_CHECK_NO_RECONFIGURE = 8;
const PAD_LINK_CHECK_DEFAULT = 5;
}
}
#[doc(hidden)]
impl ToGlib for PadLinkCheck {
type GlibType = ffi::GstPadLinkCheck;
fn to_glib(&self) -> ffi::GstPadLinkCheck {
ffi::GstPadLinkCheck::from_bits_truncate(self.bits())
}
}
#[doc(hidden)]
impl FromGlib<ffi::GstPadLinkCheck> for PadLinkCheck {
fn from_glib(value: ffi::GstPadLinkCheck) -> PadLinkCheck {
skip_assert_initialized!();
PadLinkCheck::from_bits_truncate(value.bits())
}
}
impl StaticType for PadLinkCheck {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_pad_link_check_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for PadLinkCheck {
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
Some(FromValue::from_value(value))
}
}
impl<'a> FromValue<'a> for PadLinkCheck {
unsafe fn from_value(value: &Value) -> Self {
from_glib(ffi::GstPadLinkCheck::from_bits_truncate(gobject_ffi::g_value_get_flags(value.to_glib_none().0)))
}
}
impl SetValue for PadLinkCheck {
unsafe fn set_value(value: &mut Value, this: &Self) {
gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib().bits())
}
}
bitflags! {
pub struct PadProbeType: u32 {
const PAD_PROBE_TYPE_INVALID = 0;
......
......@@ -163,6 +163,13 @@ pub use self::flags::ELEMENT_FLAG_PROVIDE_CLOCK;
pub use self::flags::ELEMENT_FLAG_REQUIRE_CLOCK;
pub use self::flags::ELEMENT_FLAG_INDEXABLE;
pub use self::flags::ELEMENT_FLAG_LAST;
pub use self::flags::PadLinkCheck;
pub use self::flags::PAD_LINK_CHECK_NOTHING;
pub use self::flags::PAD_LINK_CHECK_HIERARCHY;
pub use self::flags::PAD_LINK_CHECK_TEMPLATE_CAPS;
pub use self::flags::PAD_LINK_CHECK_CAPS;
pub use self::flags::PAD_LINK_CHECK_NO_RECONFIGURE;
pub use self::flags::PAD_LINK_CHECK_DEFAULT;
pub use self::flags::PadProbeType;
pub use self::flags::PAD_PROBE_TYPE_INVALID;
pub use self::flags::PAD_PROBE_TYPE_IDLE;
......
......@@ -10,6 +10,7 @@ use Format;
use Iterator;
use Object;
use PadDirection;
use PadLinkCheck;
use PadLinkReturn;
use PadMode;
use PadTemplate;
......@@ -135,13 +136,13 @@ pub trait PadExt {
fn link<P: IsA<Pad>>(&self, sinkpad: &P) -> PadLinkReturn;
//fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: /*Ignored*/PadLinkCheck) -> PadLinkReturn;
fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: PadLinkCheck) -> PadLinkReturn;
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> Result<(), glib::error::BoolError>;
//#[cfg(feature = "v1_10")]
//fn link_maybe_ghosting_full<P: IsA<Pad>>(&self, sink: &P, flags: /*Ignored*/PadLinkCheck) -> bool;
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting_full<P: IsA<Pad>>(&self, sink: &P, flags: PadLinkCheck) -> bool;
fn mark_reconfigure(&self);
......@@ -395,9 +396,11 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
//fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: /*Ignored*/PadLinkCheck) -> PadLinkReturn {
// unsafe { TODO: call ffi::gst_pad_link_full() }
//}
fn link_full<P: IsA<Pad>>(&self, sinkpad: &P, flags: PadLinkCheck) -> PadLinkReturn {
unsafe {
from_glib(ffi::gst_pad_link_full(self.to_glib_none().0, sinkpad.to_glib_none().0, flags.to_glib()))
}
}
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> Result<(), glib::error::BoolError> {
......@@ -406,10 +409,12 @@ impl<O: IsA<Pad> + IsA<glib::object::Object>> PadExt for O {
}
}
//#[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() }
//}
#[cfg(feature = "v1_10")]
fn link_maybe_ghosting_full<P: IsA<Pad>>(&self, sink: &P, flags: PadLinkCheck) -> bool {
unsafe {
from_glib(ffi::gst_pad_link_maybe_ghosting_full(self.to_glib_none().0, sink.to_glib_none().0, flags.to_glib()))
}
}
fn mark_reconfigure(&self) {
unsafe {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment