| 1 | // Take a look at the license at the top of the repository in the LICENSE file. |
| 2 | |
| 3 | use glib::{prelude::*, translate::*}; |
| 4 | use gst::prelude::*; |
| 5 | |
| 6 | use crate::{ffi, AggregatorPad}; |
| 7 | |
| 8 | mod sealed { |
| 9 | pub trait Sealed {} |
| 10 | impl<T: super::IsA<super::AggregatorPad>> Sealed for T {} |
| 11 | } |
| 12 | |
| 13 | pub trait AggregatorPadExtManual: sealed::Sealed + IsA<AggregatorPad> + 'static { |
| 14 | #[doc (alias = "get_segment" )] |
| 15 | fn segment(&self) -> gst::Segment { |
| 16 | unsafe { |
| 17 | let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _); |
| 18 | let _guard: ObjectLockGuard<'_, AggregatorPad> = self.as_ref().object_lock(); |
| 19 | from_glib_none(&ptr.segment as *const gst::ffi::GstSegment) |
| 20 | } |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O {} |
| 25 | |