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
a39c1540
Commit
a39c1540
authored
Feb 25, 2013
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vf_fieldorder: switch to an AVOptions-based system.
parent
b9dfee9f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
36 deletions
+26
-36
filters.texi
doc/filters.texi
+6
-8
vf_fieldorder.c
libavfilter/vf_fieldorder.c
+20
-28
No files found.
doc/filters.texi
View file @
a39c1540
...
...
@@ -1037,15 +1037,13 @@ fade=type=in:start_frame=5:nb_frames=20
Transform the field order of the input video.
It accepts one parameter which specifies the required field order that
the input interlaced video will be transformed to. The parameter can
assume one of the following values:
This filter accepts the following options:
@table @option
@item 0 or bff
output bottom field first
@item 1 or tff
output top field first
@item order
Output field order. Valid values are @var{tff} for top field first or @var{bff}
for bottom field first.
@end table
Default value is "tff".
...
...
@@ -1063,7 +1061,7 @@ which is bottom field first.
For example:
@example
./avconv -i in.vob -vf "fieldorder=bff" out.dv
./avconv -i in.vob -vf "fieldorder=
order=
bff" out.dv
@end example
@section fifo
...
...
libavfilter/vf_fieldorder.c
View file @
a39c1540
...
...
@@ -30,6 +30,7 @@
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avfilter.h"
#include "formats.h"
...
...
@@ -38,36 +39,11 @@
typedef
struct
{
unsigned
int
dst_tff
;
///< output bff/tff
const
AVClass
*
class
;
int
dst_tff
;
///< output bff/tff
int
line_size
[
4
];
///< bytes of pixel data per line for each plane
}
FieldOrderContext
;
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
FieldOrderContext
*
fieldorder
=
ctx
->
priv
;
const
char
*
tff
=
"tff"
;
const
char
*
bff
=
"bff"
;
if
(
!
args
)
{
fieldorder
->
dst_tff
=
1
;
}
else
if
(
sscanf
(
args
,
"%u"
,
&
fieldorder
->
dst_tff
)
==
1
)
{
fieldorder
->
dst_tff
=
!!
fieldorder
->
dst_tff
;
}
else
if
(
!
strcmp
(
tff
,
args
))
{
fieldorder
->
dst_tff
=
1
;
}
else
if
(
!
strcmp
(
bff
,
args
))
{
fieldorder
->
dst_tff
=
0
;
}
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid argument '%s'.
\n
"
,
args
);
return
AVERROR
(
EINVAL
);
}
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"output field order: %s
\n
"
,
fieldorder
->
dst_tff
?
tff
:
bff
);
return
0
;
}
static
int
query_formats
(
AVFilterContext
*
ctx
)
{
AVFilterFormats
*
formats
;
...
...
@@ -177,6 +153,22 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return
ff_filter_frame
(
outlink
,
frame
);
}
#define OFFSET(x) offsetof(FieldOrderContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
options
[]
=
{
{
"order"
,
"output field order"
,
OFFSET
(
dst_tff
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
1
,
FLAGS
,
"order"
},
{
"bff"
,
"bottom field first"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
0
},
.
unit
=
"order"
},
{
"tff"
,
"top field first"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
.
unit
=
"order"
},
{
NULL
},
};
static
const
AVClass
fieldorder_class
=
{
.
class_name
=
"fieldorder"
,
.
item_name
=
av_default_item_name
,
.
option
=
options
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
static
const
AVFilterPad
avfilter_vf_fieldorder_inputs
[]
=
{
{
.
name
=
"default"
,
...
...
@@ -200,8 +192,8 @@ static const AVFilterPad avfilter_vf_fieldorder_outputs[] = {
AVFilter
avfilter_vf_fieldorder
=
{
.
name
=
"fieldorder"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Set the field order."
),
.
init
=
init
,
.
priv_size
=
sizeof
(
FieldOrderContext
),
.
priv_class
=
&
fieldorder_class
,
.
query_formats
=
query_formats
,
.
inputs
=
avfilter_vf_fieldorder_inputs
,
.
outputs
=
avfilter_vf_fieldorder_outputs
,
...
...
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