Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Zeeshan Ali
gstreamer-rs
Commits
7a779fe9
Commit
7a779fe9
authored
Jan 03, 2018
by
Sebastian Dröge
🍵
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't implement Copy for VideoRectangle and pass by reference to center_video_rectangle()
parent
24b263ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
gstreamer-video/src/video_rectangle.rs
gstreamer-video/src/video_rectangle.rs
+5
-4
No files found.
gstreamer-video/src/video_rectangle.rs
View file @
7a779fe9
...
...
@@ -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
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment