[FFmpeg-devel] [PATCH v2 5/7] lavf/dump: dump dolby vison side data

Jun Zhao mypopydev at gmail.com
Sat Apr 11 16:44:07 EEST 2020


From: Jun Zhao <barryjzhao at tencent.com>

dump dolby vison side data.

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavformat/dump.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 220f404..be0028b 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -27,6 +27,7 @@
 #include "libavutil/intreadwrite.h"
 #include "libavutil/log.h"
 #include "libavutil/mastering_display_metadata.h"
+#include "libavutil/dolby_vision_meta.h"
 #include "libavutil/mathematics.h"
 #include "libavutil/opt.h"
 #include "libavutil/avstring.h"
@@ -387,6 +388,19 @@ static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData *
     }
 }
 
+static void dump_dolby_vision_metadata(void *ctx, AVPacketSideData* sd)
+{
+    AVDOVIDecoderConfigurationRecord *dovi = (AVDOVIDecoderConfigurationRecord *)sd->data;
+    av_log(ctx, AV_LOG_INFO, "Dolby Vision, version: %d.%d, profile: %d, level: %d, "
+           "rpu flag: %d, el flag: %d, bl flag: %d, compatibility id: %d",
+           dovi->dv_version_major, dovi->dv_version_minor,
+           dovi->dv_profile, dovi->dv_level,
+           dovi->rpu_present_flag,
+           dovi->el_present_flag,
+           dovi->bl_present_flag,
+           dovi->dv_bl_signal_compatibility_id);
+}
+
 static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
 {
     int i;
@@ -449,6 +463,9 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
         case AV_PKT_DATA_ICC_PROFILE:
             av_log(ctx, AV_LOG_INFO, "ICC Profile");
             break;
+        case AV_PKT_DATA_DOLBY_VISION_DECODER_CONF:
+            dump_dolby_vision_metadata(ctx, &sd);
+            break;
         default:
             av_log(ctx, AV_LOG_INFO,
                    "unknown side data type %d (%d bytes)", sd.type, sd.size);
-- 
2.7.4



More information about the ffmpeg-devel mailing list