Browse code

lavfi/vf_stereo3d: use standard options parsing

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Paul B Mahol authored on 2013/03/21 18:17:32
Showing 1 changed files
... ...
@@ -178,21 +178,6 @@ static const AVOption stereo3d_options[] = {
178 178
 
179 179
 AVFILTER_DEFINE_CLASS(stereo3d);
180 180
 
181
-static av_cold int init(AVFilterContext *ctx, const char *args)
182
-{
183
-    Stereo3DContext *s = ctx->priv;
184
-    static const char *shorthand[] = { "in", "out", NULL };
185
-    int ret;
186
-
187
-    s->class = &stereo3d_class;
188
-    av_opt_set_defaults(s);
189
-
190
-    if ((ret = av_opt_set_from_string(s, args, shorthand, "=", ":")) < 0)
191
-        return ret;
192
-
193
-    return 0;
194
-}
195
-
196 181
 static int query_formats(AVFilterContext *ctx)
197 182
 {
198 183
     static const enum AVPixelFormat pix_fmts[] = {
... ...
@@ -436,13 +421,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *inpicref)
436 436
     return 0;
437 437
 }
438 438
 
439
-static av_cold void uninit(AVFilterContext *ctx)
440
-{
441
-    Stereo3DContext *s = ctx->priv;
442
-
443
-    av_opt_free(s);
444
-}
445
-
446 439
 static const AVFilterPad stereo3d_inputs[] = {
447 440
     {
448 441
         .name             = "default",
... ...
@@ -462,14 +440,15 @@ static const AVFilterPad stereo3d_outputs[] = {
462 462
     { NULL }
463 463
 };
464 464
 
465
+static const char *const shorthand[] = { "in", "out", NULL };
466
+
465 467
 AVFilter avfilter_vf_stereo3d = {
466 468
     .name          = "stereo3d",
467 469
     .description   = NULL_IF_CONFIG_SMALL("Convert video stereoscopic 3D view."),
468 470
     .priv_size     = sizeof(Stereo3DContext),
469
-    .init          = init,
470
-    .uninit        = uninit,
471 471
     .query_formats = query_formats,
472 472
     .inputs        = stereo3d_inputs,
473 473
     .outputs       = stereo3d_outputs,
474 474
     .priv_class    = &stereo3d_class,
475
+    .shorthand     = shorthand,
475 476
 };