From c0a311c26bd4e78450edb76f7d9593f348e477c5 Mon Sep 17 00:00:00 2001 From: Cosmin Stejerean Date: Wed, 8 May 2024 09:08:28 -0700 Subject: [PATCH] handle dav1 non-backwward compatible mode and add the dby1 compatible brands for P10.x as well --- packager/media/formats/mp4/mp4_media_parser.cc | 2 ++ packager/media/formats/mp4/mp4_muxer.cc | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packager/media/formats/mp4/mp4_media_parser.cc b/packager/media/formats/mp4/mp4_media_parser.cc index 9502f0a0dc..3b072dc434 100644 --- a/packager/media/formats/mp4/mp4_media_parser.cc +++ b/packager/media/formats/mp4/mp4_media_parser.cc @@ -163,6 +163,7 @@ bool UpdateCodecStringForDolbyVision( switch (actual_format) { case FOURCC_dvh1: case FOURCC_dvhe: + case FOURCC_dav1: // Non-Backward compatibility mode. Replace the code string with // Dolby Vision only. *codec_string = dovi_config.GetCodecString(actual_format); @@ -202,6 +203,7 @@ bool UpdateDolbyVisionInfo(FourCC actual_format, switch (actual_format) { case FOURCC_dvh1: case FOURCC_dvhe: + case FOURCC_dav1: // Non-Backward compatibility mode. Replace the code string with // Dolby Vision only. *codec_string = dovi_config.GetCodecString(actual_format); diff --git a/packager/media/formats/mp4/mp4_muxer.cc b/packager/media/formats/mp4/mp4_muxer.cc index 3527a9e7be..46fb0e340d 100644 --- a/packager/media/formats/mp4/mp4_muxer.cc +++ b/packager/media/formats/mp4/mp4_muxer.cc @@ -244,7 +244,10 @@ Status MP4Muxer::DelayInitializeMuxer() { static_cast(streams()[0].get()) ->supplemental_codec(); if (codec_string.find("dvh") != std::string::npos || - supplemental_codec_string.find("dvh") != std::string::npos) + supplemental_codec_string.find("dvh") != std::string::npos || + codec_string.find("dav1") != std::string::npos || + supplemental_codec_string.find("dav1") != std::string::npos + ) ftyp->compatible_brands.push_back(FOURCC_dby1); FourCC extra_brand = static_cast(streams()[0].get())