diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index f9a28e7b5..c776ab52c 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -28,6 +28,13 @@ macro_rules! mini_object_wrapper ( } impl $name { + #[inline] + pub unsafe fn from_glib_ptr_borrow<'a>( + ptr: *const *const $ffi_name, + ) -> &'a Self { + &*(ptr as *const $name) + } + #[inline] pub unsafe fn from_glib_none(ptr: *const $ffi_name) -> Self { skip_assert_initialized!();