gstreamer-rs/gstreamer-video/src/video_aggregator.rs
Sebastian Dröge abbc85c3d0 Remove unnecessary trait sealing
For all these traits only the implementation that already exists is possible.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1563>
2024-10-20 17:48:45 +00:00

25 lines
701 B
Rust

use glib::translate::*;
use gst::prelude::*;
use crate::{ffi, VideoAggregator};
pub trait VideoAggregatorExtManual: 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 {}