mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 03:21:03 +00:00
Don't implement Copy for VideoRectangle and pass by reference to center_video_rectangle()
This commit is contained in:
parent
24b263acef
commit
7a779fe940
1 changed files with 5 additions and 4 deletions
|
@ -7,8 +7,9 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use ffi;
|
use ffi;
|
||||||
|
use glib::translate::ToGlib;
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
||||||
pub struct VideoRectangle {
|
pub struct VideoRectangle {
|
||||||
pub x: i32,
|
pub x: i32,
|
||||||
pub y: i32,
|
pub y: i32,
|
||||||
|
@ -23,8 +24,8 @@ impl VideoRectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn center_video_rectangle(
|
pub fn center_video_rectangle(
|
||||||
src: VideoRectangle,
|
src: &VideoRectangle,
|
||||||
dst: VideoRectangle,
|
dst: &VideoRectangle,
|
||||||
scale: bool,
|
scale: bool,
|
||||||
) -> VideoRectangle {
|
) -> VideoRectangle {
|
||||||
let mut result = ffi::GstVideoRectangle {
|
let mut result = ffi::GstVideoRectangle {
|
||||||
|
@ -46,7 +47,7 @@ pub fn center_video_rectangle(
|
||||||
h: dst.h,
|
h: dst.h,
|
||||||
};
|
};
|
||||||
unsafe {
|
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)
|
VideoRectangle::new(result.x, result.y, result.w, result.h)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue