2024-02-03 08:13:51 +00:00
|
|
|
use glib::translate::*;
|
2023-02-06 08:49:34 +00:00
|
|
|
use gst::prelude::*;
|
2023-01-03 18:58:25 +00:00
|
|
|
|
2024-06-02 08:48:53 +00:00
|
|
|
use crate::{ffi, VideoAggregator};
|
2022-03-21 17:18:54 +00:00
|
|
|
|
2024-10-19 15:09:56 +00:00
|
|
|
pub trait VideoAggregatorExtManual: IsA<VideoAggregator> + 'static {
|
2022-03-21 17:18:54 +00:00
|
|
|
fn video_info(&self) -> Option<crate::VideoInfo> {
|
|
|
|
unsafe {
|
|
|
|
let ptr = self.as_ptr() as *mut ffi::GstVideoAggregator;
|
2023-02-06 08:49:34 +00:00
|
|
|
let _guard = self.as_ref().object_lock();
|
2022-03-21 17:18:54 +00:00
|
|
|
|
|
|
|
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,
|
|
|
|
)))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-07-05 20:21:43 +00:00
|
|
|
|
|
|
|
impl<O: IsA<VideoAggregator>> VideoAggregatorExtManual for O {}
|