aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities
diff options
context:
space:
mode:
authorJPVenson <github@jpb.email>2024-10-08 09:34:34 +0000
committerJPVenson <github@jpb.email>2024-10-08 09:34:34 +0000
commitd3a3d9fce3b891eb0be274a0cdc45a989e557652 (patch)
treebd232ef477c259f1fafa204016f6efd4dcb8691f /MediaBrowser.Model/Entities
parentee1bdf4e222125ed7382165fd7e09599ca4bd4aa (diff)
parentaaf20592bb0bbdf4f0f0d99fed091758e68ae850 (diff)
Merge remote-tracking branch 'jellyfinorigin/master' into feature/EFUserData
Diffstat (limited to 'MediaBrowser.Model/Entities')
-rw-r--r--MediaBrowser.Model/Entities/DeinterlaceMethod.cs19
-rw-r--r--MediaBrowser.Model/Entities/EncoderPreset.cs64
-rw-r--r--MediaBrowser.Model/Entities/HardwareAccelerationType.cs49
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs33
-rw-r--r--MediaBrowser.Model/Entities/TonemappingAlgorithm.cs49
-rw-r--r--MediaBrowser.Model/Entities/TonemappingMode.cs34
-rw-r--r--MediaBrowser.Model/Entities/TonemappingRange.cs24
7 files changed, 270 insertions, 2 deletions
diff --git a/MediaBrowser.Model/Entities/DeinterlaceMethod.cs b/MediaBrowser.Model/Entities/DeinterlaceMethod.cs
new file mode 100644
index 000000000..d05aac433
--- /dev/null
+++ b/MediaBrowser.Model/Entities/DeinterlaceMethod.cs
@@ -0,0 +1,19 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing deinterlace methods.
+/// </summary>
+public enum DeinterlaceMethod
+{
+ /// <summary>
+ /// YADIF.
+ /// </summary>
+ yadif = 0,
+
+ /// <summary>
+ /// BWDIF.
+ /// </summary>
+ bwdif = 1
+}
diff --git a/MediaBrowser.Model/Entities/EncoderPreset.cs b/MediaBrowser.Model/Entities/EncoderPreset.cs
new file mode 100644
index 000000000..74c071433
--- /dev/null
+++ b/MediaBrowser.Model/Entities/EncoderPreset.cs
@@ -0,0 +1,64 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing encoder presets.
+/// </summary>
+public enum EncoderPreset
+{
+ /// <summary>
+ /// Auto preset.
+ /// </summary>
+ auto = 0,
+
+ /// <summary>
+ /// Placebo preset.
+ /// </summary>
+ placebo = 1,
+
+ /// <summary>
+ /// Veryslow preset.
+ /// </summary>
+ veryslow = 2,
+
+ /// <summary>
+ /// Slower preset.
+ /// </summary>
+ slower = 3,
+
+ /// <summary>
+ /// Slow preset.
+ /// </summary>
+ slow = 4,
+
+ /// <summary>
+ /// Medium preset.
+ /// </summary>
+ medium = 5,
+
+ /// <summary>
+ /// Fast preset.
+ /// </summary>
+ fast = 6,
+
+ /// <summary>
+ /// Faster preset.
+ /// </summary>
+ faster = 7,
+
+ /// <summary>
+ /// Veryfast preset.
+ /// </summary>
+ veryfast = 8,
+
+ /// <summary>
+ /// Superfast preset.
+ /// </summary>
+ superfast = 9,
+
+ /// <summary>
+ /// Ultrafast preset.
+ /// </summary>
+ ultrafast = 10
+}
diff --git a/MediaBrowser.Model/Entities/HardwareAccelerationType.cs b/MediaBrowser.Model/Entities/HardwareAccelerationType.cs
new file mode 100644
index 000000000..198a2e00f
--- /dev/null
+++ b/MediaBrowser.Model/Entities/HardwareAccelerationType.cs
@@ -0,0 +1,49 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing hardware acceleration types.
+/// </summary>
+public enum HardwareAccelerationType
+{
+ /// <summary>
+ /// Software accelleration.
+ /// </summary>
+ none = 0,
+
+ /// <summary>
+ /// AMD AMF.
+ /// </summary>
+ amf = 1,
+
+ /// <summary>
+ /// Intel Quick Sync Video.
+ /// </summary>
+ qsv = 2,
+
+ /// <summary>
+ /// NVIDIA NVENC.
+ /// </summary>
+ nvenc = 3,
+
+ /// <summary>
+ /// Video4Linux2 V4L2M2M.
+ /// </summary>
+ v4l2m2m = 4,
+
+ /// <summary>
+ /// Video Acceleration API (VAAPI).
+ /// </summary>
+ vaapi = 5,
+
+ /// <summary>
+ /// Video ToolBox.
+ /// </summary>
+ videotoolbox = 6,
+
+ /// <summary>
+ /// Rockchip Media Process Platform (RKMPP).
+ /// </summary>
+ rkmpp = 7
+}
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index a0e8c39be..85c1f797b 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -200,7 +200,8 @@ namespace MediaBrowser.Model.Entities
|| dvProfile == 5
|| dvProfile == 7
|| dvProfile == 8
- || dvProfile == 9))
+ || dvProfile == 9
+ || dvProfile == 10))
{
var title = "Dolby Vision Profile " + dvProfile;
@@ -526,6 +527,23 @@ namespace MediaBrowser.Model.Entities
public float? RealFrameRate { get; set; }
/// <summary>
+ /// Gets the framerate used as reference.
+ /// Prefer AverageFrameRate, if that is null or an unrealistic value
+ /// then fallback to RealFrameRate.
+ /// </summary>
+ /// <value>The reference frame rate.</value>
+ public float? ReferenceFrameRate
+ {
+ get
+ {
+ // In some cases AverageFrameRate for videos will be read as 1000fps even if it is not.
+ // This is probably due to a library compatability issue.
+ // See https://github.com/jellyfin/jellyfin/pull/12603#discussion_r1748044018 for more info.
+ return AverageFrameRate < 1000 ? AverageFrameRate : RealFrameRate;
+ }
+ }
+
+ /// <summary>
/// Gets or sets the profile.
/// </summary>
/// <value>The profile.</value>
@@ -760,7 +778,7 @@ namespace MediaBrowser.Model.Entities
var blPresentFlag = BlPresentFlag == 1;
var dvBlCompatId = DvBlSignalCompatibilityId;
- var isDoViProfile = dvProfile == 5 || dvProfile == 7 || dvProfile == 8;
+ var isDoViProfile = dvProfile == 5 || dvProfile == 7 || dvProfile == 8 || dvProfile == 10;
var isDoViFlag = rpuPresentFlag && blPresentFlag && (dvBlCompatId == 0 || dvBlCompatId == 1 || dvBlCompatId == 4 || dvBlCompatId == 2 || dvBlCompatId == 6);
if ((isDoViProfile && isDoViFlag)
@@ -783,6 +801,17 @@ namespace MediaBrowser.Model.Entities
_ => (VideoRange.SDR, VideoRangeType.SDR)
},
7 => (VideoRange.HDR, VideoRangeType.HDR10),
+ 10 => dvBlCompatId switch
+ {
+ 0 => (VideoRange.HDR, VideoRangeType.DOVI),
+ 1 => (VideoRange.HDR, VideoRangeType.DOVIWithHDR10),
+ 2 => (VideoRange.SDR, VideoRangeType.DOVIWithSDR),
+ 4 => (VideoRange.HDR, VideoRangeType.DOVIWithHLG),
+ // While not in Dolby Spec, Profile 8 CCid 6 media are possible to create, and since CCid 6 stems from Bluray (Profile 7 originally) an HDR10 base layer is guaranteed to exist.
+ 6 => (VideoRange.HDR, VideoRangeType.DOVIWithHDR10),
+ // There is no other case to handle here as per Dolby Spec. Default case included for completeness and linting purposes
+ _ => (VideoRange.SDR, VideoRangeType.SDR)
+ },
_ => (VideoRange.SDR, VideoRangeType.SDR)
};
}
diff --git a/MediaBrowser.Model/Entities/TonemappingAlgorithm.cs b/MediaBrowser.Model/Entities/TonemappingAlgorithm.cs
new file mode 100644
index 000000000..488006e0b
--- /dev/null
+++ b/MediaBrowser.Model/Entities/TonemappingAlgorithm.cs
@@ -0,0 +1,49 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing tonemapping algorithms.
+/// </summary>
+public enum TonemappingAlgorithm
+{
+ /// <summary>
+ /// None.
+ /// </summary>
+ none = 0,
+
+ /// <summary>
+ /// Clip.
+ /// </summary>
+ clip = 1,
+
+ /// <summary>
+ /// Linear.
+ /// </summary>
+ linear = 2,
+
+ /// <summary>
+ /// Gamma.
+ /// </summary>
+ gamma = 3,
+
+ /// <summary>
+ /// Reinhard.
+ /// </summary>
+ reinhard = 4,
+
+ /// <summary>
+ /// Hable.
+ /// </summary>
+ hable = 5,
+
+ /// <summary>
+ /// Mobius.
+ /// </summary>
+ mobius = 6,
+
+ /// <summary>
+ /// BT2390.
+ /// </summary>
+ bt2390 = 7
+}
diff --git a/MediaBrowser.Model/Entities/TonemappingMode.cs b/MediaBrowser.Model/Entities/TonemappingMode.cs
new file mode 100644
index 000000000..e10a0b4ad
--- /dev/null
+++ b/MediaBrowser.Model/Entities/TonemappingMode.cs
@@ -0,0 +1,34 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing tonemapping modes.
+/// </summary>
+public enum TonemappingMode
+{
+ /// <summary>
+ /// Auto.
+ /// </summary>
+ auto = 0,
+
+ /// <summary>
+ /// Max.
+ /// </summary>
+ max = 1,
+
+ /// <summary>
+ /// RGB.
+ /// </summary>
+ rgb = 2,
+
+ /// <summary>
+ /// Lum.
+ /// </summary>
+ lum = 3,
+
+ /// <summary>
+ /// ITP.
+ /// </summary>
+ itp = 4
+}
diff --git a/MediaBrowser.Model/Entities/TonemappingRange.cs b/MediaBrowser.Model/Entities/TonemappingRange.cs
new file mode 100644
index 000000000..b1446b81c
--- /dev/null
+++ b/MediaBrowser.Model/Entities/TonemappingRange.cs
@@ -0,0 +1,24 @@
+#pragma warning disable SA1300 // Lowercase required for backwards compat.
+
+namespace MediaBrowser.Model.Entities;
+
+/// <summary>
+/// Enum containing tonemapping ranges.
+/// </summary>
+public enum TonemappingRange
+{
+ /// <summary>
+ /// Auto.
+ /// </summary>
+ auto = 0,
+
+ /// <summary>
+ /// TV.
+ /// </summary>
+ tv = 1,
+
+ /// <summary>
+ /// PC.
+ /// </summary>
+ pc = 2
+}