[FFmpeg-devel] [PATCH v3 1/3] avcodec: add ambient viewing environment packet side data.

Cosmin Stejerean cosmin at cosmin.at
Sun Feb 4 13:16:53 EET 2024


From: Damiano Galassi <damiog at gmail.com>

---
 fftools/ffprobe.c     | 3 +++
 libavcodec/avpacket.c | 1 +
 libavcodec/decode.c   | 1 +
 libavcodec/packet.h   | 7 +++++++
 4 files changed, 12 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index f33e2471cb..aa1153e709 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2392,6 +2392,9 @@ static void print_pkt_side_data(WriterContext *w,
             AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
             print_int("max_content", metadata->MaxCLL);
             print_int("max_average", metadata->MaxFALL);
+        } else if (sd->type == AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT) {
+            print_ambient_viewing_environment(
+                w, (const AVAmbientViewingEnvironment *)sd->data);
         } else if (sd->type == AV_PKT_DATA_DYNAMIC_HDR10_PLUS) {
             AVDynamicHDRPlus *metadata = (AVDynamicHDRPlus *)sd->data;
             print_dynamic_hdr10_plus(w, metadata);
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 0f8c9b77ae..e118bbaad1 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -301,6 +301,7 @@ const char *av_packet_side_data_name(enum AVPacketSideDataType type)
     case AV_PKT_DATA_DOVI_CONF:                  return "DOVI configuration record";
     case AV_PKT_DATA_S12M_TIMECODE:              return "SMPTE ST 12-1:2014 timecode";
     case AV_PKT_DATA_DYNAMIC_HDR10_PLUS:         return "HDR10+ Dynamic Metadata (SMPTE 2094-40)";
+    case AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT:return "Ambient viewing environment";
     case AV_PKT_DATA_IAMF_MIX_GAIN_PARAM:        return "IAMF Mix Gain Parameter Data";
     case AV_PKT_DATA_IAMF_DEMIXING_INFO_PARAM:   return "IAMF Demixing Info Parameter Data";
     case AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM: return "IAMF Recon Gain Info Parameter Data";
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 2cfb3fcf97..da6446d879 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1434,6 +1434,7 @@ static const struct {
     { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,        AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
     { AV_PKT_DATA_ICC_PROFILE,                AV_FRAME_DATA_ICC_PROFILE },
     { AV_PKT_DATA_DYNAMIC_HDR10_PLUS,         AV_FRAME_DATA_DYNAMIC_HDR_PLUS },
+    { AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,AV_FRAME_DATA_AMBIENT_VIEWING_ENVIRONMENT },
 };
 
 int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx,
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 2c57d262c6..215b1c9970 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -299,6 +299,13 @@ enum AVPacketSideDataType {
      */
     AV_PKT_DATA_DYNAMIC_HDR10_PLUS,
 
+    /**
+     * Ambient viewing environment metadata, as defined by H.274.. This metadata
+     * should be associated with a video stream and contains data in the form
+     * of the AVAmbientViewingEnvironment struct.
+    */
+    AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,
+
     /**
      * IAMF Mix Gain Parameter Data associated with the audio frame. This metadata
      * is in the form of the AVIAMFParamDefinition struct and contains information
-- 
2.42.1




More information about the ffmpeg-devel mailing list