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

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


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Mar 24 08:53:38 2013 +0100| [3f8072886baca4d4ffe1fd126963a2b3f41bc896] | committer: Clément Bœsch

lavfi/blackframe: use standard options parsing.

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

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

diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c
index a69ed97..11c8e50 100644
--- a/libavfilter/vf_blackframe.c
+++ b/libavfilter/vf_blackframe.c
@@ -73,14 +73,6 @@ static int query_formats(AVFilterContext *ctx)
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     BlackFrameContext *blackframe = ctx->priv;
-    static const char *shorthand[] = { "amount", "thresh", NULL };
-    int ret;
-
-    blackframe->class = &blackframe_class;
-    av_opt_set_defaults(blackframe);
-
-    if ((ret = av_opt_set_from_string(blackframe, args, shorthand, "=", ":")) < 0)
-        return ret;
 
     av_log(ctx, AV_LOG_VERBOSE, "bamount:%u bthresh:%u\n",
            blackframe->bamount, blackframe->bthresh);
@@ -88,12 +80,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
     return 0;
 }
 
-static av_cold void uninit(AVFilterContext *ctx)
-{
-    BlackFrameContext *blackframe = ctx->priv;
-    av_opt_free(blackframe);
-}
-
 static int filter_frame(AVFilterLink *inlink, AVFrame *frame)
 {
     AVFilterContext *ctx = inlink->dst;
@@ -142,13 +128,14 @@ static const AVFilterPad avfilter_vf_blackframe_outputs[] = {
     { NULL }
 };
 
+static const char *const shorthand[] = { "amount", "thresh", NULL };
+
 AVFilter avfilter_vf_blackframe = {
     .name        = "blackframe",
     .description = NULL_IF_CONFIG_SMALL("Detect frames that are (almost) black."),
 
     .priv_size = sizeof(BlackFrameContext),
     .init      = init,
-    .uninit    = uninit,
 
     .query_formats = query_formats,
 
@@ -157,4 +144,5 @@ AVFilter avfilter_vf_blackframe = {
     .outputs   = avfilter_vf_blackframe_outputs,
 
     .priv_class = &blackframe_class,
+    .shorthand  = shorthand,
 };



More information about the ffmpeg-cvslog mailing list