This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit f14e7eaf7cd2d54615f2ddc5714376bfd2cea23c Author: Niklas Haas <[email protected]> AuthorDate: Tue Aug 18 15:04:30 2026 +0200 Commit: Niklas Haas <[email protected]> CommitDate: Wed Sep 30 14:37:58 2026 +0200 avfilter: add AV_FRAME_DATA_GAIN_MAP_PARAMS support To both f_sidedata and vf_showinfo. Useful for debugging. Signed-off-by: Niklas Haas <[email protected]> --- doc/filters.texi | 1 + libavfilter/f_sidedata.c | 1 + libavfilter/vf_showinfo.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/doc/filters.texi b/doc/filters.texi index 1a9bbeff7e..24d52a3a01 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -34366,6 +34366,7 @@ Possible values are: @item DYNAMIC_HDR_VIVID @item AMBIENT_VIEWING_ENVIRONMENT @item VIDEO_HINT +@item GAIN_MAP_PARAMS @end table @end table diff --git a/libavfilter/f_sidedata.c b/libavfilter/f_sidedata.c index 6c81c6b6a5..eb0301c5ce 100644 --- a/libavfilter/f_sidedata.c +++ b/libavfilter/f_sidedata.c @@ -80,6 +80,7 @@ static const AVOption filt_name##_options[] = { \ { "DYNAMIC_HDR_VIVID", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_DYNAMIC_HDR_VIVID }, 0, 0, FLAGS, .unit = "type" }, \ { "AMBIENT_VIEWING_ENVIRONMENT","", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT}, 0, 0, FLAGS, .unit = "type" }, \ { "VIDEO_HINT", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_VIDEO_HINT }, 0, 0, FLAGS, .unit = "type" }, \ + { "GAIN_MAP_PARAMS", "", 0, AV_OPT_TYPE_CONST, {.i64 = AV_FRAME_DATA_GAIN_MAP_PARAMS }, 0, 0, FLAGS, .unit = "type" }, \ { NULL } \ } diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index 4ac3d45dc0..21cde369f5 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -32,6 +32,7 @@ #include "libavutil/imgutils.h" #include "libavutil/internal.h" #include "libavutil/film_grain_params.h" +#include "libavutil/gain_map.h" #include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/hdr_dynamic_vivid_metadata.h" #include "libavutil/opt.h" @@ -655,6 +656,32 @@ static void dump_dovi_metadata(AVFilterContext *ctx, const AVFrameSideData *sd) av_log(ctx, AV_LOG_INFO, "source_diagonal=%"PRIu16"; ", color->source_diagonal); } +static void dump_gain_map_params(AVFilterContext *ctx, const AVFrameSideData *sd) +{ + const AVGainMapParams *p = (const AVGainMapParams *) sd->data; + av_log(ctx, AV_LOG_INFO, "version=%d, nb_channels=%d, use_base_color_space=%d, " + "base_hdr_headroom=%f, alternate_hdr_headroom=%f, channels={ ", + p->version, p->nb_channels, p->use_base_color_space, + av_q2d(p->base_hdr_headroom), av_q2d(p->alternate_hdr_headroom)); + + if (!(p->nb_channels == 1 || p->nb_channels == 3)) { + av_log(ctx, AV_LOG_ERROR, "invalid data }"); + return; + } + + for (int c = 0; c < p->nb_channels; c++) { + const struct AVGainMapChannel *ch = &p->channels[c]; + av_log(ctx, AV_LOG_INFO, + "{ gain_map_min=%f, gain_map_max=%f, gamma=%f, " + "base_offset=%f, alternate_offset=%f } ", + av_q2d(ch->gain_map_min), av_q2d(ch->gain_map_max), + av_q2d(ch->gamma), av_q2d(ch->base_offset), + av_q2d(ch->alternate_offset)); + } + + av_log(ctx, AV_LOG_INFO, "}"); +} + static void dump_ambient_viewing_environment(AVFilterContext *ctx, const AVFrameSideData *sd) { const AVAmbientViewingEnvironment *ambient_viewing_environment = @@ -865,6 +892,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) case AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT: dump_ambient_viewing_environment(ctx, sd); break; + case AV_FRAME_DATA_GAIN_MAP_PARAMS: + dump_gain_map_params(ctx, sd); + break; case AV_FRAME_DATA_VIEW_ID: av_log(ctx, AV_LOG_INFO, "view id: %d\n", *(int*)sd->data); break; -- To stop receiving notification emails like this one, please contact [email protected]. _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
