1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-21 23:42:23 +00:00

New: Support for DV HDR10Plus from media info

Co-authored-by: Chad A Simmons <chad.simmons@member.fsf.org>

(cherry picked from commit 848c03f16ab25ff193ea9ed7e4b21e99c6fb3fa0)
This commit is contained in:
Bogdan 2023-12-15 03:23:54 +02:00 committed by servarr
parent fcda6faf3d
commit 9a97b2b668
5 changed files with 11 additions and 3 deletions

View file

@ -15,6 +15,7 @@ public class FormatVideoDynamicRangeTypeFixture : TestBase
[TestCase(HdrFormat.Hdr10Plus, "HDR10Plus")]
[TestCase(HdrFormat.DolbyVision, "DV")]
[TestCase(HdrFormat.DolbyVisionHdr10, "DV HDR10")]
[TestCase(HdrFormat.DolbyVisionHdr10Plus, "DV HDR10Plus")]
[TestCase(HdrFormat.DolbyVisionHlg, "DV HLG")]
[TestCase(HdrFormat.DolbyVisionSdr, "DV SDR")]
public void should_format_video_dynamic_range_type(HdrFormat format, string expectedVideoDynamicRangeType)

View file

@ -116,6 +116,8 @@ public void get_info_unicode()
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.HdrDynamicMetadataSpmte2094", null, HdrFormat.Hdr10Plus)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", null, HdrFormat.DolbyVision)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", 1, HdrFormat.DolbyVisionHdr10)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData,FFMpegCore.HdrDynamicMetadataSpmte2094", 1, HdrFormat.DolbyVisionHdr10Plus)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData,FFMpegCore.HdrDynamicMetadataSpmte2094", 6, HdrFormat.DolbyVisionHdr10Plus)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", 2, HdrFormat.DolbyVisionSdr)]
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", 4, HdrFormat.DolbyVisionHlg)]
public void should_detect_hdr_correctly(int bitDepth, string colourPrimaries, string transferFunction, string sideDataTypes, int? doviConfigId, HdrFormat expected)

View file

@ -10,6 +10,7 @@ public enum HdrFormat
DolbyVision,
DolbyVisionHdr10,
DolbyVisionSdr,
DolbyVisionHlg
DolbyVisionHlg,
DolbyVisionHdr10Plus
}
}

View file

@ -320,6 +320,8 @@ public static string FormatVideoDynamicRangeType(MediaInfoModel mediaInfo)
return "DV";
case HdrFormat.DolbyVisionHdr10:
return "DV HDR10";
case HdrFormat.DolbyVisionHdr10Plus:
return "DV HDR10Plus";
case HdrFormat.DolbyVisionHlg:
return "DV HLG";
case HdrFormat.DolbyVisionSdr:

View file

@ -188,12 +188,14 @@ public static HdrFormat GetHdrFormat(int bitDepth, string colorPrimaries, string
if (TryGetSideData<DoviConfigurationRecordSideData>(sideData, out var dovi))
{
var hasHdr10Plus = TryGetSideData<HdrDynamicMetadataSpmte2094>(sideData, out _);
return dovi.DvBlSignalCompatibilityId switch
{
1 => HdrFormat.DolbyVisionHdr10,
1 => hasHdr10Plus ? HdrFormat.DolbyVisionHdr10Plus : HdrFormat.DolbyVisionHdr10,
2 => HdrFormat.DolbyVisionSdr,
4 => HdrFormat.DolbyVisionHlg,
6 => HdrFormat.DolbyVisionHdr10,
6 => hasHdr10Plus ? HdrFormat.DolbyVisionHdr10Plus : HdrFormat.DolbyVisionHdr10,
_ => HdrFormat.DolbyVision
};
}