Showing the changes to libavfilter (1 of 2 files). Show all
Unified · Split
| @@ -61,18 +61,18 @@ typedef struct DatascopeContext { · 60 unmodified lines | ||
| 61 | 61 | static const AVOption datascope_options[] = { |
| 62 | 62 | { "size", "set output size", OFFSET(ow), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS }, |
| 63 | 63 | { "s", "set output size", OFFSET(ow), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, FLAGS }, |
| 64 | − { "x", "set x offset", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS }, | |
| 65 | − { "y", "set y offset", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGS }, | |
| 66 | − { "mode", "set scope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGS, "mode" }, | |
| 67 | − { "mono", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "mode" }, | |
| 68 | − { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "mode" }, | |
| 69 | − { "color2", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "mode" }, | |
| 70 | − { "axis", "draw column/row numbers", OFFSET(axis), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS }, | |
| 71 | − { "opacity", "set background opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, FLAGS }, | |
| 72 | − { "format", "set display number format", OFFSET(dformat), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGS, "format" }, | |
| 73 | − { "hex", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "format" }, | |
| 74 | − { "dec", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "format" }, | |
| 75 | − { "components", "set components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=15}, 1, 15, FLAGS }, | |
| 64 | + { "x", "set x offset", OFFSET(x), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGSR }, | |
| 65 | + { "y", "set y offset", OFFSET(y), AV_OPT_TYPE_INT, {.i64=0}, 0, INT_MAX, FLAGSR }, | |
| 66 | + { "mode", "set scope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, 2, FLAGSR, "mode" }, | |
| 67 | + { "mono", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGSR, "mode" }, | |
| 68 | + { "color", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGSR, "mode" }, | |
| 69 | + { "color2", NULL, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGSR, "mode" }, | |
| 70 | + { "axis", "draw column/row numbers", OFFSET(axis), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGSR }, | |
| 71 | + { "opacity", "set background opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=0.75}, 0, 1, FLAGSR }, | |
| 72 | + { "format", "set display number format", OFFSET(dformat), AV_OPT_TYPE_INT, {.i64=0}, 0, 1, FLAGSR, "format" }, | |
| 73 | + { "hex", NULL, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGSR, "format" }, | |
| 74 | + { "dec", NULL, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGSR, "format" }, | |
| 75 | + { "components", "set components to display", OFFSET(components), AV_OPT_TYPE_INT, {.i64=15}, 1, 15, FLAGSR }, | |
| 76 | 76 | { NULL } |
| 77 | 77 | }; |
| 78 | 78 | |
| @@ -419,6 +419,18 @@ static int config_output(AVFilterLink *outlink) · 340 unmodified lines | ||
| 419 | 419 | return 0; |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | +static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, | |
| 423 | + char *res, int res_len, int flags) | |
| 424 | +{ | |
| 425 | + int ret; | |
| 426 | + | |
| 427 | + ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); | |
| 428 | + if (ret < 0) | |
| 429 | + return ret; | |
| 430 | + | |
| 431 | + return config_input(ctx->inputs[0]); | |
| 432 | +} | |
| 433 | + | |
| 422 | 434 | static const AVFilterPad inputs[] = { |
| 423 | 435 | { |
| 424 | 436 | .name = "default", |
| @@ -447,6 +459,7 @@ AVFilter ff_vf_datascope = { · 22 unmodified lines | ||
| 447 | 459 | .inputs = inputs, |
| 448 | 460 | .outputs = outputs, |
| 449 | 461 | .flags = AVFILTER_FLAG_SLICE_THREADS, |
| 462 | + .process_command = process_command, | |
| 450 | 463 | }; |
| 451 | 464 | |
| 452 | 465 | typedef struct PixscopeContext { |