Move gst_mini_object_copy() from GstRc<T> to MiniObject directly

It can also be called on the shallow references.
This commit is contained in:
Sebastian Dröge 2017-10-12 17:58:46 +03:00
parent b773c0b46a
commit 1f16a39ca4

View file

@ -84,15 +84,6 @@ impl<T: MiniObject> GstRc<T> {
}
}
pub fn copy(&self) -> Self {
unsafe {
GstRc::from_glib_full(
ffi::gst_mini_object_copy(self.as_ptr() as *const ffi::GstMiniObject) as
*const T::GstType,
)
}
}
pub fn is_writable(&self) -> bool {
unsafe {
from_glib(ffi::gst_mini_object_is_writable(
@ -199,6 +190,15 @@ where
assert!(!ptr.is_null());
&mut *(ptr as *mut Self)
}
fn copy(&self) -> GstRc<Self> {
unsafe {
GstRc::from_glib_full(
ffi::gst_mini_object_copy(self.as_ptr() as *const ffi::GstMiniObject) as
*const Self::GstType,
)
}
}
}
impl<'a, T: MiniObject + 'static> ToGlibPtr<'a, *const T::GstType> for GstRc<T> {