mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 01:34:45 +03:00
Merge pull request #7964 from jellyfin/dovi-side-data
(cherry picked from commit 39d185c7b1)
Signed-off-by: Joshua Boniface <joshua@boniface.me>
This commit is contained in:
committed by
Joshua Boniface
parent
e61c80fed7
commit
fe32b5e333
@@ -72,6 +72,54 @@ namespace MediaBrowser.Model.Entities
|
||||
/// <value>The color primaries.</value>
|
||||
public string ColorPrimaries { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision version major.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision version major.</value>
|
||||
public int? DvVersionMajor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision version minor.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision version minor.</value>
|
||||
public int? DvVersionMinor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision profile.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision profile.</value>
|
||||
public int? DvProfile { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision level.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision level.</value>
|
||||
public int? DvLevel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision rpu present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision rpu present flag.</value>
|
||||
public int? RpuPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision el present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision el present flag.</value>
|
||||
public int? ElPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision bl present flag.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision bl present flag.</value>
|
||||
public int? BlPresentFlag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the Dolby Vision bl signal compatibility id.
|
||||
/// </summary>
|
||||
/// <value>The Dolby Vision bl signal compatibility id.</value>
|
||||
public int? DvBlSignalCompatibilityId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the comment.
|
||||
/// </summary>
|
||||
@@ -124,6 +172,47 @@ namespace MediaBrowser.Model.Entities
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the video dovi title.
|
||||
/// </summary>
|
||||
/// <value>The video dovi title.</value>
|
||||
public string VideoDoViTitle
|
||||
{
|
||||
get
|
||||
{
|
||||
var dvProfile = DvProfile;
|
||||
var rpuPresentFlag = RpuPresentFlag == 1;
|
||||
var blPresentFlag = BlPresentFlag == 1;
|
||||
var dvBlCompatId = DvBlSignalCompatibilityId;
|
||||
|
||||
if (rpuPresentFlag
|
||||
&& blPresentFlag
|
||||
&& (dvProfile == 4
|
||||
|| dvProfile == 5
|
||||
|| dvProfile == 7
|
||||
|| dvProfile == 8
|
||||
|| dvProfile == 9))
|
||||
{
|
||||
var title = "DV Profile " + dvProfile;
|
||||
|
||||
if (dvBlCompatId > 0)
|
||||
{
|
||||
title += "." + dvBlCompatId;
|
||||
}
|
||||
|
||||
return dvBlCompatId switch
|
||||
{
|
||||
1 => title + " (HDR10)",
|
||||
2 => title + " (SDR)",
|
||||
4 => title + " (HLG)",
|
||||
_ => title
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string LocalizedUndefined { get; set; }
|
||||
|
||||
public string LocalizedDefault { get; set; }
|
||||
@@ -582,11 +671,17 @@ namespace MediaBrowser.Model.Entities
|
||||
return ("HDR", "HLG");
|
||||
}
|
||||
|
||||
// For some Dolby Vision files, no color transfer is provided, so check the codec
|
||||
|
||||
var codecTag = CodecTag;
|
||||
var dvProfile = DvProfile;
|
||||
var rpuPresentFlag = RpuPresentFlag == 1;
|
||||
var blPresentFlag = BlPresentFlag == 1;
|
||||
var dvBlCompatId = DvBlSignalCompatibilityId;
|
||||
|
||||
if (string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|
||||
var isDoViHDRProfile = dvProfile == 5 || dvProfile == 7 || dvProfile == 8;
|
||||
var isDoViHDRFlag = rpuPresentFlag && blPresentFlag && (dvBlCompatId == 0 || dvBlCompatId == 1 || dvBlCompatId == 4);
|
||||
|
||||
if ((isDoViHDRProfile && isDoViHDRFlag)
|
||||
|| string.Equals(codecTag, "dovi", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codecTag, "dvh1", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codecTag, "dvhe", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(codecTag, "dav1", StringComparison.OrdinalIgnoreCase))
|
||||
|
||||
Reference in New Issue
Block a user