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
642a60f1
Commit
642a60f1
authored
Dec 08, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/setfield: add support to named options and introspection
parent
0110108a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
27 deletions
+33
-27
filters.texi
doc/filters.texi
+4
-1
version.h
libavfilter/version.h
+1
-1
vf_setfield.c
libavfilter/vf_setfield.c
+28
-25
No files found.
doc/filters.texi
View file @
642a60f1
...
...
@@ -3632,7 +3632,10 @@ output frames. It does not change the input frame, but only sets the
corresponding property, which affects how the frame is treated by
following filters (e.g. @code{fieldorder} or @code{yadif}).
It accepts a string parameter, which can assume the following values:
This filter accepts a single option @option{mode}, which can be
specified either by setting @code{mode=VALUE} either setting the
value alone. Available values are:
@table @samp
@item auto
Keep the same field property.
...
...
libavfilter/version.h
View file @
642a60f1
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 26
#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_setfield.c
View file @
642a60f1
...
...
@@ -23,6 +23,7 @@
* set field order
*/
#include "libavutil/opt.h"
#include "avfilter.h"
#include "internal.h"
#include "video.h"
...
...
@@ -35,39 +36,39 @@ enum SetFieldMode {
};
typedef
struct
{
const
AVClass
*
class
;
enum
SetFieldMode
mode
;
}
SetFieldContext
;
#define OFFSET(x) offsetof(SetFieldContext, x)
#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
static
const
AVOption
setfield_options
[]
=
{
{
"mode"
,
"select interlace mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_AUTO
},
-
1
,
MODE_PROG
,
FLAGS
,
"mode"
},
{
"auto"
,
"keep the same input field"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_AUTO
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"bff"
,
"mark as bottom-field-first"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_BFF
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"tff"
,
"mark as top-field-first"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_TFF
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"prog"
,
"mark as progressive"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_PROG
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
NULL
}
};
AVFILTER_DEFINE_CLASS
(
setfield
);
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
SetFieldContext
*
setfield
=
ctx
->
priv
;
static
const
char
*
shorthand
[]
=
{
"mode"
,
NULL
};
setfield
->
mode
=
MODE_AUTO
;
if
(
args
)
{
char
c
;
if
(
sscanf
(
args
,
"%d%c"
,
&
setfield
->
mode
,
&
c
)
!=
1
)
{
if
(
!
strcmp
(
"tff"
,
args
))
setfield
->
mode
=
MODE_TFF
;
else
if
(
!
strcmp
(
"bff"
,
args
))
setfield
->
mode
=
MODE_BFF
;
else
if
(
!
strcmp
(
"prog"
,
args
))
setfield
->
mode
=
MODE_PROG
;
else
if
(
!
strcmp
(
"auto"
,
args
))
setfield
->
mode
=
MODE_AUTO
;
else
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Invalid argument '%s'
\n
"
,
args
);
return
AVERROR
(
EINVAL
);
}
}
else
{
if
(
setfield
->
mode
<
-
1
||
setfield
->
mode
>
1
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Provided integer value %d must be included between -1 and +1
\n
"
,
setfield
->
mode
);
return
AVERROR
(
EINVAL
);
}
av_log
(
ctx
,
AV_LOG_WARNING
,
"Using -1/0/1 is deprecated, use auto/tff/bff/prog
\n
"
);
}
}
setfield
->
class
=
&
setfield_class
;
av_opt_set_defaults
(
setfield
);
return
av_opt_set_from_string
(
setfield
,
args
,
shorthand
,
"="
,
":"
);
}
return
0
;
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
{
SetFieldContext
*
setfield
=
ctx
->
priv
;
av_opt_free
(
setfield
);
}
static
int
filter_frame
(
AVFilterLink
*
inlink
,
AVFilterBufferRef
*
picref
)
...
...
@@ -105,8 +106,10 @@ AVFilter avfilter_vf_setfield = {
.
name
=
"setfield"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Force field for the output video frame."
),
.
init
=
init
,
.
uninit
=
uninit
,
.
priv_size
=
sizeof
(
SetFieldContext
),
.
inputs
=
setfield_inputs
,
.
outputs
=
setfield_outputs
,
.
priv_class
=
&
setfield_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