Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
63000627
Commit
63000627
authored
Sep 30, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/transpose: add support to named options and shortands
Allow extensibility.
parent
c785b6db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
12 deletions
+24
-12
filters.texi
doc/filters.texi
+6
-2
version.h
libavfilter/version.h
+1
-1
vf_transpose.c
libavfilter/vf_transpose.c
+17
-9
No files found.
doc/filters.texi
View file @
63000627
...
...
@@ -3519,8 +3519,11 @@ Default mode is @code{merge}.
Transpose rows with columns in the input video and optionally flip it.
It accepts a parameter representing an integer, which can assume the
values:
This filter accepts the following named parameters:
@table @option
@item dir
Specify the transposition direction. Can assume the following values:
@table @samp
@item 0, 4
...
...
@@ -3558,6 +3561,7 @@ l.r l.L
For values between 4-7 transposition is only done if the input video
geometry is portrait and not landscape.
@end table
@section unsharp
...
...
libavfilter/version.h
View file @
63000627
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 19
#define LIBAVFILTER_VERSION_MICRO 10
0
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_transpose.c
View file @
63000627
...
...
@@ -28,6 +28,7 @@
#include <stdio.h>
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
...
...
@@ -37,6 +38,7 @@
#include "video.h"
typedef
struct
{
const
AVClass
*
class
;
int
hsub
,
vsub
;
int
pixsteps
[
4
];
...
...
@@ -48,20 +50,25 @@ typedef struct {
int
passthrough
;
///< landscape passthrough mode enabled
}
TransContext
;
#define OFFSET(x) offsetof(TransContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
transpose_options
[]
=
{
{
"dir"
,
"set transpose direction"
,
OFFSET
(
dir
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
7
,
FLAGS
},
{
NULL
},
};
AVFILTER_DEFINE_CLASS
(
transpose
);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
TransContext
*
trans
=
ctx
->
priv
;
trans
->
dir
=
0
;
const
char
*
shorthand
[]
=
{
"dir"
,
NULL
}
;
if
(
args
)
sscanf
(
args
,
"%d"
,
&
trans
->
dir
);
trans
->
class
=
&
transpose_class
;
av_opt_set_defaults
(
trans
);
if
(
trans
->
dir
<
0
||
trans
->
dir
>
7
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid value %d not between 0 and 7.
\n
"
,
trans
->
dir
);
return
AVERROR
(
EINVAL
);
}
return
0
;
return
av_opt_set_from_string
(
trans
,
args
,
shorthand
,
"="
,
":"
);
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
...
...
@@ -262,4 +269,5 @@ AVFilter avfilter_vf_transpose = {
.
config_props
=
config_props_output
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
},
{
.
name
=
NULL
}},
.
priv_class
=
&
transpose_class
,
};
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