change fn signature in IntoGlibPtr to match glib latest

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1658>
This commit is contained in:
will 2025-03-03 12:16:45 +11:00 committed by Sebastian Dröge
parent 1ab5e0b963
commit 0b58d4430c
9 changed files with 25 additions and 25 deletions

24
Cargo.lock generated
View file

@ -169,7 +169,7 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9"
[[package]] [[package]]
name = "cairo-rs" name = "cairo-rs"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"cairo-sys-rs", "cairo-sys-rs",
@ -180,7 +180,7 @@ dependencies = [
[[package]] [[package]]
name = "cairo-sys-rs" name = "cairo-sys-rs"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
@ -725,7 +725,7 @@ dependencies = [
[[package]] [[package]]
name = "gio" name = "gio"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"futures-channel", "futures-channel",
"futures-core", "futures-core",
@ -741,7 +741,7 @@ dependencies = [
[[package]] [[package]]
name = "gio-sys" name = "gio-sys"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@ -770,7 +770,7 @@ dependencies = [
[[package]] [[package]]
name = "glib" name = "glib"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"bitflags 2.8.0", "bitflags 2.8.0",
"futures-channel", "futures-channel",
@ -790,7 +790,7 @@ dependencies = [
[[package]] [[package]]
name = "glib-macros" name = "glib-macros"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"heck", "heck",
"proc-macro-crate", "proc-macro-crate",
@ -802,7 +802,7 @@ dependencies = [
[[package]] [[package]]
name = "glib-sys" name = "glib-sys"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"libc", "libc",
"system-deps", "system-deps",
@ -876,7 +876,7 @@ dependencies = [
[[package]] [[package]]
name = "gobject-sys" name = "gobject-sys"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"libc", "libc",
@ -1971,7 +1971,7 @@ dependencies = [
[[package]] [[package]]
name = "pango" name = "pango"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"gio", "gio",
"glib", "glib",
@ -1982,7 +1982,7 @@ dependencies = [
[[package]] [[package]]
name = "pango-sys" name = "pango-sys"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"glib-sys", "glib-sys",
"gobject-sys", "gobject-sys",
@ -1993,7 +1993,7 @@ dependencies = [
[[package]] [[package]]
name = "pangocairo" name = "pangocairo"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"cairo-rs", "cairo-rs",
"glib", "glib",
@ -2005,7 +2005,7 @@ dependencies = [
[[package]] [[package]]
name = "pangocairo-sys" name = "pangocairo-sys"
version = "0.21.0" version = "0.21.0"
source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#a7079b6862891393e33c84dfb9111d848a1a39cc" source = "git+https://github.com/gtk-rs/gtk-rs-core?branch=main#9ce31b97ee1e26e5e3bacffaad26963a437af03e"
dependencies = [ dependencies = [
"cairo-sys-rs", "cairo-sys-rs",
"glib-sys", "glib-sys",

View file

@ -120,7 +120,7 @@ impl PlayConfig {
impl IntoGlibPtr<*mut gst::ffi::GstStructure> for PlayConfig { impl IntoGlibPtr<*mut gst::ffi::GstStructure> for PlayConfig {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut gst::ffi::GstStructure { fn into_glib_ptr(self) -> *mut gst::ffi::GstStructure {
let mut s = mem::ManuallyDrop::new(self); let mut s = mem::ManuallyDrop::new(self);
s.0.to_glib_none_mut().0 s.0.to_glib_none_mut().0
} }

View file

@ -99,7 +99,7 @@ impl PlayerConfig {
impl IntoGlibPtr<*mut gst::ffi::GstStructure> for PlayerConfig { impl IntoGlibPtr<*mut gst::ffi::GstStructure> for PlayerConfig {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut gst::ffi::GstStructure { fn into_glib_ptr(self) -> *mut gst::ffi::GstStructure {
let mut s = mem::ManuallyDrop::new(self); let mut s = mem::ManuallyDrop::new(self);
s.0.to_glib_none_mut().0 s.0.to_glib_none_mut().0
} }

View file

@ -237,9 +237,11 @@ impl<'a> VideoCodecFrame<'a> {
impl IntoGlibPtr<*mut ffi::GstVideoCodecFrame> for VideoCodecFrame<'_> { impl IntoGlibPtr<*mut ffi::GstVideoCodecFrame> for VideoCodecFrame<'_> {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut ffi::GstVideoCodecFrame { fn into_glib_ptr(self) -> *mut ffi::GstVideoCodecFrame {
let stream_lock = self.element.stream_lock(); let stream_lock = self.element.stream_lock();
glib::ffi::g_rec_mutex_unlock(stream_lock); unsafe {
glib::ffi::g_rec_mutex_unlock(stream_lock);
}
let s = mem::ManuallyDrop::new(self); let s = mem::ManuallyDrop::new(self);
s.to_glib_none().0 s.to_glib_none().0

View file

@ -1125,11 +1125,9 @@ impl AncillaryMeta {
#[inline] #[inline]
pub fn set_data(&mut self, data: glib::Slice<u16>) { pub fn set_data(&mut self, data: glib::Slice<u16>) {
unsafe { assert!(data.len() < 256);
assert!(data.len() < 256); self.0.data_count = data.len() as u16;
self.0.data_count = data.len() as u16; self.0.data = data.into_glib_ptr();
self.0.data = data.into_glib_ptr();
}
} }
#[inline] #[inline]

View file

@ -92,7 +92,7 @@ impl CapsFeatures {
impl IntoGlibPtr<*mut ffi::GstCapsFeatures> for CapsFeatures { impl IntoGlibPtr<*mut ffi::GstCapsFeatures> for CapsFeatures {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut ffi::GstCapsFeatures { fn into_glib_ptr(self) -> *mut ffi::GstCapsFeatures {
let s = mem::ManuallyDrop::new(self); let s = mem::ManuallyDrop::new(self);
s.0.as_ptr() s.0.as_ptr()
} }

View file

@ -221,7 +221,7 @@ where
impl<T: 'static> IntoGlibPtr<*mut ffi::GstIterator> for Iterator<T> { impl<T: 'static> IntoGlibPtr<*mut ffi::GstIterator> for Iterator<T> {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut ffi::GstIterator { fn into_glib_ptr(self) -> *mut ffi::GstIterator {
let s = mem::ManuallyDrop::new(self); let s = mem::ManuallyDrop::new(self);
let it = s.to_glib_none().0; let it = s.to_glib_none().0;
it as *mut _ it as *mut _

View file

@ -126,7 +126,7 @@ macro_rules! mini_object_wrapper (
impl $crate::glib::translate::IntoGlibPtr<*mut $ffi_name> for $name { impl $crate::glib::translate::IntoGlibPtr<*mut $ffi_name> for $name {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut $ffi_name { fn into_glib_ptr(self) -> *mut $ffi_name {
let s = std::mem::ManuallyDrop::new(self); let s = std::mem::ManuallyDrop::new(self);
s.as_mut_ptr() s.as_mut_ptr()
} }

View file

@ -164,7 +164,7 @@ impl Structure {
impl IntoGlibPtr<*mut ffi::GstStructure> for Structure { impl IntoGlibPtr<*mut ffi::GstStructure> for Structure {
#[inline] #[inline]
unsafe fn into_glib_ptr(self) -> *mut ffi::GstStructure { fn into_glib_ptr(self) -> *mut ffi::GstStructure {
let s = mem::ManuallyDrop::new(self); let s = mem::ManuallyDrop::new(self);
s.0.as_ptr() s.0.as_ptr()
} }