[FFmpeg-devel] [PATCH 1/5] API: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType

vectronic hello.vectronic at gmail.com
Mon Sep 23 23:43:02 EEST 2019


Signed-off-by: vectronic <hello.vectronic at gmail.com>
---
 libavcodec/avcodec.h  | 6 ++++++
 libavcodec/avpacket.c | 1 +
 libavcodec/decode.c   | 1 +
 libavformat/dump.c    | 3 +++
 4 files changed, 11 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c91ee4af5b..7d341f85a6 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1407,6 +1407,12 @@ enum AVPacketSideDataType {
      */
     AV_PKT_DATA_AFD,
 
+    /**
+     * ICC profile data consisting of an opaque octet buffer following the
+     * format described by ISO 15076-1.
+     */
+    AV_PKT_DATA_ICC_PROFILE,
+
     /**
      * The number of side data types.
      * This is not part of the public API/ABI in the sense that it may
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 858f827a0a..efcc167d12 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -394,6 +394,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type)
     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";
+    case AV_PKT_DATA_ICC_PROFILE:                return "ICC Profile";
     }
     return NULL;
 }
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index a9ea5a51e6..ee12dd0129 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1750,6 +1750,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_ICC_PROFILE,                AV_FRAME_DATA_ICC_PROFILE },
     };
 
     if (pkt) {
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 56814ff7d2..220f404d65 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -446,6 +446,9 @@ static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
         case AV_PKT_DATA_CONTENT_LIGHT_LEVEL:
             dump_content_light_metadata(ctx, &sd);
             break;
+        case AV_PKT_DATA_ICC_PROFILE:
+            av_log(ctx, AV_LOG_INFO, "ICC Profile");
+            break;
         default:
             av_log(ctx, AV_LOG_INFO,
                    "unknown side data type %d (%d bytes)", sd.type, sd.size);
-- 
2.21.0 (Apple Git-122)



More information about the ffmpeg-devel mailing list