aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dump.c
diff options
context:
space:
mode:
authorNeil Birkbeck <neil.birkbeck@gmail.com>2016-02-29 17:20:17 -0800
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-04 23:11:51 +0100
commit3c658e2655179fa2738a7806a342f89a17bd9230 (patch)
treedfb4c3516ad894d5ca9386aaf975f508baf2eddd /libavformat/dump.c
parentbbda13a7713b8ae8c725c5bb774ac45d614b34eb (diff)
downloadffmpeg-3c658e2655179fa2738a7806a342f89a17bd9230.tar.gz
lavf/dump.c: Print mastering display metadata
Signed-off-by: Neil Birkbeck <neil.birkbeck@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/dump.c')
-rw-r--r--libavformat/dump.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56c285d832..9e7c12b08d 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -26,6 +26,7 @@
#include "libavutil/display.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
+#include "libavutil/mastering_display_metadata.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/avstring.h"
@@ -352,6 +353,23 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
cpb->vbv_delay);
}
+static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
+ AVMasteringDisplayMetadata* metadata = (AVMasteringDisplayMetadata*)sd->data;
+ av_log(ctx, AV_LOG_INFO, "Mastering Display Metadata, "
+ "has_primaries:%d has_luminance:%d "
+ "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
+ "min_luminance=%f, max_luminance=%f\n",
+ metadata->has_primaries, metadata->has_luminance,
+ av_q2d(metadata->display_primaries[0][0]),
+ av_q2d(metadata->display_primaries[0][1]),
+ av_q2d(metadata->display_primaries[1][0]),
+ av_q2d(metadata->display_primaries[1][1]),
+ av_q2d(metadata->display_primaries[2][0]),
+ av_q2d(metadata->display_primaries[2][1]),
+ av_q2d(metadata->white_point[0]), av_q2d(metadata->white_point[1]),
+ av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
+}
+
static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
{
int i;
@@ -400,6 +418,9 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
av_log(ctx, AV_LOG_INFO, "cpb: ");
dump_cpb(ctx, &sd);
break;
+ case AV_PKT_DATA_MASTERING_DISPLAY_METADATA:
+ dump_mastering_display_metadata(ctx, &sd);
+ break;
default:
av_log(ctx, AV_LOG_WARNING,
"unknown side data type %d (%d bytes)", sd.type, sd.size);