mirror of
https://github.com/Sonarr/Sonarr.git
synced 2025-01-10 23:29:53 +02:00
New: Support for DV HDR10Plus from media info
Co-authored-by: Chad A Simmons <chad.simmons@member.fsf.org>
This commit is contained in:
parent
96cb7c4d5f
commit
848c03f16a
@ -15,6 +15,7 @@ public class FormatVideoDynamicRangeTypeFixture : TestBase
|
|||||||
[TestCase(HdrFormat.Hdr10Plus, "HDR10Plus")]
|
[TestCase(HdrFormat.Hdr10Plus, "HDR10Plus")]
|
||||||
[TestCase(HdrFormat.DolbyVision, "DV")]
|
[TestCase(HdrFormat.DolbyVision, "DV")]
|
||||||
[TestCase(HdrFormat.DolbyVisionHdr10, "DV HDR10")]
|
[TestCase(HdrFormat.DolbyVisionHdr10, "DV HDR10")]
|
||||||
|
[TestCase(HdrFormat.DolbyVisionHdr10Plus, "DV HDR10Plus")]
|
||||||
[TestCase(HdrFormat.DolbyVisionHlg, "DV HLG")]
|
[TestCase(HdrFormat.DolbyVisionHlg, "DV HLG")]
|
||||||
[TestCase(HdrFormat.DolbyVisionSdr, "DV SDR")]
|
[TestCase(HdrFormat.DolbyVisionSdr, "DV SDR")]
|
||||||
public void should_format_video_dynamic_range_type(HdrFormat format, string expectedVideoDynamicRangeType)
|
public void should_format_video_dynamic_range_type(HdrFormat format, string expectedVideoDynamicRangeType)
|
||||||
|
@ -116,6 +116,8 @@ public void get_info_unicode()
|
|||||||
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.HdrDynamicMetadataSpmte2094", null, HdrFormat.Hdr10Plus)]
|
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.HdrDynamicMetadataSpmte2094", null, HdrFormat.Hdr10Plus)]
|
||||||
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", null, HdrFormat.DolbyVision)]
|
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", null, HdrFormat.DolbyVision)]
|
||||||
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", 1, HdrFormat.DolbyVisionHdr10)]
|
[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", 2, HdrFormat.DolbyVisionSdr)]
|
||||||
[TestCase(10, "bt2020", "smpte2084", "FFMpegCore.DoviConfigurationRecordSideData", 4, HdrFormat.DolbyVisionHlg)]
|
[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)
|
public void should_detect_hdr_correctly(int bitDepth, string colourPrimaries, string transferFunction, string sideDataTypes, int? doviConfigId, HdrFormat expected)
|
||||||
|
@ -11,6 +11,7 @@ public enum HdrFormat
|
|||||||
DolbyVision,
|
DolbyVision,
|
||||||
DolbyVisionHdr10,
|
DolbyVisionHdr10,
|
||||||
DolbyVisionSdr,
|
DolbyVisionSdr,
|
||||||
DolbyVisionHlg
|
DolbyVisionHlg,
|
||||||
|
DolbyVisionHdr10Plus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,6 +321,8 @@ public static string FormatVideoDynamicRangeType(MediaInfoModel mediaInfo)
|
|||||||
return "DV";
|
return "DV";
|
||||||
case HdrFormat.DolbyVisionHdr10:
|
case HdrFormat.DolbyVisionHdr10:
|
||||||
return "DV HDR10";
|
return "DV HDR10";
|
||||||
|
case HdrFormat.DolbyVisionHdr10Plus:
|
||||||
|
return "DV HDR10Plus";
|
||||||
case HdrFormat.DolbyVisionHlg:
|
case HdrFormat.DolbyVisionHlg:
|
||||||
return "DV HLG";
|
return "DV HLG";
|
||||||
case HdrFormat.DolbyVisionSdr:
|
case HdrFormat.DolbyVisionSdr:
|
||||||
|
@ -188,12 +188,14 @@ public static HdrFormat GetHdrFormat(int bitDepth, string colorPrimaries, string
|
|||||||
|
|
||||||
if (TryGetSideData<DoviConfigurationRecordSideData>(sideData, out var dovi))
|
if (TryGetSideData<DoviConfigurationRecordSideData>(sideData, out var dovi))
|
||||||
{
|
{
|
||||||
|
var hasHdr10Plus = TryGetSideData<HdrDynamicMetadataSpmte2094>(sideData, out _);
|
||||||
|
|
||||||
return dovi.DvBlSignalCompatibilityId switch
|
return dovi.DvBlSignalCompatibilityId switch
|
||||||
{
|
{
|
||||||
1 => HdrFormat.DolbyVisionHdr10,
|
1 => hasHdr10Plus ? HdrFormat.DolbyVisionHdr10Plus : HdrFormat.DolbyVisionHdr10,
|
||||||
2 => HdrFormat.DolbyVisionSdr,
|
2 => HdrFormat.DolbyVisionSdr,
|
||||||
4 => HdrFormat.DolbyVisionHlg,
|
4 => HdrFormat.DolbyVisionHlg,
|
||||||
6 => HdrFormat.DolbyVisionHdr10,
|
6 => hasHdr10Plus ? HdrFormat.DolbyVisionHdr10Plus : HdrFormat.DolbyVisionHdr10,
|
||||||
_ => HdrFormat.DolbyVision
|
_ => HdrFormat.DolbyVision
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user