You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-11-23 21:54:53 +02:00
lavfi/setfield: use standard options parsing.
This commit is contained in:
@@ -54,23 +54,6 @@ static const AVOption setfield_options[] = {
|
|||||||
|
|
||||||
AVFILTER_DEFINE_CLASS(setfield);
|
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->class = &setfield_class;
|
|
||||||
av_opt_set_defaults(setfield);
|
|
||||||
|
|
||||||
return av_opt_set_from_string(setfield, args, shorthand, "=", ":");
|
|
||||||
}
|
|
||||||
|
|
||||||
static av_cold void uninit(AVFilterContext *ctx)
|
|
||||||
{
|
|
||||||
SetFieldContext *setfield = ctx->priv;
|
|
||||||
av_opt_free(setfield);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
|
static int filter_frame(AVFilterLink *inlink, AVFrame *picref)
|
||||||
{
|
{
|
||||||
SetFieldContext *setfield = inlink->dst->priv;
|
SetFieldContext *setfield = inlink->dst->priv;
|
||||||
@@ -102,14 +85,14 @@ 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."),
|
||||||
.init = init,
|
|
||||||
.uninit = uninit,
|
|
||||||
|
|
||||||
.priv_size = sizeof(SetFieldContext),
|
.priv_size = sizeof(SetFieldContext),
|
||||||
.inputs = setfield_inputs,
|
.inputs = setfield_inputs,
|
||||||
.outputs = setfield_outputs,
|
.outputs = setfield_outputs,
|
||||||
.priv_class = &setfield_class,
|
.priv_class = &setfield_class,
|
||||||
|
.shorthand = shorthand,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user