gstreamer-rs/gstreamer/src/auto/ghost_pad.rs

55 lines
1.6 KiB
Rust
Raw Normal View History

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)
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
2017-07-29 13:19:15 +00:00
// DO NOT EDIT
2020-11-21 13:46:33 +00:00
use crate::Object;
use crate::Pad;
use crate::ProxyPad;
2017-07-29 13:19:15 +00:00
use glib::object::IsA;
use glib::translate::*;
2020-12-17 22:34:53 +00:00
glib::wrapper! {
2020-11-21 13:46:33 +00:00
pub struct GhostPad(Object<ffi::GstGhostPad, ffi::GstGhostPadClass>) @extends ProxyPad, Pad, Object;
2017-07-29 13:19:15 +00:00
match fn {
type_ => || ffi::gst_ghost_pad_get_type(),
2017-07-29 13:19:15 +00:00
}
}
unsafe impl Send for GhostPad {}
unsafe impl Sync for GhostPad {}
2019-01-16 11:32:39 +00:00
pub const NONE_GHOST_PAD: Option<&GhostPad> = None;
pub trait GhostPadExt: 'static {
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_ghost_pad_get_target")]
#[doc(alias = "get_target")]
2021-04-11 19:38:18 +00:00
fn target(&self) -> Option<Pad>;
2017-07-29 13:19:15 +00:00
2020-12-08 13:00:17 +00:00
#[doc(alias = "gst_ghost_pad_set_target")]
2019-03-19 07:40:05 +00:00
fn set_target<P: IsA<Pad>>(&self, newtarget: Option<&P>) -> Result<(), glib::error::BoolError>;
2017-07-29 13:19:15 +00:00
}
impl<O: IsA<GhostPad>> GhostPadExt for O {
2021-04-11 19:38:18 +00:00
fn target(&self) -> Option<Pad> {
2017-07-29 13:19:15 +00:00
unsafe {
2020-11-21 13:46:33 +00:00
from_glib_full(ffi::gst_ghost_pad_get_target(
self.as_ref().to_glib_none().0,
))
2017-07-29 13:19:15 +00:00
}
}
2019-03-19 07:40:05 +00:00
fn set_target<P: IsA<Pad>>(&self, newtarget: Option<&P>) -> Result<(), glib::error::BoolError> {
2017-07-29 13:19:15 +00:00
unsafe {
2020-12-17 22:34:53 +00:00
glib::result_from_gboolean!(
2020-11-21 13:46:33 +00:00
ffi::gst_ghost_pad_set_target(
self.as_ref().to_glib_none().0,
newtarget.map(|p| p.as_ref()).to_glib_none().0
),
"Failed to set target"
)
2017-07-29 13:19:15 +00:00
}
}
}