From 4297f8f5c58cb6dfd8864a069482ddf777a3cd6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 3 Jan 2018 17:36:44 +0200 Subject: [PATCH] Don't implement Copy for VideoRectangle and pass by reference to center_video_rectangle() --- gstreamer-video/src/video_rectangle.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gstreamer-video/src/video_rectangle.rs b/gstreamer-video/src/video_rectangle.rs index 1baf59827..deb5d40bc 100644 --- a/gstreamer-video/src/video_rectangle.rs +++ b/gstreamer-video/src/video_rectangle.rs @@ -7,8 +7,9 @@ // except according to those terms. use ffi; +use glib::translate::ToGlib; -#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] +#[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct VideoRectangle { pub x: i32, pub y: i32, @@ -23,8 +24,8 @@ impl VideoRectangle { } pub fn center_video_rectangle( - src: VideoRectangle, - dst: VideoRectangle, + src: &VideoRectangle, + dst: &VideoRectangle, scale: bool, ) -> VideoRectangle { let mut result = ffi::GstVideoRectangle { @@ -46,7 +47,7 @@ pub fn center_video_rectangle( h: dst.h, }; unsafe { - ffi::gst_video_sink_center_rect(src_rect, dst_rect, &mut result, scale as i32); + ffi::gst_video_sink_center_rect(src_rect, dst_rect, &mut result, scale.to_glib()); } VideoRectangle::new(result.x, result.y, result.w, result.h) }