From 018cc6f0266a2ca5cae507491aeeb37834a144b7 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 8 Apr 2013 09:04:02 +0000 Subject: lavfi/histogram: use standard options parsing Signed-off-by: Paul B Mahol --- libavfilter/vf_histogram.c | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'libavfilter/vf_histogram.c') diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c index 37e198625c..b9cba6be1a 100644 --- a/libavfilter/vf_histogram.c +++ b/libavfilter/vf_histogram.c @@ -73,20 +73,6 @@ static const AVOption histogram_options[] = { AVFILTER_DEFINE_CLASS(histogram); -static av_cold int init(AVFilterContext *ctx, const char *args) -{ - HistogramContext *h = ctx->priv; - int ret; - - h->class = &histogram_class; - av_opt_set_defaults(h); - - if ((ret = (av_set_options_string(h, args, "=", ":"))) < 0) - return ret; - - return 0; -} - static const enum AVPixelFormat color_pix_fmts[] = { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_NONE @@ -306,13 +292,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return 0; } -static av_cold void uninit(AVFilterContext *ctx) -{ - HistogramContext *h = ctx->priv; - - av_opt_free(h); -} - static const AVFilterPad inputs[] = { { .name = "default", @@ -332,14 +311,15 @@ static const AVFilterPad outputs[] = { { NULL } }; +static const char *const shorthand[] = { NULL }; + AVFilter avfilter_vf_histogram = { .name = "histogram", .description = NULL_IF_CONFIG_SMALL("Compute and draw a histogram."), .priv_size = sizeof(HistogramContext), - .init = init, - .uninit = uninit, .query_formats = query_formats, .inputs = inputs, .outputs = outputs, .priv_class = &histogram_class, + .shorthand = shorthand, }; -- cgit v1.2.3