| @@ -79,12 +79,13 @@ typedef struct ThreadData { · 78 unmodified lines |
| 79 | | 79 | |
| 80 | #define OFFSET(x) offsetof(LUT2Context, x) | 80 | #define OFFSET(x) offsetof(LUT2Context, x) |
| 81 | #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | 81 | #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM |
| | 82 | #define TFLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_RUNTIME_PARAM |
| 82 | | 83 | |
| 83 | static const AVOption options[] = { | 84 | static const AVOption options[] = { |
| 84 | { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 85 | { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 85 | { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 86 | { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 86 | { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 87 | { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 87 | { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 88 | { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 88 | { "d", "set output depth", OFFSET(odepth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 16, .flags = FLAGS }, | 89 | { "d", "set output depth", OFFSET(odepth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 16, .flags = FLAGS }, |
| 89 | { NULL } | 90 | { NULL } |
| 90 | }; | 91 | }; |
| @@ -353,7 +354,8 @@ static int config_output(AVFilterLink *outlink) · 262 unmodified lines |
| 353 | } | 354 | } |
| 354 | | 355 | |
| 355 | for (p = 0; p < s->nb_planes; p++) { | 356 | for (p = 0; p < s->nb_planes; p++) { |
| 356 | s->lut[p] = av_malloc_array(1 << s->depth, sizeof(uint16_t)); | 357 | if (!s->lut[p]) |
| | 358 | s->lut[p] = av_malloc_array(1 << s->depth, sizeof(uint16_t)); |
| 357 | if (!s->lut[p]) | 359 | if (!s->lut[p]) |
| 358 | return AVERROR(ENOMEM); | 360 | return AVERROR(ENOMEM); |
| 359 | } | 361 | } |
| @@ -543,6 +545,17 @@ static const AVFilterPad outputs[] = { · 183 unmodified lines |
| 543 | { NULL } | 545 | { NULL } |
| 544 | }; | 546 | }; |
| 545 | | 547 | |
| | 548 | static int process_command(AVFilterContext *ctx, const char *cmd, const char *args, |
| | 549 | char *res, int res_len, int flags) |
| | 550 | { |
| | 551 | int ret = ff_filter_process_command(ctx, cmd, args, res, res_len, flags); |
| | 552 | |
| | 553 | if (ret < 0) |
| | 554 | return ret; |
| | 555 | |
| | 556 | return config_output(ctx->outputs[0]); |
| | 557 | } |
| | 558 | |
| 546 | #define lut2_options options | 559 | #define lut2_options options |
| 547 | | 560 | |
| 548 | FRAMESYNC_DEFINE_CLASS(lut2, LUT2Context, fs); | 561 | FRAMESYNC_DEFINE_CLASS(lut2, LUT2Context, fs); |
| @@ -560,6 +573,7 @@ AVFilter ff_vf_lut2 = { · 11 unmodified lines |
| 560 | .outputs = outputs, | 573 | .outputs = outputs, |
| 561 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | | 574 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | |
| 562 | AVFILTER_FLAG_SLICE_THREADS, | 575 | AVFILTER_FLAG_SLICE_THREADS, |
| | 576 | .process_command = process_command, |
| 563 | }; | 577 | }; |
| 564 | | 578 | |
| 565 | #if CONFIG_TLUT2_FILTER | 579 | #if CONFIG_TLUT2_FILTER |
| @@ -610,10 +624,10 @@ static int tlut2_filter_frame(AVFilterLink *inlink, AVFrame *frame) · 44 unmodified lines |
| 610 | } | 624 | } |
| 611 | | 625 | |
| 612 | static const AVOption tlut2_options[] = { | 626 | static const AVOption tlut2_options[] = { |
| 613 | { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 627 | { "c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 614 | { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 628 | { "c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 615 | { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 629 | { "c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 616 | { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = FLAGS }, | 630 | { "c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, { .str = "x" }, .flags = TFLAGS }, |
| 617 | { NULL } | 631 | { NULL } |
| 618 | }; | 632 | }; |
| 619 | | 633 | |
| @@ -650,6 +664,7 @@ AVFilter ff_vf_tlut2 = { · 30 unmodified lines |
| 650 | .outputs = tlut2_outputs, | 664 | .outputs = tlut2_outputs, |
| 651 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | | 665 | .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | |
| 652 | AVFILTER_FLAG_SLICE_THREADS, | 666 | AVFILTER_FLAG_SLICE_THREADS, |
| | 667 | .process_command = process_command, |
| 653 | }; | 668 | }; |
| 654 | | 669 | |
| 655 | #endif | 670 | #endif |