[FFmpeg-devel] [PATCH 3/5] libavfilter/ebur128: add gauge option

Moritz Barsnick barsnick at gmx.net
Mon Oct 8 10:18:30 EEST 2018


On Sun, Oct 07, 2018 at 23:19:54 +0200, Daniel Molkentin wrote:
> +enum {
> +    GAUGE_TYPE_MOMENTARY = 0,
> +    GAUGE_TYPE_SHORTTERM = 1,
> +};
> +    { "gauge", "set gauge display type", OFFSET(gauge_type), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, V|F, "gaugetype" },

min and max range should be GAUGE_TYPE_MOMENTARY, GAUGE_TYPE_SHORTTERM
(though your code below mnakes sure that everything which is not
GAUGE_TYPE_MOMENTARY / 0 will be GAUGE_TYPE_SHORTTERM).

> +        { "momentary",   "display momentary value",   0, AV_OPT_TYPE_CONST, {.i64 = GAUGE_TYPE_MOMENTARY}, INT_MIN, INT_MAX, V|F, "gaugetype" },
> +        { "shortterm",   "display short-term value",  0, AV_OPT_TYPE_CONST, {.i64 = GAUGE_TYPE_SHORTTERM}, INT_MIN, INT_MAX, V|F, "gaugetype" },

If you feel that "m" and "s" are practical abbreviations, you can
create "aliases" for them, by duplicating the options (i.e. *adding*
the below):
+        { "m",           "display momentary value",   0, AV_OPT_TYPE_CONST, {.i64 = GAUGE_TYPE_MOMENTARY}, INT_MIN, INT_MAX, V|F, "gaugetype" },
+        { "s",           "display short-term value",  0, AV_OPT_TYPE_CONST, {.i64 = GAUGE_TYPE_SHORTTERM}, INT_MIN, INT_MAX, V|F, "gaugetype" },

Moritz


More information about the ffmpeg-devel mailing list