Implement ::copy() directly on miniobject wrapper types

This provides the additional wrapping as the one via get via deref will
only give back a GstRc<T> without the additional wrapping.
This commit is contained in:
Sebastian Dröge 2018-10-03 16:54:00 +03:00
parent 8f71a81cb5
commit 30b9527112

View file

@ -515,6 +515,10 @@ macro_rules! gst_define_mini_object_wrapper(
pub unsafe fn into_ptr(self) -> *mut $ffi_name {
self.0.into_ptr()
}
pub fn copy(&self) -> Self {
$name(self.0.copy())
}
}
impl From<$crate::GstRc<$ref_name>> for $name {