Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
351139f5
Commit
351139f5
authored
Nov 12, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed crop parameters in transform filter.
parent
b9188c54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
modules/video_filter/transform.c
modules/video_filter/transform.c
+15
-16
No files found.
modules/video_filter/transform.c
View file @
351139f5
...
@@ -177,12 +177,13 @@ static int Mouse(filter_t *filter, vlc_mouse_t *mouse,
...
@@ -177,12 +177,13 @@ static int Mouse(filter_t *filter, vlc_mouse_t *mouse,
static
int
Open
(
vlc_object_t
*
object
)
static
int
Open
(
vlc_object_t
*
object
)
{
{
filter_t
*
filter
=
(
filter_t
*
)
object
;
filter_t
*
filter
=
(
filter_t
*
)
object
;
const
video_format_t
*
src
=
&
filter
->
fmt_in
.
video
;
video_format_t
*
dst
=
&
filter
->
fmt_out
.
video
;
const
vlc_chroma_description_t
*
chroma
=
const
vlc_chroma_description_t
*
chroma
=
vlc_fourcc_GetChromaDescription
(
filter
->
fmt_in
.
video
.
i_chroma
);
vlc_fourcc_GetChromaDescription
(
src
->
i_chroma
);
if
(
!
chroma
||
chroma
->
plane_count
<
3
)
{
if
(
!
chroma
||
chroma
->
plane_count
<
3
)
{
msg_Err
(
filter
,
"Unsupported chroma (%4.4s)"
,
msg_Err
(
filter
,
"Unsupported chroma (%4.4s)"
,
(
char
*
)
&
src
->
i_chroma
);
(
char
*
)
&
filter
->
fmt_in
.
video
.
i_chroma
);
/* TODO support packed and rgb */
/* TODO support packed and rgb */
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
...
@@ -213,8 +214,6 @@ static int Open(vlc_object_t *object)
...
@@ -213,8 +214,6 @@ static int Open(vlc_object_t *object)
free
(
sys
);
free
(
sys
);
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
}
}
const
video_format_t
*
src
=
&
filter
->
fmt_in
.
video
;
video_format_t
*
dst
=
&
filter
->
fmt_out
.
video
;
dst
->
i_width
=
src
->
i_height
;
dst
->
i_width
=
src
->
i_height
;
dst
->
i_visible_width
=
src
->
i_visible_height
;
dst
->
i_visible_width
=
src
->
i_visible_height
;
...
@@ -222,18 +221,18 @@ static int Open(vlc_object_t *object)
...
@@ -222,18 +221,18 @@ static int Open(vlc_object_t *object)
dst
->
i_visible_height
=
src
->
i_visible_width
;
dst
->
i_visible_height
=
src
->
i_visible_width
;
dst
->
i_sar_num
=
src
->
i_sar_den
;
dst
->
i_sar_num
=
src
->
i_sar_den
;
dst
->
i_sar_den
=
src
->
i_sar_num
;
dst
->
i_sar_den
=
src
->
i_sar_num
;
}
dst
->
i_x_offset
=
INT_MAX
;
dst
->
i_x_offset
=
INT_MAX
;
dst
->
i_y_offset
=
INT_MIN
;
dst
->
i_y_offset
=
INT_MAX
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
int
tx
,
ty
;
int
tx
,
ty
;
sys
->
dsc
->
iconvert
(
&
tx
,
&
ty
,
sys
->
dsc
->
iconvert
(
&
tx
,
&
ty
,
src
->
i_width
,
src
->
i_height
,
src
->
i_width
,
src
->
i_height
,
src
->
i_x_offset
+
i
*
src
->
i_visible_width
,
src
->
i_x_offset
+
i
*
(
src
->
i_visible_width
-
1
),
src
->
i_y_offset
+
i
*
src
->
i_visible_height
);
src
->
i_y_offset
+
i
*
(
src
->
i_visible_height
-
1
));
dst
->
i_x_offset
=
__MIN
(
dst
->
i_x_offset
,
(
unsigned
)
tx
);
dst
->
i_x_offset
=
__MIN
(
dst
->
i_x_offset
,
(
unsigned
)(
1
+
tx
));
dst
->
i_y_offset
=
__MIN
(
dst
->
i_y_offset
,
(
unsigned
)
ty
);
dst
->
i_y_offset
=
__MIN
(
dst
->
i_y_offset
,
(
unsigned
)(
1
+
ty
));
}
}
}
filter
->
p_sys
=
sys
;
filter
->
p_sys
=
sys
;
...
...
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