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
aeac1dae
Commit
aeac1dae
authored
Mar 10, 2013
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/fieldorder: add support to named options
parent
a3233e9d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
27 deletions
+41
-27
filters.texi
doc/filters.texi
+8
-7
version.h
libavfilter/version.h
+1
-1
vf_fieldorder.c
libavfilter/vf_fieldorder.c
+32
-19
No files found.
doc/filters.texi
View file @
aeac1dae
...
...
@@ -2986,18 +2986,19 @@ field=type=bottom
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 named option @option{order} which
specifies the required field order that the input interlaced video
will be transformed to. The option name can be omitted.
@table @option
@item 0 or bff
The option @option{order} can assume one of the following values:
@table @samp
@item bff
output bottom field first
@item
1 or
tff
@item tff
output top field first
@end table
Default value is
"tff"
.
Default value is
@samp{tff}
.
Transformation is achieved by shifting the picture content up or down
by one line, and filling the remaining line with appropriate picture content.
...
...
libavfilter/version.h
View file @
aeac1dae
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 45
#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_fieldorder.c
View file @
aeac1dae
...
...
@@ -23,6 +23,7 @@
* video field order filter, heavily influenced by vf_pad.c
*/
#include "libavutil/opt.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "libavutil/pixdesc.h"
...
...
@@ -31,34 +32,45 @@
#include "internal.h"
#include "video.h"
typedef
struct
{
enum
FieldOrder
{
ORDER_TFF
,
ORDER_BFF
,
ORDER_NB
,
};
typedef
struct
{
const
AVClass
*
class
;
enum
FieldOrder
order
;
unsigned
int
dst_tff
;
///< output bff/tff
int
line_size
[
4
];
///< bytes of pixel data per line for each plane
}
FieldOrderContext
;
#define OFFSET(x) offsetof(FieldOrderContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
fieldorder_options
[]
=
{
{
"order"
,
"set output field order"
,
OFFSET
(
order
),
AV_OPT_TYPE_INT
,
{.
i64
=
ORDER_TFF
},
0
,
ORDER_NB
-
1
,
FLAGS
,
"order"
},
{
"tff"
,
"set top field first"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
ORDER_TFF
},
.
flags
=
FLAGS
,
.
unit
=
"order"
},
{
"bff"
,
"set bottom field first"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
ORDER_BFF
},
.
flags
=
FLAGS
,
.
unit
=
"order"
},
{
NULL
}
};
AVFILTER_DEFINE_CLASS
(
fieldorder
);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
FieldOrderContext
*
fieldorder
=
ctx
->
priv
;
int
ret
;
static
const
char
*
shorthand
[]
=
{
"order"
,
NULL
};
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
);
}
fieldorder
->
class
=
&
fieldorder_class
;
av_opt_set_defaults
(
fieldorder
);
if
((
ret
=
av_opt_set_from_string
(
fieldorder
,
args
,
shorthand
,
"="
,
":"
))
<
0
)
return
ret
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"output field order: %s
\n
"
,
fieldorder
->
dst_tff
?
tff
:
b
ff
);
fieldorder
->
dst_tff
=
fieldorder
->
order
==
ORDER_TFF
;
av_log
(
ctx
,
AV_LOG_VERBOSE
,
"tff:%d
\n
"
,
fieldorder
->
dst_t
ff
);
return
0
;
}
...
...
@@ -200,4 +212,5 @@ AVFilter avfilter_vf_fieldorder = {
.
query_formats
=
query_formats
,
.
inputs
=
avfilter_vf_fieldorder_inputs
,
.
outputs
=
avfilter_vf_fieldorder_outputs
,
.
priv_class
=
&
fieldorder_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