mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 09:53:49 +00:00
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:
parent
2865bdfc92
commit
25e1714cfe
1 changed files with 3 additions and 6 deletions
|
@ -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")]
|
||||||
|
|
Loading…
Reference in a new issue