audiometa: Return an AudioInfo reference instead of a copy

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1698>
This commit is contained in:
Sebastian Dröge 2025-04-04 09:17:01 +03:00
parent 2865bdfc92
commit 25e1714cfe

View file

@ -8,10 +8,7 @@ use std::ptr;
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))] #[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
use std::slice; use std::slice;
use glib::translate::{from_glib, IntoGlib}; use glib::translate::*;
#[cfg(feature = "v1_16")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_16")))]
use glib::translate::{from_glib_none, ToGlibPtr};
use gst::prelude::*; use gst::prelude::*;
use crate::ffi; use crate::ffi;
@ -181,8 +178,8 @@ impl AudioMeta {
#[doc(alias = "get_info")] #[doc(alias = "get_info")]
#[inline] #[inline]
pub fn info(&self) -> crate::AudioInfo { pub fn info(&self) -> &crate::AudioInfo {
unsafe { from_glib_none(&self.0.info as *const _) } unsafe { &*(&self.0.info as *const ffi::GstAudioInfo as *const crate::AudioInfo) }
} }
#[doc(alias = "get_samples")] #[doc(alias = "get_samples")]