aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-05-21 14:52:18 +0200
committerPaul B Mahol <onemda@gmail.com>2023-05-21 14:56:30 +0200
commitc4b3e882f8bac6dfb4200a372f61dbf7a1a2d143 (patch)
tree10b705877c0cbf66afbf6ed169b3abcfe5deddd9 /libavfilter
parent08eb13c05c606fa7387f4f2e9109ba81450109fa (diff)
downloadffmpeg-c4b3e882f8bac6dfb4200a372f61dbf7a1a2d143.tar.gz
avfilter/f_graphmonitor: make opacity runtime option
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/f_graphmonitor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/f_graphmonitor.c b/libavfilter/f_graphmonitor.c
index 1184ba2f7c..5496d4ac7b 100644
--- a/libavfilter/f_graphmonitor.c
+++ b/libavfilter/f_graphmonitor.c
@@ -99,8 +99,8 @@ enum {
static const AVOption graphmonitor_options[] = {
{ "size", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
{ "s", "set monitor size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="hd720"}, 0, 0, VF },
- { "opacity", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },
- { "o", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VF },
+ { "opacity", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VFR },
+ { "o", "set video opacity", OFFSET(opacity), AV_OPT_TYPE_FLOAT, {.dbl=.9}, 0, 1, VFR },
{ "mode", "set mode", OFFSET(mode), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, MODE_MAX, VFR, "mode" },
{ "m", "set mode", OFFSET(mode), AV_OPT_TYPE_FLAGS, {.i64=0}, 0, MODE_MAX, VFR, "mode" },
{ "full", NULL, 0, AV_OPT_TYPE_CONST, {.i64=MODE_FULL}, 0, 0, VFR, "mode" },
@@ -393,6 +393,7 @@ static int create_frame(AVFilterContext *ctx, int64_t pts)
if (!out)
return AVERROR(ENOMEM);
+ s->bg[3] = 255 * s->opacity;
clear_image(s, out, outlink);
s->cache_index = 0;
@@ -516,7 +517,6 @@ static int config_output(AVFilterLink *outlink)
{
GraphMonitorContext *s = outlink->src->priv;
- s->bg[3] = 255 * s->opacity;
s->white[0] = s->white[1] = s->white[2] = 255;
s->yellow[0] = s->yellow[1] = 255;
s->red[0] = 255;