From 480d373fbcff97bf54a0160f52bf3c14e4c5ef4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 6 Jul 2018 17:56:55 +0200 Subject: [PATCH] Caps::subtract() does not take ownership of the arguments and can be implemented for CapsRef --- gstreamer/src/caps.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gstreamer/src/caps.rs b/gstreamer/src/caps.rs index e4b204e1e..f0c07cec4 100644 --- a/gstreamer/src/caps.rs +++ b/gstreamer/src/caps.rs @@ -88,11 +88,6 @@ impl GstRc { unsafe { from_glib_full(ffi::gst_caps_simplify(caps.into_ptr())) } } - pub fn subtract(caps: Self, other: Self) -> Self { - skip_assert_initialized!(); - unsafe { from_glib_full(ffi::gst_caps_subtract(caps.into_ptr(), other.into_ptr())) } - } - pub fn truncate(caps: Self) -> Self { skip_assert_initialized!(); unsafe { from_glib_full(ffi::gst_caps_truncate(caps.into_ptr())) } @@ -254,6 +249,11 @@ impl CapsRef { )) } } + + pub fn subtract(&self, other: &Self) -> Caps { + skip_assert_initialized!(); + unsafe { from_glib_full(ffi::gst_caps_subtract(self.as_mut_ptr(), other.as_mut_ptr())) } + } } impl glib::types::StaticType for CapsRef {