diff --git a/gst-plugin/src/miniobject.rs b/gst-plugin/src/miniobject.rs index 7cf51110..d8c17ca9 100644 --- a/gst-plugin/src/miniobject.rs +++ b/gst-plugin/src/miniobject.rs @@ -72,6 +72,13 @@ impl GstRc { unsafe { GstRc::new_from_owned_ptr(gst_mini_object_copy(self.obj.as_ptr())) } } + fn is_writable(&self) -> bool { + extern "C" { + fn gst_mini_object_is_writable(obj: *mut c_void) -> GBoolean; + } + unsafe { gst_mini_object_is_writable(self.as_ptr()).to_bool() } + } + pub unsafe fn into_ptr(mut self) -> *mut c_void { self.obj.swap_ptr(ptr::null_mut()) } @@ -137,13 +144,6 @@ pub unsafe trait MiniObject { } unsafe fn new_from_ptr(ptr: *mut c_void) -> Self; - - fn is_writable(&self) -> bool { - extern "C" { - fn gst_mini_object_is_writable(obj: *mut c_void) -> GBoolean; - } - unsafe { gst_mini_object_is_writable(self.as_ptr()).to_bool() } - } } impl<'a, T: MiniObject> From<&'a T> for GstRc { @@ -191,6 +191,13 @@ impl<'a, T: MiniObject> GstRef<'a, T> { unsafe { GstRc::new_from_owned_ptr(gst_mini_object_copy(self.obj.as_ptr())) } } + fn is_writable(&self) -> bool { + extern "C" { + fn gst_mini_object_is_writable(obj: *mut c_void) -> GBoolean; + } + unsafe { gst_mini_object_is_writable(self.as_ptr()).to_bool() } + } + pub unsafe fn into_ptr(mut self) -> *mut c_void { self.obj.swap_ptr(ptr::null_mut()) }