mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 19:11:06 +00:00
Run video_rectangle.rs through rustfmt
This commit is contained in:
parent
4ce1221ef4
commit
950e5dbc32
1 changed files with 24 additions and 7 deletions
|
@ -18,16 +18,33 @@ pub struct VideoRectangle {
|
||||||
|
|
||||||
impl VideoRectangle {
|
impl VideoRectangle {
|
||||||
pub fn new(x: i32, y: i32, w: i32, h: i32) -> Self {
|
pub fn new(x: i32, y: i32, w: i32, h: i32) -> Self {
|
||||||
VideoRectangle {
|
VideoRectangle { x, y, w, h }
|
||||||
x, y, w, h
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn center_video_rectangle(src: VideoRectangle, dst: VideoRectangle, scale: bool) -> VideoRectangle {
|
pub fn center_video_rectangle(
|
||||||
let mut result = ffi::GstVideoRectangle { x: 0, y: 0, w: 0, h: 0 };
|
src: VideoRectangle,
|
||||||
let src_rect = ffi::GstVideoRectangle { x: src.x, y: src.y, w: src.w, h: src.h };
|
dst: VideoRectangle,
|
||||||
let dst_rect = ffi::GstVideoRectangle { x: dst.x, y: dst.y, w: dst.w, h: dst.h };
|
scale: bool,
|
||||||
|
) -> VideoRectangle {
|
||||||
|
let mut result = ffi::GstVideoRectangle {
|
||||||
|
x: 0,
|
||||||
|
y: 0,
|
||||||
|
w: 0,
|
||||||
|
h: 0,
|
||||||
|
};
|
||||||
|
let src_rect = ffi::GstVideoRectangle {
|
||||||
|
x: src.x,
|
||||||
|
y: src.y,
|
||||||
|
w: src.w,
|
||||||
|
h: src.h,
|
||||||
|
};
|
||||||
|
let dst_rect = ffi::GstVideoRectangle {
|
||||||
|
x: dst.x,
|
||||||
|
y: dst.y,
|
||||||
|
w: dst.w,
|
||||||
|
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 as i32);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue