Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
B1ack1e
FFmpeg
提交
0c2466de
F
FFmpeg
项目概览
B1ack1e
/
FFmpeg
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FFmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0c2466de
编写于
2月 25, 2013
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vf_transpose: switch to an AVOptions-based system.
上级
ffea3b00
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
44 addition
and
28 deletion
+44
-28
doc/filters.texi
doc/filters.texi
+14
-6
libavfilter/vf_transpose.c
libavfilter/vf_transpose.c
+30
-22
未找到文件。
doc/filters.texi
浏览文件 @
0c2466de
...
...
@@ -2107,11 +2107,19 @@ will create 5 copies of the input video.
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 options:
@table @option
@item dir
The direction of the transpose.
@end table
The direction can assume the following values:
@table @samp
@item
0
@item
cclock_flip
Rotate by 90 degrees counterclockwise and vertically flip (default), that is:
@example
L.R L.l
...
...
@@ -2119,7 +2127,7 @@ L.R L.l
l.r R.r
@end example
@item
1
@item
clock
Rotate by 90 degrees clockwise, that is:
@example
L.R l.L
...
...
@@ -2127,7 +2135,7 @@ L.R l.L
l.r r.R
@end example
@item
2
@item
cclock
Rotate by 90 degrees counterclockwise, that is:
@example
L.R R.r
...
...
@@ -2135,7 +2143,7 @@ L.R R.r
l.r L.l
@end example
@item
3
@item
clock_flip
Rotate by 90 degrees clockwise and vertically flip, that is:
@example
L.R r.R
...
...
libavfilter/vf_transpose.c
浏览文件 @
0c2466de
...
...
@@ -31,38 +31,27 @@
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"
enum
TransposeDir
{
TRANSPOSE_CCLOCK_FLIP
,
TRANSPOSE_CLOCK
,
TRANSPOSE_CCLOCK
,
TRANSPOSE_CLOCK_FLIP
,
};
typedef
struct
{
const
AVClass
*
class
;
int
hsub
,
vsub
;
int
pixsteps
[
4
];
/* 0 Rotate by 90 degrees counterclockwise and vflip. */
/* 1 Rotate by 90 degrees clockwise. */
/* 2 Rotate by 90 degrees counterclockwise. */
/* 3 Rotate by 90 degrees clockwise and vflip. */
int
dir
;
enum
TransposeDir
dir
;
}
TransContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
TransContext
*
trans
=
ctx
->
priv
;
trans
->
dir
=
0
;
if
(
args
)
sscanf
(
args
,
"%d"
,
&
trans
->
dir
);
if
(
trans
->
dir
<
0
||
trans
->
dir
>
3
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid value %d not between 0 and 3.
\n
"
,
trans
->
dir
);
return
AVERROR
(
EINVAL
);
}
return
0
;
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
enum
AVPixelFormat
pix_fmts
[]
=
{
...
...
@@ -198,6 +187,25 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
return
ff_filter_frame
(
outlink
,
out
);
}
#define OFFSET(x) offsetof(TransContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"dir"
,
"Transpose direction"
,
OFFSET
(
dir
),
AV_OPT_TYPE_INT
,
{
.
i64
=
TRANSPOSE_CCLOCK_FLIP
},
TRANSPOSE_CCLOCK_FLIP
,
TRANSPOSE_CLOCK_FLIP
,
FLAGS
,
"dir"
},
{
"cclock_flip"
,
"counter-clockwise with vertical flip"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
TRANSPOSE_CCLOCK_FLIP
},
.
unit
=
"dir"
},
{
"clock"
,
"clockwise"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
TRANSPOSE_CLOCK
},
.
unit
=
"dir"
},
{
"cclock"
,
"counter-clockwise"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
TRANSPOSE_CCLOCK
},
.
unit
=
"dir"
},
{
"clock_flip"
,
"clockwise with vertical flip"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
TRANSPOSE_CLOCK_FLIP
},
.
unit
=
"dir"
},
{
NULL
},
};
static
const
AVClass
transpose_class
=
{
.
class_name
=
"transpose"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_transpose_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -220,8 +228,8 @@ AVFilter avfilter_vf_transpose = {
.
name
=
"transpose"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Transpose input video."
),
.
init
=
init
,
.
priv_size
=
sizeof
(
TransContext
),
.
priv_class
=
&
transpose_class
,
.
query_formats
=
query_formats
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录