This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 2c74d197eed2805bf77e9fdb0fe4eae1171ffdaa
Author:     Romain Beauxis <[email protected]>
AuthorDate: Wed Apr 22 09:58:01 2026 -0500
Commit:     toots <[email protected]>
CommitDate: Sat May 30 17:37:28 2026 +0000

    avformat/mov: parse hvcE box as AV_PKT_DATA_HEVC_CONF side data
    
    The hvcE box carries the HEVCDecoderConfigurationRecord for the Dolby
    Vision enhancement layer in ISOM-based containers. Store its raw
    contents as AV_PKT_DATA_HEVC_CONF on the stream's coded side data,
    mirroring the existing dvcC/dvvC handling.
---
 libavformat/mov.c                     | 28 ++++++++++++++++++++++++++++
 tests/ref/fate/mov-dovi-hvce-mp4-read |  3 +++
 2 files changed, 31 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index d0d4910676..eeb825cc90 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -8750,6 +8750,33 @@ static int mov_read_dvcc_dvvc(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
     return ff_isom_parse_dvcc_dvvc(c->fc, st, buf, read_size);
 }
 
+static int mov_read_hvce(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+    AVStream *st;
+    AVPacketSideData *sd;
+    int ret;
+
+    if (c->fc->nb_streams < 1)
+        return 0;
+    st = c->fc->streams[c->fc->nb_streams - 1];
+
+    if (atom.size < 23 || atom.size > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE)
+        return AVERROR_INVALIDDATA;
+
+    sd = av_packet_side_data_new(&st->codecpar->coded_side_data,
+                                 &st->codecpar->nb_coded_side_data,
+                                 AV_PKT_DATA_HEVC_CONF,
+                                 atom.size, 0);
+    if (!sd)
+        return AVERROR(ENOMEM);
+
+    ret = ffio_read_size(pb, sd->data, atom.size);
+    if (ret < 0)
+        return ret;
+
+    return 0;
+}
+
 static int mov_read_lhvc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
     AVStream *st;
@@ -9707,6 +9734,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
 { MKTAG('d','v','c','C'), mov_read_dvcc_dvvc },
 { MKTAG('d','v','v','C'), mov_read_dvcc_dvvc },
 { MKTAG('d','v','w','C'), mov_read_dvcc_dvvc },
+{ MKTAG('h','v','c','E'), mov_read_hvce },
 { MKTAG('k','i','n','d'), mov_read_kind },
 { MKTAG('S','A','3','D'), mov_read_SA3D }, /* ambisonic audio box */
 { MKTAG('S','A','N','D'), mov_read_SAND }, /* non diegetic audio box */
diff --git a/tests/ref/fate/mov-dovi-hvce-mp4-read 
b/tests/ref/fate/mov-dovi-hvce-mp4-read
index cc826b8f81..0bf9adffbf 100644
--- a/tests/ref/fate/mov-dovi-hvce-mp4-read
+++ b/tests/ref/fate/mov-dovi-hvce-mp4-read
@@ -11,4 +11,7 @@ bl_present_flag=1
 dv_bl_signal_compatibility_id=6
 dv_md_compression=none
 [/SIDE_DATA]
+[SIDE_DATA]
+side_data_type=HEVC enhancement-layer decoder configuration
+[/SIDE_DATA]
 [/STREAM]

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to