2018-04-23 17:34:22 +00:00
|
|
|
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
|
|
|
// from gir-files (https://github.com/gtk-rs/gir-files)
|
2017-05-12 12:24:03 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::Caps;
|
|
|
|
use crate::Element;
|
|
|
|
use crate::Event;
|
|
|
|
use crate::EventType;
|
|
|
|
use crate::Object;
|
|
|
|
use crate::PadDirection;
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::PadLinkCheck;
|
|
|
|
use crate::PadMode;
|
|
|
|
use crate::PadTemplate;
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::Stream;
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::TaskState;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::object::Cast;
|
|
|
|
use glib::object::IsA;
|
|
|
|
use glib::signal::connect_raw;
|
|
|
|
use glib::signal::SignalHandlerId;
|
|
|
|
use glib::translate::*;
|
|
|
|
use glib::StaticType;
|
|
|
|
use std::boxed::Box as Box_;
|
2020-04-13 16:11:33 +00:00
|
|
|
use std::mem::transmute;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_wrapper! {
|
|
|
|
pub struct Pad(Object<ffi::GstPad, ffi::GstPadClass>) @extends Object;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
match fn {
|
2020-11-21 13:46:33 +00:00
|
|
|
get_type => || ffi::gst_pad_get_type(),
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-25 08:04:37 +00:00
|
|
|
unsafe impl Send for Pad {}
|
|
|
|
unsafe impl Sync for Pad {}
|
|
|
|
|
2019-01-16 11:32:39 +00:00
|
|
|
pub const NONE_PAD: Option<&Pad> = None;
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
pub trait PadExt: 'static {
|
2017-07-29 11:58:54 +00:00
|
|
|
fn activate_mode(&self, mode: PadMode, active: bool) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool;
|
|
|
|
|
|
|
|
fn check_reconfigure(&self) -> bool;
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn create_stream_id<P: IsA<Element>>(
|
|
|
|
&self,
|
|
|
|
parent: &P,
|
|
|
|
stream_id: Option<&str>,
|
2020-12-01 19:01:05 +00:00
|
|
|
) -> glib::GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> glib::GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> glib::GString;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn get_allowed_caps(&self) -> Option<Caps>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn get_current_caps(&self) -> Option<Caps>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn get_direction(&self) -> PadDirection;
|
|
|
|
|
|
|
|
//fn get_element_private(&self) -> /*Unimplemented*/Option<Fundamental: Pointer>;
|
|
|
|
|
|
|
|
fn get_offset(&self) -> i64;
|
|
|
|
|
|
|
|
fn get_pad_template(&self) -> Option<PadTemplate>;
|
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn get_pad_template_caps(&self) -> Caps;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn get_parent_element(&self) -> Option<Element>;
|
|
|
|
|
|
|
|
fn get_peer(&self) -> Option<Pad>;
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-04-30 16:51:41 +00:00
|
|
|
fn get_single_internal_link(&self) -> Option<Pad>;
|
|
|
|
|
2017-07-30 14:09:51 +00:00
|
|
|
fn get_sticky_event(&self, event_type: EventType, idx: u32) -> Option<Event>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2017-07-04 22:47:33 +00:00
|
|
|
fn get_stream(&self) -> Option<Stream>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
fn get_stream_id(&self) -> Option<glib::GString>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2017-09-17 21:32:29 +00:00
|
|
|
fn get_task_state(&self) -> TaskState;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2017-09-17 15:41:02 +00:00
|
|
|
//fn iterate_internal_links(&self) -> /*Ignored*/Option<Iterator>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
//fn iterate_internal_links_default<P: IsA<Object>>(&self, parent: Option<&P>) -> /*Ignored*/Option<Iterator>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2017-06-24 09:02:24 +00:00
|
|
|
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn link_maybe_ghosting_full<P: IsA<Pad>>(
|
|
|
|
&self,
|
|
|
|
sink: &P,
|
|
|
|
flags: PadLinkCheck,
|
|
|
|
) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn mark_reconfigure(&self);
|
|
|
|
|
|
|
|
fn needs_reconfigure(&self) -> bool;
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn pause_task(&self) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn peer_query_accept_caps(&self, caps: &Caps) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn peer_query_caps(&self, filter: Option<&Caps>) -> Caps;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn query_accept_caps(&self, caps: &Caps) -> bool;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn query_caps(&self, filter: Option<&Caps>) -> Caps;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn set_element_private(&self, priv_: /*Unimplemented*/Option<Fundamental: Pointer>);
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn set_offset(&self, offset: i64);
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn stop_task(&self) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError>;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn use_fixed_caps(&self);
|
|
|
|
|
2017-08-18 13:29:21 +00:00
|
|
|
fn get_property_caps(&self) -> Option<Caps>;
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F)
|
|
|
|
-> SignalHandlerId;
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_caps_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2017-08-18 13:29:21 +00:00
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn connect_property_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId;
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2018-12-08 09:05:20 +00:00
|
|
|
impl<O: IsA<Pad>> PadExt for O {
|
2017-07-29 11:58:54 +00:00
|
|
|
fn activate_mode(&self, mode: PadMode, active: bool) -> Result<(), glib::error::BoolError> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_activate_mode(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
mode.to_glib(),
|
|
|
|
active.to_glib()
|
|
|
|
),
|
|
|
|
"Failed to activate mode pad"
|
|
|
|
)
|
2017-07-29 11:58:54 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn can_link<P: IsA<Pad>>(&self, sinkpad: &P) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_can_link(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sinkpad.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn check_reconfigure(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_check_reconfigure(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-18 10:12:00 +00:00
|
|
|
fn create_stream_id<P: IsA<Element>>(
|
|
|
|
&self,
|
|
|
|
parent: &P,
|
|
|
|
stream_id: Option<&str>,
|
2020-12-01 19:01:05 +00:00
|
|
|
) -> glib::GString {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_create_stream_id(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
parent.as_ref().to_glib_none().0,
|
|
|
|
stream_id.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
//fn create_stream_id_printf<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> glib::GString {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_create_stream_id_printf() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
//fn create_stream_id_printf_valist<P: IsA<Element>>(&self, parent: &P, stream_id: Option<&str>, var_args: /*Unknown conversion*//*Unimplemented*/Unsupported) -> glib::GString {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_create_stream_id_printf_valist() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
fn forward<P: FnMut(&Pad) -> bool>(&self, forward: P) -> bool {
|
|
|
|
let forward_data: P = forward;
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn forward_func<P: FnMut(&Pad) -> bool>(
|
2020-11-21 13:46:33 +00:00
|
|
|
pad: *mut ffi::GstPad,
|
|
|
|
user_data: glib::ffi::gpointer,
|
|
|
|
) -> glib::ffi::gboolean {
|
2019-01-29 13:53:44 +00:00
|
|
|
let pad = from_glib_borrow(pad);
|
|
|
|
let callback: *mut P = user_data as *const _ as usize as *mut P;
|
|
|
|
let res = (*callback)(&pad);
|
|
|
|
res.to_glib()
|
|
|
|
}
|
|
|
|
let forward = Some(forward_func::<P> as _);
|
|
|
|
let super_callback0: &P = &forward_data;
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_forward(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
forward,
|
|
|
|
super_callback0 as *const _ as usize as *mut _,
|
|
|
|
))
|
2019-01-29 13:53:44 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn get_allowed_caps(&self) -> Option<Caps> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_allowed_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn get_current_caps(&self) -> Option<Caps> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_current_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn get_direction(&self) -> PadDirection {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_get_direction(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//fn get_element_private(&self) -> /*Unimplemented*/Option<Fundamental: Pointer> {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_get_element_private() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
|
|
|
fn get_offset(&self) -> i64 {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { ffi::gst_pad_get_offset(self.as_ref().to_glib_none().0) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn get_pad_template(&self) -> Option<PadTemplate> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_pad_template(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn get_pad_template_caps(&self) -> Caps {
|
2017-07-10 21:02:08 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_pad_template_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn get_parent_element(&self) -> Option<Element> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_parent_element(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn get_peer(&self) -> Option<Pad> {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_pad_get_peer(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_18", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
|
2020-04-30 16:51:41 +00:00
|
|
|
fn get_single_internal_link(&self) -> Option<Pad> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_single_internal_link(
|
2020-04-30 16:51:41 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-30 14:09:51 +00:00
|
|
|
fn get_sticky_event(&self, event_type: EventType, idx: u32) -> Option<Event> {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_get_sticky_event(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
event_type.to_glib(),
|
|
|
|
idx,
|
|
|
|
))
|
2017-07-30 14:09:51 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2017-07-04 22:47:33 +00:00
|
|
|
fn get_stream(&self) -> Option<Stream> {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_pad_get_stream(self.as_ref().to_glib_none().0)) }
|
2017-07-04 22:47:33 +00:00
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
fn get_stream_id(&self) -> Option<glib::GString> {
|
|
|
|
unsafe { from_glib_full(ffi::gst_pad_get_stream_id(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_12", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_12")))]
|
2017-09-17 21:32:29 +00:00
|
|
|
fn get_task_state(&self) -> TaskState {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_get_task_state(self.as_ref().to_glib_none().0)) }
|
2017-09-17 21:32:29 +00:00
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn has_current_caps(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_has_current_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn is_active(&self) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_is_active(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn is_blocked(&self) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_is_blocked(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn is_blocking(&self) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_is_blocking(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
fn is_linked(&self) -> bool {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_pad_is_linked(self.as_ref().to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2017-09-17 15:41:02 +00:00
|
|
|
//fn iterate_internal_links(&self) -> /*Ignored*/Option<Iterator> {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_iterate_internal_links() }
|
2017-09-17 15:41:02 +00:00
|
|
|
//}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2019-03-19 07:40:05 +00:00
|
|
|
//fn iterate_internal_links_default<P: IsA<Object>>(&self, parent: Option<&P>) -> /*Ignored*/Option<Iterator> {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_iterate_internal_links_default() }
|
2017-09-17 15:41:02 +00:00
|
|
|
//}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2017-06-24 09:02:24 +00:00
|
|
|
fn link_maybe_ghosting<P: IsA<Pad>>(&self, sink: &P) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_link_maybe_ghosting(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sink.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to link pads, possibly ghosting"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-27 13:37:24 +00:00
|
|
|
#[cfg(any(feature = "v1_10", feature = "dox"))]
|
|
|
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_10")))]
|
2019-06-18 10:12:00 +00:00
|
|
|
fn link_maybe_ghosting_full<P: IsA<Pad>>(
|
|
|
|
&self,
|
|
|
|
sink: &P,
|
|
|
|
flags: PadLinkCheck,
|
|
|
|
) -> Result<(), glib::error::BoolError> {
|
2017-08-14 19:19:47 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_link_maybe_ghosting_full(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sink.as_ref().to_glib_none().0,
|
|
|
|
flags.to_glib()
|
|
|
|
),
|
|
|
|
"Failed to link pads, possibly ghosting"
|
|
|
|
)
|
2017-08-14 19:19:47 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
fn mark_reconfigure(&self) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_pad_mark_reconfigure(self.as_ref().to_glib_none().0);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn needs_reconfigure(&self) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_needs_reconfigure(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn pause_task(&self) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_pause_task(self.as_ref().to_glib_none().0),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to pause pad task"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn peer_query_accept_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_peer_query_accept_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn peer_query_caps(&self, filter: Option<&Caps>) -> Caps {
|
2017-07-10 21:02:08 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_peer_query_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
filter.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-07-10 21:02:08 +00:00
|
|
|
fn query_accept_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_pad_query_accept_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-01 19:01:05 +00:00
|
|
|
fn query_caps(&self, filter: Option<&Caps>) -> Caps {
|
2017-07-10 21:02:08 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_full(ffi::gst_pad_query_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
filter.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn set_active(&self, active: bool) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_set_active(self.as_ref().to_glib_none().0, active.to_glib()),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to activate pad"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-29 13:53:44 +00:00
|
|
|
//fn set_element_private(&self, priv_: /*Unimplemented*/Option<Fundamental: Pointer>) {
|
2020-11-21 13:46:33 +00:00
|
|
|
// unsafe { TODO: call ffi:gst_pad_set_element_private() }
|
2017-05-12 12:24:03 +00:00
|
|
|
//}
|
|
|
|
|
|
|
|
fn set_offset(&self, offset: i64) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_pad_set_offset(self.as_ref().to_glib_none().0, offset);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn stop_task(&self) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_stop_task(self.as_ref().to_glib_none().0),
|
2019-06-18 10:12:00 +00:00
|
|
|
"Failed to stop pad task"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-24 09:02:24 +00:00
|
|
|
fn unlink<P: IsA<Pad>>(&self, sinkpad: &P) -> Result<(), glib::error::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::glib_result_from_gboolean!(
|
|
|
|
ffi::gst_pad_unlink(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.as_ref().to_glib_none().0,
|
|
|
|
sinkpad.as_ref().to_glib_none().0
|
|
|
|
),
|
|
|
|
"Failed to unlink pad"
|
|
|
|
)
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn use_fixed_caps(&self) {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
ffi::gst_pad_use_fixed_caps(self.as_ref().to_glib_none().0);
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-18 13:29:21 +00:00
|
|
|
fn get_property_caps(&self) -> Option<Caps> {
|
|
|
|
unsafe {
|
2020-11-27 13:37:24 +00:00
|
|
|
let mut value = glib::Value::from_type(<Caps as StaticType>::static_type());
|
2020-11-21 13:46:33 +00:00
|
|
|
glib::gobject_ffi::g_object_get_property(
|
|
|
|
self.to_glib_none().0 as *mut glib::gobject_ffi::GObject,
|
2019-06-18 10:12:00 +00:00
|
|
|
b"caps\0".as_ptr() as *const _,
|
|
|
|
value.to_glib_none_mut().0,
|
|
|
|
);
|
2019-08-10 17:32:57 +00:00
|
|
|
value
|
|
|
|
.get()
|
|
|
|
.expect("Return Value for property `caps` getter")
|
2017-08-18 13:29:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-09 13:01:32 +00:00
|
|
|
fn connect_linked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(&self, f: F) -> SignalHandlerId {
|
2019-06-18 10:12:00 +00:00
|
|
|
unsafe extern "C" fn linked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
2020-11-21 13:46:33 +00:00
|
|
|
this: *mut ffi::GstPad,
|
|
|
|
peer: *mut ffi::GstPad,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pad>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2020-04-05 14:52:56 +00:00
|
|
|
&Pad::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(peer),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"linked\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
linked_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_unlinked<F: Fn(&Self, &Pad) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn unlinked_trampoline<P, F: Fn(&P, &Pad) + Send + Sync + 'static>(
|
2020-11-21 13:46:33 +00:00
|
|
|
this: *mut ffi::GstPad,
|
|
|
|
peer: *mut ffi::GstPad,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pad>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2019-06-18 10:12:00 +00:00
|
|
|
f(
|
2020-04-05 14:52:56 +00:00
|
|
|
&Pad::from_glib_borrow(this).unsafe_cast_ref(),
|
2019-06-18 10:12:00 +00:00
|
|
|
&from_glib_borrow(peer),
|
|
|
|
)
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"unlinked\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
unlinked_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_caps_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_caps_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
2020-11-21 13:46:33 +00:00
|
|
|
this: *mut ffi::GstPad,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pad>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pad::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2017-08-18 13:29:21 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::caps\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_caps_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn connect_property_offset_notify<F: Fn(&Self) + Send + Sync + 'static>(
|
|
|
|
&self,
|
|
|
|
f: F,
|
|
|
|
) -> SignalHandlerId {
|
|
|
|
unsafe extern "C" fn notify_offset_trampoline<P, F: Fn(&P) + Send + Sync + 'static>(
|
2020-11-21 13:46:33 +00:00
|
|
|
this: *mut ffi::GstPad,
|
|
|
|
_param_spec: glib::ffi::gpointer,
|
|
|
|
f: glib::ffi::gpointer,
|
2019-06-18 10:12:00 +00:00
|
|
|
) where
|
|
|
|
P: IsA<Pad>,
|
2019-06-18 10:10:46 +00:00
|
|
|
{
|
|
|
|
let f: &F = &*(f as *const F);
|
2020-04-05 14:52:56 +00:00
|
|
|
f(&Pad::from_glib_borrow(this).unsafe_cast_ref())
|
2019-06-18 10:10:46 +00:00
|
|
|
}
|
2017-08-18 13:29:21 +00:00
|
|
|
unsafe {
|
2019-01-29 13:53:44 +00:00
|
|
|
let f: Box_<F> = Box_::new(f);
|
2019-06-18 10:12:00 +00:00
|
|
|
connect_raw(
|
|
|
|
self.as_ptr() as *mut _,
|
|
|
|
b"notify::offset\0".as_ptr() as *const _,
|
2020-04-13 16:11:33 +00:00
|
|
|
Some(transmute::<_, unsafe extern "C" fn()>(
|
|
|
|
notify_offset_trampoline::<Self, F> as *const (),
|
|
|
|
)),
|
2019-06-18 10:12:00 +00:00
|
|
|
Box_::into_raw(f),
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|