summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-03-24 08:57:56 +0100
committerClément Bœsch <ubitux@gmail.com>2013-03-24 12:26:24 +0100
commit1341dd2dd0a72b8057203e3d5b87386930c36fa6 (patch)
tree12e36692147420b9a9d81b8457b1c998c1ae765d /libavfilter
parenta36d903601b94ff5cd24d64df3c748a1c1d89397 (diff)
lavfi/cropdetect: use standard options parsing.
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/vf_cropdetect.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c
index 3dd4de786a..7c0af7323e 100644
--- a/libavfilter/vf_cropdetect.c
+++ b/libavfilter/vf_cropdetect.c
@@ -98,28 +98,14 @@ static int checkline(void *ctx, const unsigned char *src, int stride, int len, i
static av_cold int init(AVFilterContext *ctx, const char *args)
{
CropDetectContext *cd = ctx->priv;
- static const char *shorthand[] = { "limit", "round", "reset_count", NULL };
- int ret;
cd->frame_nb = -2;
- cd->class = &cropdetect_class;
- av_opt_set_defaults(cd);
-
- if ((ret = av_opt_set_from_string(cd, args, shorthand, "=", ":")) < 0)
- return ret;
-
av_log(ctx, AV_LOG_VERBOSE, "limit:%d round:%d reset_count:%d\n",
cd->limit, cd->round, cd->reset_count);
return 0;
}
-static av_cold void uninit(AVFilterContext *ctx)
-{
- CropDetectContext *cd = ctx->priv;
- av_opt_free(cd);
-}
-
static int config_input(AVFilterLink *inlink)
{
AVFilterContext *ctx = inlink->dst;
@@ -234,15 +220,17 @@ static const AVFilterPad avfilter_vf_cropdetect_outputs[] = {
{ NULL }
};
+static const char *const shorthand[] = { "limit", "round", "reset_count", NULL };
+
AVFilter avfilter_vf_cropdetect = {
.name = "cropdetect",
.description = NULL_IF_CONFIG_SMALL("Auto-detect crop size."),
.priv_size = sizeof(CropDetectContext),
.init = init,
- .uninit = uninit,
.query_formats = query_formats,
.inputs = avfilter_vf_cropdetect_inputs,
.outputs = avfilter_vf_cropdetect_outputs,
.priv_class = &cropdetect_class,
+ .shorthand = shorthand,
};