use crate::priv_prelude::*; wrap_gst!(Pad, gstreamer::Pad); impl Pad { #[track_caller] pub fn ghost(target: &Pad) -> Result { let ghost_pad = gstreamer::GhostPad::with_target(&target.inner) .change_context(Error) .attach("Failed to create ghost pad")?; Ok(Pad { inner: ghost_pad.upcast(), }) } #[track_caller] pub fn link(&self, peer: &Pad) -> Result<()> { use gstreamer::prelude::*; self.inner .link(&peer.inner) .change_context(Error) .attach("Failed to link pads")?; Ok(()) } #[track_caller] pub fn current_caps(&self) -> Result { let caps = self .inner .current_caps() .ok_or(Error) .attach("Failed to get pad caps")?; Ok(Caps { inner: caps }) } #[track_caller] pub fn activate(&self, activate: bool) -> Result<()> { use gstreamer::prelude::*; self.inner .set_active(activate) .change_context(Error) .attach("Failed to set_active pad")?; Ok(()) } }