From 30b9527112eda1711bc73afaf2fefff1da9dfeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 3 Oct 2018 16:54:00 +0300 Subject: [PATCH] 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 without the additional wrapping. --- gstreamer/src/miniobject.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gstreamer/src/miniobject.rs b/gstreamer/src/miniobject.rs index 7e5136a3c..2be830a6a 100644 --- a/gstreamer/src/miniobject.rs +++ b/gstreamer/src/miniobject.rs @@ -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 {