2020-12-15 10:53:31 +00:00
|
|
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
2018-08-01 16:18:15 +00:00
|
|
|
|
2023-01-03 18:58:25 +00:00
|
|
|
use glib::{prelude::*, translate::*};
|
2023-02-06 08:49:34 +00:00
|
|
|
use gst::prelude::*;
|
2023-01-03 18:58:25 +00:00
|
|
|
|
2020-11-21 17:59:22 +00:00
|
|
|
use crate::AggregatorPad;
|
2018-08-01 16:18:15 +00:00
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
mod sealed {
|
|
|
|
pub trait Sealed {}
|
|
|
|
impl<T: super::IsA<super::AggregatorPad>> Sealed for T {}
|
2018-08-01 16:18:15 +00:00
|
|
|
}
|
|
|
|
|
2023-07-05 20:21:43 +00:00
|
|
|
pub trait AggregatorPadExtManual: sealed::Sealed + IsA<AggregatorPad> + 'static {
|
|
|
|
#[doc(alias = "get_segment")]
|
2021-04-11 19:39:50 +00:00
|
|
|
fn segment(&self) -> gst::Segment {
|
2018-08-01 16:18:15 +00:00
|
|
|
unsafe {
|
2020-11-21 17:59:22 +00:00
|
|
|
let ptr: &ffi::GstAggregatorPad = &*(self.as_ptr() as *const _);
|
2023-02-06 08:49:34 +00:00
|
|
|
let _guard = self.as_ref().object_lock();
|
2020-11-21 17:59:22 +00:00
|
|
|
from_glib_none(&ptr.segment as *const gst::ffi::GstSegment)
|
2018-08-01 16:18:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<AggregatorPad>> AggregatorPadExtManual for O {}
|