diff options
author | James Almer <jamrial@gmail.com> | 2023-01-13 18:34:26 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2023-01-15 12:32:21 -0300 |
commit | 2378cbe36bd5d42611bc62498cd25cb819f9034f (patch) | |
tree | b64e790bd0ffa45c2aba2eaf1bdb5ff13efa2d29 | |
parent | b37795688a9bfa6d5a2e9b2535c4b10ebc14ac5d (diff) | |
download | ffmpeg-2378cbe36bd5d42611bc62498cd25cb819f9034f.tar.gz |
avfilter/vf_showinfo: add support for Ambient Viewing Environment side data
Reviewed-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
-rw-r--r-- | libavfilter/vf_showinfo.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c index d5edbd2f0a..e55625b338 100644 --- a/libavfilter/vf_showinfo.c +++ b/libavfilter/vf_showinfo.c @@ -42,6 +42,7 @@ #include "libavutil/mastering_display_metadata.h" #include "libavutil/video_enc_params.h" #include "libavutil/detection_bbox.h" +#include "libavutil/ambient_viewing_environment.h" #include "libavutil/uuid.h" #include "avfilter.h" @@ -601,6 +602,17 @@ 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_ambient_viewing_environment(AVFilterContext *ctx, const AVFrameSideData *sd) +{ + const AVAmbientViewingEnvironment *ambient_viewing_environment = + (const AVAmbientViewingEnvironment *)sd->data; + + av_log(ctx, AV_LOG_INFO, "ambient_illuminance=%f, ambient_light_x=%f, ambient_light_y=%f", + av_q2d(ambient_viewing_environment->ambient_illuminance), + av_q2d(ambient_viewing_environment->ambient_light_x), + av_q2d(ambient_viewing_environment->ambient_light_y)); +} + static void dump_color_property(AVFilterContext *ctx, AVFrame *frame) { const char *color_range_str = av_color_range_name(frame->color_range); @@ -797,6 +809,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) case AV_FRAME_DATA_DOVI_METADATA: dump_dovi_metadata(ctx, sd); break; + case AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT: + dump_ambient_viewing_environment(ctx, sd); + break; default: if (name) av_log(ctx, AV_LOG_INFO, |