Caps::subtract() does not take ownership of the arguments and can be implemented for CapsRef

This commit is contained in:
Sebastian Dröge 2018-07-06 17:56:55 +02:00
parent 8c268ecd06
commit 480d373fbc

View file

@ -88,11 +88,6 @@ impl GstRc<CapsRef> {
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 {