mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-28 20:41:31 +00:00
aaea288abf
Some of the traits were moved to prelude or translate and no longer in the main scope of the crate Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1382>
30 lines
821 B
Rust
30 lines
821 B
Rust
use glib::translate::*;
|
|
use gst::prelude::*;
|
|
|
|
use crate::auto::VideoAggregator;
|
|
|
|
mod sealed {
|
|
pub trait Sealed {}
|
|
impl<T: super::IsA<super::VideoAggregator>> Sealed for T {}
|
|
}
|
|
|
|
pub trait VideoAggregatorExtManual: sealed::Sealed + IsA<VideoAggregator> + 'static {
|
|
fn video_info(&self) -> Option<crate::VideoInfo> {
|
|
unsafe {
|
|
let ptr = self.as_ptr() as *mut ffi::GstVideoAggregator;
|
|
let _guard = self.as_ref().object_lock();
|
|
|
|
let info = &(*ptr).info;
|
|
|
|
if info.finfo.is_null() || info.width <= 0 || info.height <= 0 {
|
|
return None;
|
|
}
|
|
|
|
Some(from_glib_none(mut_override(
|
|
info as *const ffi::GstVideoInfo,
|
|
)))
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<O: IsA<VideoAggregator>> VideoAggregatorExtManual for O {}
|