Merge remote-tracking branch 'ubitux/shorthand-cleanup'

* ubitux/shorthand-cleanup:
  lavfi/setfield: switch to an AVOptions-based system.
  lavfi/asettb: switch to an AVOptions-based system.
  lavfi/aselect: switch to an AVOptions-based system.
  lavfi/sine: switch to an AVOptions-based system.
  lavfi/deshake: switch to an AVOptions-based system.
  lavfi/tinterlace: switch to an AVOptions-based system.
  lavfi/tile: switch to an AVOptions-based system.
  lavfi/concat: switch to an AVOptions-based system.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/21/head
Michael Niedermayer 12 years ago
commit a87e85fa72
  1. 72
      doc/filters.texi
  2. 3
      libavfilter/asrc_sine.c
  3. 3
      libavfilter/avf_concat.c
  4. 8
      libavfilter/avfilter.c
  5. 3
      libavfilter/f_select.c
  6. 7
      libavfilter/f_settb.c
  7. 7
      libavfilter/vf_deshake.c
  8. 3
      libavfilter/vf_setfield.c
  9. 8
      libavfilter/vf_tile.c
  10. 3
      libavfilter/vf_tinterlace.c

@ -1688,11 +1688,7 @@ Generate an audio signal made of a sine wave with amplitude 1/8.
The audio signal is bit-exact. The audio signal is bit-exact.
It accepts a list of options in the form of @var{key}=@var{value} pairs The filter accepts the following options:
separated by ":". If the option name is omitted, the first option is the
frequency and the second option is the beep factor.
The supported options are:
@table @option @table @option
@ -2529,16 +2525,14 @@ Attempt to fix small changes in horizontal and/or vertical shift. This
filter helps remove camera shake from hand-holding a camera, bumping a filter helps remove camera shake from hand-holding a camera, bumping a
tripod, moving on a vehicle, etc. tripod, moving on a vehicle, etc.
The filter accepts parameters as a list of @var{key}=@var{value} The filter accepts the following options:
pairs, separated by ":". If the key of the first options is omitted,
the arguments are interpreted according to the syntax
@var{x}:@var{y}:@var{w}:@var{h}:@var{rx}:@var{ry}:@var{edge}:@var{blocksize}:@var{contrast}:@var{search}:@var{filename}:@var{opencl}.
A description of the accepted parameters follows.
@table @option @table @option
@item x, y, w, h @item x
@item y
@item w
@item h
Specify a rectangular area where to limit the search for motion Specify a rectangular area where to limit the search for motion
vectors. vectors.
If desired the search for motion vectors can be limited to a If desired the search for motion vectors can be limited to a
@ -2556,7 +2550,8 @@ without specifying the bounding box for the motion vector search.
Default - search the whole frame. Default - search the whole frame.
@item rx, ry @item rx
@item ry
Specify the maximum extent of movement in x and y directions in the Specify the maximum extent of movement in x and y directions in the
range 0-64 pixels. Default 16. range 0-64 pixels. Default 16.
@ -5062,9 +5057,12 @@ output frames. It does not change the input frame, but only sets the
corresponding property, which affects how the frame is treated by corresponding property, which affects how the frame is treated by
following filters (e.g. @code{fieldorder} or @code{yadif}). following filters (e.g. @code{fieldorder} or @code{yadif}).
This filter accepts a single option @option{mode}, which can be The filter accepts the following options:
specified either by setting @code{mode=VALUE} or setting the value
alone. Available values are: @table @option
@item mode
Available values are:
@table @samp @table @samp
@item auto @item auto
@ -5079,6 +5077,7 @@ Mark the frame as top-field-first.
@item prog @item prog
Mark the frame as progressive. Mark the frame as progressive.
@end table @end table
@end table
@section showinfo @section showinfo
@ -5414,8 +5413,7 @@ ffmpeg -i in.avi -vf thumbnail,scale=300:200 -frames:v 1 out.png
Tile several successive frames together. Tile several successive frames together.
It accepts a list of options in the form of @var{key}=@var{value} pairs The filter accepts the following options:
separated by ":". A description of the accepted options follows.
@table @option @table @option
@ -5423,6 +5421,11 @@ separated by ":". A description of the accepted options follows.
Set the grid size (i.e. the number of lines and columns) in the form Set the grid size (i.e. the number of lines and columns) in the form
"@var{w}x@var{h}". "@var{w}x@var{h}".
@item nb_frames
Set the maximum number of frames to render in the given area. It must be less
than or equal to @var{w}x@var{h}. The default value is @code{0}, meaning all
the area will be used.
@item margin @item margin
Set the outer border margin in pixels. Set the outer border margin in pixels.
@ -5431,19 +5434,13 @@ Set the inner border thickness (i.e. the number of pixels between frames). For
more advanced padding options (such as having different values for the edges), more advanced padding options (such as having different values for the edges),
refer to the pad video filter. refer to the pad video filter.
@item nb_frames
Set the maximum number of frames to render in the given area. It must be less
than or equal to @var{w}x@var{h}. The default value is @code{0}, meaning all
the area will be used.
@end table @end table
Alternatively, the options can be specified as a flat string: @subsection Examples
@var{layout}[:@var{nb_frames}[:@var{margin}[:@var{padding}]]]
For example, produce 8x8 PNG tiles of all keyframes (@option{-skip_frame @itemize
nokey}) in a movie: @item
Produce 8x8 PNG tiles of all keyframes (@option{-skip_frame nokey}) in a movie:
@example @example
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
@end example @end example
@ -5451,12 +5448,14 @@ The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
duplicating each output frame to accomodate the originally detected frame duplicating each output frame to accomodate the originally detected frame
rate. rate.
Another example to display @code{5} pictures in an area of @code{3x2} frames, @item
Display @code{5} pictures in an area of @code{3x2} frames,
with @code{7} pixels between them, and @code{2} pixels of initial margin, using with @code{7} pixels between them, and @code{2} pixels of initial margin, using
mixed flat and named options: mixed flat and named options:
@example @example
tile=3x2:nb_frames=5:padding=7:margin=2 tile=3x2:nb_frames=5:padding=7:margin=2
@end example @end example
@end itemize
@section tinterlace @section tinterlace
@ -5465,13 +5464,7 @@ Perform various types of temporal field interlacing.
Frames are counted starting from 1, so the first input frame is Frames are counted starting from 1, so the first input frame is
considered odd. considered odd.
This filter accepts options in the form of @var{key}=@var{value} pairs The filter accepts the following options:
separated by ":".
Alternatively, the @var{mode} option can be specified as a value alone,
optionally followed by a ":" and further ":" separated @var{key}=@var{value}
pairs.
A description of the accepted options follows.
@table @option @table @option
@ -6387,7 +6380,7 @@ This filter accepts the following options:
@table @option @table @option
@item expr @item expr, e
An expression, which is evaluated for each input frame. If the expression is An expression, which is evaluated for each input frame. If the expression is
evaluated to a non-zero value, the frame is selected and passed to the output, evaluated to a non-zero value, the frame is selected and passed to the output,
otherwise it is discarded. otherwise it is discarded.
@ -6884,7 +6877,7 @@ This filter accepts the following options:
@table @option @table @option
@item expr @item expr, tb
The expression which is evaluated into the output timebase. The expression which is evaluated into the output timebase.
@end table @end table
@ -6937,7 +6930,8 @@ The filter works on segments of synchronized video and audio streams. All
segments must have the same number of streams of each type, and that will segments must have the same number of streams of each type, and that will
also be the number of streams at output. also be the number of streams at output.
The filter accepts the following named parameters: The filter accepts the following options:
@table @option @table @option
@item n @item n

@ -210,8 +210,6 @@ static const AVFilterPad sine_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { "frequency", "beep_factor", NULL };
AVFilter avfilter_asrc_sine = { AVFilter avfilter_asrc_sine = {
.name = "sine", .name = "sine",
.description = NULL_IF_CONFIG_SMALL("Generate sine wave audio signal."), .description = NULL_IF_CONFIG_SMALL("Generate sine wave audio signal."),
@ -222,5 +220,4 @@ AVFilter avfilter_asrc_sine = {
.inputs = NULL, .inputs = NULL,
.outputs = sine_outputs, .outputs = sine_outputs,
.priv_class = &sine_class, .priv_class = &sine_class,
.shorthand = shorthand,
}; };

@ -409,8 +409,6 @@ static av_cold void uninit(AVFilterContext *ctx)
av_free(cat->in); av_free(cat->in);
} }
static const char *const shorthand[] = { NULL };
AVFilter avfilter_avf_concat = { AVFilter avfilter_avf_concat = {
.name = "concat", .name = "concat",
.description = NULL_IF_CONFIG_SMALL("Concatenate audio and video streams."), .description = NULL_IF_CONFIG_SMALL("Concatenate audio and video streams."),
@ -421,5 +419,4 @@ AVFilter avfilter_avf_concat = {
.inputs = NULL, .inputs = NULL,
.outputs = NULL, .outputs = NULL,
.priv_class = &concat_class, .priv_class = &concat_class,
.shorthand = shorthand,
}; };

@ -697,11 +697,13 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
!strcmp(filter->filter->name, "channelsplit") || !strcmp(filter->filter->name, "channelsplit") ||
!strcmp(filter->filter->name, "color" ) || !strcmp(filter->filter->name, "color" ) ||
!strcmp(filter->filter->name, "colormatrix") || !strcmp(filter->filter->name, "colormatrix") ||
!strcmp(filter->filter->name, "concat" ) ||
!strcmp(filter->filter->name, "crop" ) || !strcmp(filter->filter->name, "crop" ) ||
!strcmp(filter->filter->name, "cropdetect") || !strcmp(filter->filter->name, "cropdetect") ||
!strcmp(filter->filter->name, "curves" ) || !strcmp(filter->filter->name, "curves" ) ||
!strcmp(filter->filter->name, "decimate" ) || !strcmp(filter->filter->name, "decimate" ) ||
!strcmp(filter->filter->name, "delogo" ) || !strcmp(filter->filter->name, "delogo" ) ||
!strcmp(filter->filter->name, "deshake" ) ||
!strcmp(filter->filter->name, "drawbox" ) || !strcmp(filter->filter->name, "drawbox" ) ||
!strcmp(filter->filter->name, "drawtext" ) || !strcmp(filter->filter->name, "drawtext" ) ||
!strcmp(filter->filter->name, "ebur128" ) || !strcmp(filter->filter->name, "ebur128" ) ||
@ -748,19 +750,25 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
!strcmp(filter->filter->name, "rgbtestsrc") || !strcmp(filter->filter->name, "rgbtestsrc") ||
!strcmp(filter->filter->name, "setpts" ) || !strcmp(filter->filter->name, "setpts" ) ||
!strcmp(filter->filter->name, "settb" ) || !strcmp(filter->filter->name, "settb" ) ||
!strcmp(filter->filter->name, "asettb" ) ||
!strcmp(filter->filter->name, "setfield") ||
!strcmp(filter->filter->name, "showspectrum") || !strcmp(filter->filter->name, "showspectrum") ||
!strcmp(filter->filter->name, "silencedetect") || !strcmp(filter->filter->name, "silencedetect") ||
!strcmp(filter->filter->name, "sine" ) ||
!strcmp(filter->filter->name, "smartblur") || !strcmp(filter->filter->name, "smartblur") ||
!strcmp(filter->filter->name, "split" ) || !strcmp(filter->filter->name, "split" ) ||
!strcmp(filter->filter->name, "stereo3d" ) || !strcmp(filter->filter->name, "stereo3d" ) ||
!strcmp(filter->filter->name, "subtitles") || !strcmp(filter->filter->name, "subtitles") ||
!strcmp(filter->filter->name, "testsrc" ) || !strcmp(filter->filter->name, "testsrc" ) ||
!strcmp(filter->filter->name, "thumbnail") || !strcmp(filter->filter->name, "thumbnail") ||
!strcmp(filter->filter->name, "tile") ||
!strcmp(filter->filter->name, "tinterlace") ||
!strcmp(filter->filter->name, "transpose") || !strcmp(filter->filter->name, "transpose") ||
!strcmp(filter->filter->name, "treble" ) || !strcmp(filter->filter->name, "treble" ) ||
!strcmp(filter->filter->name, "unsharp" ) || !strcmp(filter->filter->name, "unsharp" ) ||
// !strcmp(filter->filter->name, "scale" ) || // !strcmp(filter->filter->name, "scale" ) ||
!strcmp(filter->filter->name, "select") || !strcmp(filter->filter->name, "select") ||
!strcmp(filter->filter->name, "aselect" ) ||
!strcmp(filter->filter->name, "volume" ) || !strcmp(filter->filter->name, "volume" ) ||
!strcmp(filter->filter->name, "yadif" ) || !strcmp(filter->filter->name, "yadif" ) ||
0 0

@ -388,8 +388,6 @@ static int query_formats(AVFilterContext *ctx)
return 0; return 0;
} }
static const char *const shorthand[] = { "expr", NULL };
#if CONFIG_ASELECT_FILTER #if CONFIG_ASELECT_FILTER
#define OFFSET(x) offsetof(SelectContext, x) #define OFFSET(x) offsetof(SelectContext, x)
@ -445,7 +443,6 @@ AVFilter avfilter_af_aselect = {
.inputs = avfilter_af_aselect_inputs, .inputs = avfilter_af_aselect_inputs,
.outputs = avfilter_af_aselect_outputs, .outputs = avfilter_af_aselect_outputs,
.priv_class = &aselect_class, .priv_class = &aselect_class,
.shorthand = shorthand,
}; };
#endif /* CONFIG_ASELECT_FILTER */ #endif /* CONFIG_ASELECT_FILTER */

@ -60,7 +60,9 @@ typedef struct {
#define OFFSET(x) offsetof(SetTBContext, x) #define OFFSET(x) offsetof(SetTBContext, x)
#define DEFINE_OPTIONS(filt_name, filt_type) \ #define DEFINE_OPTIONS(filt_name, filt_type) \
static const AVOption filt_name##_options[] = { \ static const AVOption filt_name##_options[] = { \
{ "tb", "Expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \ { "expr", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
.flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
{ "tb", "set expression determining the output timebase", OFFSET(tb_expr), AV_OPT_TYPE_STRING, {.str="intb"}, \
.flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \ .flags=AV_OPT_FLAG_##filt_type##_PARAM|AV_OPT_FLAG_FILTERING_PARAM }, \
{ NULL } \ { NULL } \
} }
@ -118,8 +120,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
return ff_filter_frame(outlink, frame); return ff_filter_frame(outlink, frame);
} }
static const char *const shorthand[] = { "tb", NULL };
#if CONFIG_SETTB_FILTER #if CONFIG_SETTB_FILTER
DEFINE_OPTIONS(settb, VIDEO); DEFINE_OPTIONS(settb, VIDEO);
@ -188,6 +188,5 @@ AVFilter avfilter_af_asettb = {
.inputs = avfilter_af_asettb_inputs, .inputs = avfilter_af_asettb_inputs,
.outputs = avfilter_af_asettb_outputs, .outputs = avfilter_af_asettb_outputs,
.priv_class = &asettb_class, .priv_class = &asettb_class,
.shorthand = shorthand,
}; };
#endif #endif

@ -560,12 +560,6 @@ static const AVFilterPad deshake_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = {
"x", "y", "w", "h", "rx", "ry", "edge",
"blocksize", "contrast", "search", "filename",
NULL
};
AVFilter avfilter_vf_deshake = { AVFilter avfilter_vf_deshake = {
.name = "deshake", .name = "deshake",
.description = NULL_IF_CONFIG_SMALL("Stabilize shaky video."), .description = NULL_IF_CONFIG_SMALL("Stabilize shaky video."),
@ -576,5 +570,4 @@ AVFilter avfilter_vf_deshake = {
.inputs = deshake_inputs, .inputs = deshake_inputs,
.outputs = deshake_outputs, .outputs = deshake_outputs,
.priv_class = &deshake_class, .priv_class = &deshake_class,
.shorthand = shorthand,
}; };

@ -85,8 +85,6 @@ static const AVFilterPad setfield_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { "mode", NULL };
AVFilter avfilter_vf_setfield = { AVFilter avfilter_vf_setfield = {
.name = "setfield", .name = "setfield",
.description = NULL_IF_CONFIG_SMALL("Force field for the output video frame."), .description = NULL_IF_CONFIG_SMALL("Force field for the output video frame."),
@ -94,5 +92,4 @@ AVFilter avfilter_vf_setfield = {
.inputs = setfield_inputs, .inputs = setfield_inputs,
.outputs = setfield_outputs, .outputs = setfield_outputs,
.priv_class = &setfield_class, .priv_class = &setfield_class,
.shorthand = shorthand,
}; };

@ -51,12 +51,12 @@ typedef struct {
static const AVOption tile_options[] = { static const AVOption tile_options[] = {
{ "layout", "set grid size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, { "layout", "set grid size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE,
{.str = "6x5"}, 0, 0, FLAGS }, {.str = "6x5"}, 0, 0, FLAGS },
{ "nb_frames", "set maximum number of frame to render", OFFSET(nb_frames),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{ "margin", "set outer border margin in pixels", OFFSET(margin), { "margin", "set outer border margin in pixels", OFFSET(margin),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1024, FLAGS }, AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1024, FLAGS },
{ "padding", "set inner border thickness in pixels", OFFSET(padding), { "padding", "set inner border thickness in pixels", OFFSET(padding),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1024, FLAGS }, AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1024, FLAGS },
{ "nb_frames", "set maximum number of frame to render", OFFSET(nb_frames),
AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS },
{NULL}, {NULL},
}; };
@ -230,9 +230,6 @@ static const AVFilterPad tile_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] =
{ "layout", "nb_frames", "margin", "padding", NULL };
AVFilter avfilter_vf_tile = { AVFilter avfilter_vf_tile = {
.name = "tile", .name = "tile",
.description = NULL_IF_CONFIG_SMALL("Tile several successive frames together."), .description = NULL_IF_CONFIG_SMALL("Tile several successive frames together."),
@ -242,5 +239,4 @@ AVFilter avfilter_vf_tile = {
.inputs = tile_inputs, .inputs = tile_inputs,
.outputs = tile_outputs, .outputs = tile_outputs,
.priv_class = &tile_class, .priv_class = &tile_class,
.shorthand = shorthand,
}; };

@ -385,8 +385,6 @@ static const AVFilterPad tinterlace_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { "mode", NULL };
AVFilter avfilter_vf_tinterlace = { AVFilter avfilter_vf_tinterlace = {
.name = "tinterlace", .name = "tinterlace",
.description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."), .description = NULL_IF_CONFIG_SMALL("Perform temporal field interlacing."),
@ -396,5 +394,4 @@ AVFilter avfilter_vf_tinterlace = {
.inputs = tinterlace_inputs, .inputs = tinterlace_inputs,
.outputs = tinterlace_outputs, .outputs = tinterlace_outputs,
.priv_class = &tinterlace_class, .priv_class = &tinterlace_class,
.shorthand = shorthand,
}; };

Loading…
Cancel
Save