diff --git a/gstreamer-video/src/video_format_info.rs b/gstreamer-video/src/video_format_info.rs index 5ba2cdc91..cc7bb26ce 100644 --- a/gstreamer-video/src/video_format_info.rs +++ b/gstreamer-video/src/video_format_info.rs @@ -8,6 +8,7 @@ use std::str; use glib::translate::{from_glib, IntoGlib, ToGlibPtr}; #[doc(alias = "GstVideoFormatInfo")] +#[derive(Copy, Clone)] pub struct VideoFormatInfo(&'static ffi::GstVideoFormatInfo); impl VideoFormatInfo { diff --git a/gstreamer-video/src/video_info.rs b/gstreamer-video/src/video_info.rs index 2ca78aeb9..5cbe52fc6 100644 --- a/gstreamer-video/src/video_info.rs +++ b/gstreamer-video/src/video_info.rs @@ -83,6 +83,7 @@ impl ToValue for VideoColorRange { } #[doc(alias = "GstVideoColorimetry")] +#[derive(Copy, Clone)] pub struct VideoColorimetry(ffi::GstVideoColorimetry); impl VideoColorimetry { @@ -121,12 +122,6 @@ impl VideoColorimetry { } } -impl Clone for VideoColorimetry { - fn clone(&self) -> Self { - unsafe { Self(ptr::read(&self.0)) } - } -} - impl PartialEq for VideoColorimetry { #[doc(alias = "gst_video_colorimetry_is_equal")] fn eq(&self, other: &Self) -> bool { @@ -244,6 +239,7 @@ impl std::convert::TryFrom for crate::VideoMultiviewF } #[doc(alias = "GstVideoInfo")] +#[derive(Clone)] pub struct VideoInfo(pub(crate) ffi::GstVideoInfo); impl fmt::Debug for VideoInfo { @@ -853,12 +849,6 @@ impl VideoInfo { } } -impl Clone for VideoInfo { - fn clone(&self) -> Self { - unsafe { Self(ptr::read(&self.0)) } - } -} - impl PartialEq for VideoInfo { #[doc(alias = "gst_video_info_is_equal")] fn eq(&self, other: &Self) -> bool {