[FFmpeg-devel,2/2] Pass through HDR dynamic metdata (HDR10+) to AV packet side data.

Submitted by Mohammad Izadi on Jan. 3, 2019, 8:05 p.m.

Details

Message ID 20190103200541.214672-2-moh.izadi@gmail.com
State New
Headers show

Commit Message

Mohammad Izadi Jan. 3, 2019, 8:05 p.m.
---
 libavcodec/avcodec.h  | 8 ++++++++
 libavcodec/avpacket.c | 1 +
 libavcodec/decode.c   | 1 +
 libavcodec/version.h  | 2 +-
 4 files changed, 11 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 92567ec6d0..75fd44d74c 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1361,6 +1361,14 @@  enum AVPacketSideDataType {
      */
     AV_PKT_DATA_A53_CC,
 
+    /**
+     * HDR10+ dynamic metadata associated with a video frame. The metadata is in
+     * the form of the AVDynamicHDRPlus struct and contains
+     * information for color volume transform - application 4 of
+     * SPMTE 2094-40:2016 standard.
+     */
+    AV_PKT_DATA_HDR_DYNAMIC_HDR_PLUS,
+
     /**
      * This side data is encryption initialization data.
      * The format is not part of ABI, use av_encryption_init_info_* methods to
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 11ac4e80cd..48f3857fc2 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -391,6 +391,7 @@  const char *av_packet_side_data_name(enum AVPacketSideDataType type)
     case AV_PKT_DATA_CONTENT_LIGHT_LEVEL:        return "Content light level metadata";
     case AV_PKT_DATA_SPHERICAL:                  return "Spherical Mapping";
     case AV_PKT_DATA_A53_CC:                     return "A53 Closed Captions";
+    case AV_PKT_DATA_HDR_DYNAMIC_HDR_PLUS:       return "HDR10+ Dynamic Metadata (SMPTE 2094-40)";
     case AV_PKT_DATA_ENCRYPTION_INIT_INFO:       return "Encryption initialization data";
     case AV_PKT_DATA_ENCRYPTION_INFO:            return "Encryption info";
     case AV_PKT_DATA_AFD:                        return "Active Format Description data";
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index a32ff2fcd3..c6bc48567a 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1706,6 +1706,7 @@  int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
         { AV_PKT_DATA_MASTERING_DISPLAY_METADATA, AV_FRAME_DATA_MASTERING_DISPLAY_METADATA },
         { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,        AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
         { AV_PKT_DATA_A53_CC,                     AV_FRAME_DATA_A53_CC },
+        { AV_PKT_DATA_HDR_DYNAMIC_HDR_PLUS,       AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
     };
 
     if (pkt) {
diff --git a/libavcodec/version.h b/libavcodec/version.h
index ed56a1ece5..e72168affb 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@ 
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR  43
+#define LIBAVCODEC_VERSION_MINOR  44
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \