[FFmpeg-cvslog] lavfi/histeq: use standard options parsing.

Clément Bœsch git at videolan.org
Sun Mar 24 12:33:31 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Mar 24 09:05:51 2013 +0100| [552c02f20f5ba1665279e6e631c6517b72c01891] | committer: Clément Bœsch

lavfi/histeq: use standard options parsing.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=552c02f20f5ba1665279e6e631c6517b72c01891
---

 libavfilter/vf_histeq.c |   18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

diff --git a/libavfilter/vf_histeq.c b/libavfilter/vf_histeq.c
index a9cb60e..05e1d59 100644
--- a/libavfilter/vf_histeq.c
+++ b/libavfilter/vf_histeq.c
@@ -85,14 +85,6 @@ AVFILTER_DEFINE_CLASS(histeq);
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     HisteqContext *histeq = ctx->priv;
-    const char *shorthand[] = { "strength", "intensity", "antibanding", NULL };
-    int ret;
-
-    histeq->class = &histeq_class;
-    av_opt_set_defaults(histeq);
-
-    if ((ret = av_opt_set_from_string(histeq, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     av_log(ctx, AV_LOG_VERBOSE,
            "strength:%0.3f intensity:%0.3f antibanding:%d\n",
@@ -101,12 +93,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
     return 0;
 }
 
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    HisteqContext *histeq = ctx->priv;
-    av_opt_free(histeq);
-}
-
 static int query_formats(AVFilterContext *ctx)
 {
     static const enum PixelFormat pix_fmts[] = {
@@ -283,15 +269,17 @@ static const AVFilterPad histeq_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "strength", "intensity", "antibanding", NULL };
+
 AVFilter avfilter_vf_histeq = {
     .name          = "histeq",
     .description   = NULL_IF_CONFIG_SMALL("Apply global color histogram equalization."),
     .priv_size     = sizeof(HisteqContext),
     .init          = init,
-    .uninit        = uninit,
     .query_formats = query_formats,
 
     .inputs        = histeq_inputs,
     .outputs       = histeq_outputs,
     .priv_class    = &histeq_class,
+    .shorthand     = shorthand,
 };



More information about the ffmpeg-cvslog mailing list