Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
c053f486
Commit
c053f486
authored
Sep 30, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/transpose: add passthrough option
parent
63000627
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
12 deletions
+45
-12
filters.texi
doc/filters.texi
+17
-2
version.h
libavfilter/version.h
+1
-1
vf_transpose.c
libavfilter/vf_transpose.c
+27
-9
No files found.
doc/filters.texi
View file @
c053f486
...
@@ -3559,8 +3559,23 @@ l.r l.L
...
@@ -3559,8 +3559,23 @@ l.r l.L
@end example
@end example
@end table
@end table
For values between 4-7 transposition is only done if the input video
For values between 4-7, the transposition is only done if the input
geometry is portrait and not landscape.
video geometry is portrait and not landscape. These values are
deprecated, the @code{passthrough} option should be used instead.
@item passthrough
Do not apply the transposition if the input geometry matches the one
specified by the specified value. It accepts the following values:
@table @samp
@item none
Always apply transposition.
@item portrait
Preserve portrait geometry (when @var{height} >= @var{width}).
@item landscape
Preserve landscape geometry (when @var{width} >= @var{height}).
@end table
Default value is @code{none}.
@end table
@end table
@section unsharp
@section unsharp
...
...
libavfilter/version.h
View file @
c053f486
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 19
#define LIBAVFILTER_VERSION_MINOR 19
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_transpose.c
View file @
c053f486
...
@@ -37,6 +37,12 @@
...
@@ -37,6 +37,12 @@
#include "internal.h"
#include "internal.h"
#include "video.h"
#include "video.h"
typedef
enum
{
TRANSPOSE_PT_TYPE_NONE
,
TRANSPOSE_PT_TYPE_LANDSCAPE
,
TRANSPOSE_PT_TYPE_PORTRAIT
,
}
PassthroughType
;
typedef
struct
{
typedef
struct
{
const
AVClass
*
class
;
const
AVClass
*
class
;
int
hsub
,
vsub
;
int
hsub
,
vsub
;
...
@@ -47,7 +53,7 @@ typedef struct {
...
@@ -47,7 +53,7 @@ typedef struct {
/* 2 Rotate by 90 degrees counterclockwise. */
/* 2 Rotate by 90 degrees counterclockwise. */
/* 3 Rotate by 90 degrees clockwise and vflip. */
/* 3 Rotate by 90 degrees clockwise and vflip. */
int
dir
;
int
dir
;
int
passthrough
;
///< landscape passthrough mode enabled
PassthroughType
passthrough
;
///< landscape passthrough mode enabled
}
TransContext
;
}
TransContext
;
#define OFFSET(x) offsetof(TransContext, x)
#define OFFSET(x) offsetof(TransContext, x)
...
@@ -55,6 +61,13 @@ typedef struct {
...
@@ -55,6 +61,13 @@ typedef struct {
static
const
AVOption
transpose_options
[]
=
{
static
const
AVOption
transpose_options
[]
=
{
{
"dir"
,
"set transpose direction"
,
OFFSET
(
dir
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
7
,
FLAGS
},
{
"dir"
,
"set transpose direction"
,
OFFSET
(
dir
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
7
,
FLAGS
},
{
"passthrough"
,
"do not apply transposition if the input matches the specified geometry"
,
OFFSET
(
passthrough
),
AV_OPT_TYPE_INT
,
{.
i64
=
TRANSPOSE_PT_TYPE_NONE
},
0
,
INT_MAX
,
FLAGS
,
"passthrough"
},
{
"none"
,
"always apply transposition"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TRANSPOSE_PT_TYPE_NONE
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"passthrough"
},
{
"portrait"
,
"preserve portrait geometry"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TRANSPOSE_PT_TYPE_PORTRAIT
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"passthrough"
},
{
"landscape"
,
"preserve landscape geometry"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
TRANSPOSE_PT_TYPE_LANDSCAPE
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"passthrough"
},
{
NULL
},
{
NULL
},
};
};
...
@@ -63,7 +76,7 @@ AVFILTER_DEFINE_CLASS(transpose);
...
@@ -63,7 +76,7 @@ AVFILTER_DEFINE_CLASS(transpose);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
{
TransContext
*
trans
=
ctx
->
priv
;
TransContext
*
trans
=
ctx
->
priv
;
const
char
*
shorthand
[]
=
{
"dir"
,
NULL
};
const
char
*
shorthand
[]
=
{
"dir"
,
"passthrough"
,
NULL
};
trans
->
class
=
&
transpose_class
;
trans
->
class
=
&
transpose_class
;
av_opt_set_defaults
(
trans
);
av_opt_set_defaults
(
trans
);
...
@@ -106,15 +119,20 @@ static int config_props_output(AVFilterLink *outlink)
...
@@ -106,15 +119,20 @@ static int config_props_output(AVFilterLink *outlink)
const
AVPixFmtDescriptor
*
pixdesc
=
&
av_pix_fmt_descriptors
[
outlink
->
format
];
const
AVPixFmtDescriptor
*
pixdesc
=
&
av_pix_fmt_descriptors
[
outlink
->
format
];
if
(
trans
->
dir
&
4
)
{
if
(
trans
->
dir
&
4
)
{
av_log
(
ctx
,
AV_LOG_WARNING
,
"dir values greater than 3 are deprecated, use the passthrough option instead
\n
"
);
trans
->
dir
&=
3
;
trans
->
dir
&=
3
;
if
(
inlink
->
w
>=
inlink
->
h
)
{
trans
->
passthrough
=
TRANSPOSE_PT_TYPE_LANDSCAPE
;
trans
->
passthrough
=
1
;
}
av_log
(
ctx
,
AV_LOG_VERBOSE
,
if
((
inlink
->
w
>=
inlink
->
h
&&
trans
->
passthrough
==
TRANSPOSE_PT_TYPE_LANDSCAPE
)
||
"w:%d h:%d -> w:%d h:%d (landscape passthrough mode)
\n
"
,
(
inlink
->
w
<=
inlink
->
h
&&
trans
->
passthrough
==
TRANSPOSE_PT_TYPE_PORTRAIT
))
{
inlink
->
w
,
inlink
->
h
,
outlink
->
w
,
outlink
->
h
);
av_log
(
ctx
,
AV_LOG_VERBOSE
,
return
0
;
"w:%d h:%d -> w:%d h:%d (passthrough mode)
\n
"
,
}
inlink
->
w
,
inlink
->
h
,
inlink
->
w
,
inlink
->
h
);
return
0
;
}
else
{
trans
->
passthrough
=
TRANSPOSE_PT_TYPE_NONE
;
}
}
trans
->
hsub
=
av_pix_fmt_descriptors
[
inlink
->
format
].
log2_chroma_w
;
trans
->
hsub
=
av_pix_fmt_descriptors
[
inlink
->
format
].
log2_chroma_w
;
...
...
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