mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-06-02 13:29:29 +00:00
4ebec84f5e
Allows us to set all the crates in the main workspace file, so changing their versions or branch is much simpler and reduce the amount of noise in the diff Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1450>
31 lines
859 B
Rust
31 lines
859 B
Rust
use glib::translate::*;
|
|
use gst::prelude::*;
|
|
|
|
use crate::{ffi, AudioAggregatorPad};
|
|
|
|
mod sealed {
|
|
pub trait Sealed {}
|
|
impl<T: super::IsA<super::AudioAggregatorPad>> Sealed for T {}
|
|
}
|
|
|
|
pub trait AudioAggregatorPadExtManual: sealed::Sealed + IsA<AudioAggregatorPad> + 'static {
|
|
fn audio_info(&self) -> Option<crate::AudioInfo> {
|
|
unsafe {
|
|
let ptr = self.as_ptr() as *mut ffi::GstAudioAggregatorPad;
|
|
let _guard = self.as_ref().object_lock();
|
|
|
|
let info = &(*ptr).info;
|
|
|
|
if !info.finfo.is_null() && info.channels > 0 && info.rate > 0 && info.bpf > 0 {
|
|
return None;
|
|
}
|
|
|
|
Some(from_glib_none(mut_override(
|
|
info as *const ffi::GstAudioInfo,
|
|
)))
|
|
}
|
|
}
|
|
}
|
|
|
|
impl<O: IsA<AudioAggregatorPad>> AudioAggregatorPadExtManual for O {}
|