diff mbox series

[FFmpeg-devel,4/4] fftools/ffprobe: add support for ambient viewing environment metadata

Message ID 1648423513-21261-4-git-send-email-lance.lmwang@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/4] avutil: add ambient viewing environment metadata side data | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Limin Wang March 27, 2022, 11:25 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 fftools/ffprobe.c          | 6 ++++++
 tests/ref/fate/hevc-dv-rpu | 6 ++++++
 2 files changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 05c167e..5abe496 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -52,6 +52,7 @@ 
 #include "libavutil/parseutils.h"
 #include "libavutil/timecode.h"
 #include "libavutil/timestamp.h"
+#include "libavutil/ambient_viewing_env_metadata.h"
 #include "libavdevice/avdevice.h"
 #include "libavdevice/version.h"
 #include "libswscale/swscale.h"
@@ -2605,6 +2606,11 @@  static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
                 AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
                 print_int("max_content", metadata->MaxCLL);
                 print_int("max_average", metadata->MaxFALL);
+            } else if (sd->type == AV_FRAME_DATA_AMBIENT_VIEWING_ENV) {
+                AVAmbientViewingEnvMetadata *metadata = (AVAmbientViewingEnvMetadata *)sd->data;
+                print_int("ambient_illuminance", metadata->ambient_illuminance);
+                print_int("ambient_light_x", metadata->ambient_light_x);
+                print_int("ambient_light_y", metadata->ambient_light_y);
             } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) {
                 const AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE);
                 if (tag)
diff --git a/tests/ref/fate/hevc-dv-rpu b/tests/ref/fate/hevc-dv-rpu
index 6879f71..4ad5436 100644
--- a/tests/ref/fate/hevc-dv-rpu
+++ b/tests/ref/fate/hevc-dv-rpu
@@ -119,6 +119,9 @@  source_diagonal=42
 [/SIDE_DATA]
 [SIDE_DATA]
 side_data_type=Ambient Viewing Environment
+ambient_illuminance=3140000
+ambient_light_x=15635
+ambient_light_y=16450
 [/SIDE_DATA]
 [/FRAME]
 [FRAME]
@@ -239,5 +242,8 @@  source_diagonal=42
 [/SIDE_DATA]
 [SIDE_DATA]
 side_data_type=Ambient Viewing Environment
+ambient_illuminance=3140000
+ambient_light_x=15635
+ambient_light_y=16450
 [/SIDE_DATA]
 [/FRAME]