[FFmpeg-devel] [PATCH 1/4] avformat/avformat: add a new disposition to signal the stream is an HDR gainmap

James Almer jamrial at gmail.com
Thu Sep 26 01:52:16 EEST 2024


HDR images photos taken by certain cameras split this as a separate image.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavformat/avformat.h | 5 +++++
 libavformat/dump.c     | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 56c1c80289..6d9f5c4399 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -718,6 +718,11 @@ typedef struct AVIndexEntry {
  * Annex G/H, or HEVC Annex F).
  */
 #define AV_DISPOSITION_MULTILAYER           (1 << 21)
+/**
+ * The video stream contains an HDR gainmap. Only ever used with
+ * AV_DISPOSITION_DEPENDENT.
+ */
+#define AV_DISPOSITION_GAINMAP              (1 << 22)
 
 /**
  * @return The AV_DISPOSITION_* flag corresponding to disp or a negative error
diff --git a/libavformat/dump.c b/libavformat/dump.c
index f20c2c4953..5178f19685 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -589,6 +589,8 @@ static void dump_disposition(int disposition, int log_level)
         av_log(NULL, log_level, " (non-diegetic)");
     if (disposition & AV_DISPOSITION_MULTILAYER)
         av_log(NULL, log_level, " (multilayer)");
+    if (disposition & AV_DISPOSITION_GAINMAP)
+        av_log(NULL, log_level, " (hdr gainmap)");
 }
 
 /* "user interface" functions */
-- 
2.46.0



More information about the ffmpeg-devel mailing list