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

Git pushed a commit to branch master
in repository ffmpeg.

commit 6ef1a9579f8d3cf797613f24ddd3d9f43c468659
Author:     Romain Beauxis <[email protected]>
AuthorDate: Wed Apr 22 10:05:47 2026 -0500
Commit:     toots <[email protected]>
CommitDate: Sat May 30 17:37:28 2026 +0000

    avformat/matroskaenc: write hvcE BlockAdditionMapping for Dolby Vision EL
    
    When AV_PKT_DATA_HEVC_CONF is present on an HEVC track, write
    an hvcE BlockAdditionMapping alongside the existing dvcC/dvvC one,
    carrying the raw HEVCDecoderConfigurationRecord for the enhancement layer.
---
 libavformat/matroskaenc.c                    | 20 ++++++++++++++++++++
 tests/ref/fate/matroska-dovi-hvce-mkv-to-mkv |  7 +++++--
 tests/ref/fate/matroska-dovi-hvce-mp4-to-mkv |  7 +++++--
 3 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index ff85722120..c9386db6a0 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1785,6 +1785,26 @@ static void 
mkv_write_blockadditionmapping(AVFormatContext *s, const MatroskaMux
 
         end_ebml_master(pb, mapping);
     }
+
+    sd = av_packet_side_data_get(par->coded_side_data, par->nb_coded_side_data,
+                                 AV_PKT_DATA_HEVC_CONF);
+    if (sd) {
+        ebml_master mapping;
+        uint64_t expected_size = (2 + 1 + (sizeof(HVCE_BLOCK_TYPE_NAME) - 1))
+                                + (2 + 1 + 4)
+                                + (2 + ebml_length_size(sd->size) + sd->size);
+
+        mapping = start_ebml_master(pb, MATROSKA_ID_TRACKBLKADDMAPPING, 
expected_size);
+
+        put_ebml_string(pb, MATROSKA_ID_BLKADDIDNAME, HVCE_BLOCK_TYPE_NAME);
+        put_ebml_uint(pb, MATROSKA_ID_BLKADDIDTYPE, 
MATROSKA_BLOCK_ADD_ID_TYPE_HVCE);
+        put_ebml_binary(pb, MATROSKA_ID_BLKADDIDEXTRADATA, sd->data, sd->size);
+
+        end_ebml_master(pb, mapping);
+
+        // DV Profile 7 EL uses BlockAddID 1; ensure MaxBlockAdditionID 
reflects this.
+        track->max_blockaddid = FFMAX(track->max_blockaddid, 1);
+    }
 #endif
 }
 
diff --git a/tests/ref/fate/matroska-dovi-hvce-mkv-to-mkv 
b/tests/ref/fate/matroska-dovi-hvce-mkv-to-mkv
index 3d4555a6a5..e1b832d947 100644
--- a/tests/ref/fate/matroska-dovi-hvce-mkv-to-mkv
+++ b/tests/ref/fate/matroska-dovi-hvce-mkv-to-mkv
@@ -1,5 +1,5 @@
-c956733710b9d1d439c766d5ef8f27d9 
*tests/data/fate/matroska-dovi-hvce-mkv-to-mkv.matroska
-667960 tests/data/fate/matroska-dovi-hvce-mkv-to-mkv.matroska
+d9c448202481e87d921bb81f268082e6 
*tests/data/fate/matroska-dovi-hvce-mkv-to-mkv.matroska
+668201 tests/data/fate/matroska-dovi-hvce-mkv-to-mkv.matroska
 #extradata 0:      187, 0x34a930cb
 #tb 0: 1/1000
 #media_type 0: video
@@ -20,4 +20,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]
diff --git a/tests/ref/fate/matroska-dovi-hvce-mp4-to-mkv 
b/tests/ref/fate/matroska-dovi-hvce-mp4-to-mkv
index 32efaee7fd..03e25e6be7 100644
--- a/tests/ref/fate/matroska-dovi-hvce-mp4-to-mkv
+++ b/tests/ref/fate/matroska-dovi-hvce-mp4-to-mkv
@@ -1,5 +1,5 @@
-c2144d96764e79e0b449431b0b19a585 
*tests/data/fate/matroska-dovi-hvce-mp4-to-mkv.matroska
-667808 tests/data/fate/matroska-dovi-hvce-mp4-to-mkv.matroska
+8c4a1c8c1c40d3c75e4019aa4f06a6cc 
*tests/data/fate/matroska-dovi-hvce-mp4-to-mkv.matroska
+668049 tests/data/fate/matroska-dovi-hvce-mp4-to-mkv.matroska
 #extradata 0:      187, 0x34a930cb
 #tb 0: 1/1000
 #media_type 0: video
@@ -20,4 +20,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