Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
bacef2b0
Commit
bacef2b0
authored
Mar 06, 2014
by
Matthias Keiser
Committed by
Rémi Denis-Courmont
Mar 12, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
transform: make filter work with chain where format change permitted
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
31180c45
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
29 deletions
+41
-29
modules/video_filter/transform.c
modules/video_filter/transform.c
+41
-29
No files found.
modules/video_filter/transform.c
View file @
bacef2b0
...
...
@@ -229,6 +229,7 @@ typedef struct {
char
name
[
16
];
convert_t
convert
;
convert_t
iconvert
;
video_transform_t
operation
;
void
(
*
plane8
)
(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane16
)(
plane_t
*
dst
,
const
plane_t
*
src
);
void
(
*
plane32
)(
plane_t
*
dst
,
const
plane_t
*
src
);
...
...
@@ -236,18 +237,18 @@ typedef struct {
void
(
*
yuyv
)(
plane_t
*
dst
,
const
plane_t
*
src
);
}
transform_description_t
;
#define DESC(str, f, invf) \
{ str, f, invf, Plane8_##f, Plane16_##f, Plane32_##f, \
#define DESC(str, f, invf
, op
) \
{ str, f, invf,
op,
Plane8_##f, Plane16_##f, Plane32_##f, \
Plane422_##f, PlaneYUY2_##f }
static
const
transform_description_t
descriptions
[]
=
{
DESC
(
"90"
,
R90
,
R270
),
DESC
(
"180"
,
R180
,
R180
),
DESC
(
"270"
,
R270
,
R90
),
DESC
(
"hflip"
,
HFlip
,
HFlip
),
DESC
(
"vflip"
,
VFlip
,
VFlip
),
DESC
(
"transpose"
,
Transpose
,
Transpose
),
DESC
(
"antitranspose"
,
AntiTranspose
,
AntiTranspose
),
DESC
(
"90"
,
R90
,
R270
,
TRANSFORM_R90
),
DESC
(
"180"
,
R180
,
R180
,
TRANSFORM_R180
),
DESC
(
"270"
,
R270
,
R90
,
TRANSFORM_R270
),
DESC
(
"hflip"
,
HFlip
,
HFlip
,
TRANSFORM_HFLIP
),
DESC
(
"vflip"
,
VFlip
,
VFlip
,
TRANSFORM_VFLIP
),
DESC
(
"transpose"
,
Transpose
,
Transpose
,
TRANSFORM_TRANSPOSE
),
DESC
(
"antitranspose"
,
AntiTranspose
,
AntiTranspose
,
TRANSFORM_ANTI_TRANSPOSE
),
};
static
bool
dsc_is_rotated
(
const
transform_description_t
*
dsc
)
...
...
@@ -373,18 +374,40 @@ static int Open(vlc_object_t *object)
}
}
}
}
/*
* Note: we neither compare nor set dst->orientation,
* the caller needs to do it manually (user might want
* to transform video without changing the orientation).
*/
video_format_t
src_trans
=
*
src
;
video_format_TransformBy
(
&
src_trans
,
dsc
->
operation
);
if
(
!
filter
->
b_allow_fmt_out_change
&&
(
dst
->
i_width
!=
src_trans
.
i_width
||
dst
->
i_visible_width
!=
src_trans
.
i_visible_width
||
dst
->
i_height
!=
src_trans
.
i_height
||
dst
->
i_visible_height
!=
src_trans
.
i_visible_height
||
dst
->
i_sar_num
!=
src_trans
.
i_sar_num
||
dst
->
i_sar_den
!=
src_trans
.
i_sar_den
||
dst
->
i_x_offset
!=
src_trans
.
i_x_offset
||
dst
->
i_y_offset
!=
src_trans
.
i_y_offset
))
{
if
(
!
filter
->
b_allow_fmt_out_change
)
{
msg_Err
(
filter
,
"Format change is not allowed"
);
goto
error
;
}
dst
->
i_width
=
src
->
i_height
;
dst
->
i_visible_width
=
src
->
i_visible_height
;
dst
->
i_height
=
src
->
i_width
;
dst
->
i_visible_height
=
src
->
i_visible_width
;
dst
->
i_sar_num
=
src
->
i_sar_den
;
dst
->
i_sar_den
=
src
->
i_sar_num
;
else
if
(
filter
->
b_allow_fmt_out_change
)
{
dst
->
i_width
=
src_trans
.
i_width
;
dst
->
i_visible_width
=
src_trans
.
i_visible_width
;
dst
->
i_height
=
src_trans
.
i_height
;
dst
->
i_visible_height
=
src_trans
.
i_visible_height
;
dst
->
i_sar_num
=
src_trans
.
i_sar_num
;
dst
->
i_sar_den
=
src_trans
.
i_sar_den
;
dst
->
i_x_offset
=
src_trans
.
i_x_offset
;
dst
->
i_y_offset
=
src_trans
.
i_y_offset
;
}
/* Deal with weird packed formats */
...
...
@@ -406,17 +429,6 @@ static int Open(vlc_object_t *object)
goto
error
;
}
dst
->
i_x_offset
=
INT_MAX
;
dst
->
i_y_offset
=
INT_MAX
;
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
int
tx
,
ty
;
dsc
->
iconvert
(
&
tx
,
&
ty
,
src
->
i_width
,
src
->
i_height
,
src
->
i_x_offset
+
i
*
(
src
->
i_visible_width
-
1
),
src
->
i_y_offset
+
i
*
(
src
->
i_visible_height
-
1
));
dst
->
i_x_offset
=
__MIN
(
dst
->
i_x_offset
,
(
unsigned
)(
1
+
tx
));
dst
->
i_y_offset
=
__MIN
(
dst
->
i_y_offset
,
(
unsigned
)(
1
+
ty
));
}
filter
->
p_sys
=
sys
;
filter
->
pf_video_filter
=
Filter
;
filter
->
pf_video_mouse
=
Mouse
;
...
...
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