aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Model/Entities/MediaStream.cs
diff options
context:
space:
mode:
authorcrobibero <cody@robibe.ro>2020-07-31 10:05:27 -0600
committercrobibero <cody@robibe.ro>2020-07-31 10:05:27 -0600
commitf516cf9c4c273bf1de68c3a281bf6d27627a2de6 (patch)
treeef74634ff350ab183d980b2160297795e71cee61 /MediaBrowser.Model/Entities/MediaStream.cs
parentf5385e4735849cbb1552e69faa0116e5498b3688 (diff)
parentcb31aba5ddea9b961872946ee2d79fdac91de293 (diff)
Merge remote-tracking branch 'upstream/api-migration' into api-dlna
Diffstat (limited to 'MediaBrowser.Model/Entities/MediaStream.cs')
-rw-r--r--MediaBrowser.Model/Entities/MediaStream.cs76
1 files changed, 63 insertions, 13 deletions
diff --git a/MediaBrowser.Model/Entities/MediaStream.cs b/MediaBrowser.Model/Entities/MediaStream.cs
index e7e8d7cec..7a488005e 100644
--- a/MediaBrowser.Model/Entities/MediaStream.cs
+++ b/MediaBrowser.Model/Entities/MediaStream.cs
@@ -1,3 +1,4 @@
+#nullable disable
#pragma warning disable CS1591
using System;
@@ -12,7 +13,7 @@ using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Entities
{
/// <summary>
- /// Class MediaStream
+ /// Class MediaStream.
/// </summary>
public class MediaStream
{
@@ -34,8 +35,22 @@ namespace MediaBrowser.Model.Entities
/// <value>The language.</value>
public string Language { get; set; }
+ /// <summary>
+ /// Gets or sets the color transfer.
+ /// </summary>
+ /// <value>The color transfer.</value>
public string ColorTransfer { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color primaries.
+ /// </summary>
+ /// <value>The color primaries.</value>
public string ColorPrimaries { get; set; }
+
+ /// <summary>
+ /// Gets or sets the color space.
+ /// </summary>
+ /// <value>The color space.</value>
public string ColorSpace { get; set; }
/// <summary>
@@ -44,11 +59,28 @@ namespace MediaBrowser.Model.Entities
/// <value>The comment.</value>
public string Comment { get; set; }
+ /// <summary>
+ /// Gets or sets the time base.
+ /// </summary>
+ /// <value>The time base.</value>
public string TimeBase { get; set; }
+
+ /// <summary>
+ /// Gets or sets the codec time base.
+ /// </summary>
+ /// <value>The codec time base.</value>
public string CodecTimeBase { get; set; }
+ /// <summary>
+ /// Gets or sets the title.
+ /// </summary>
+ /// <value>The title.</value>
public string Title { get; set; }
+ /// <summary>
+ /// Gets or sets the video range.
+ /// </summary>
+ /// <value>The video range.</value>
public string VideoRange
{
get
@@ -60,7 +92,8 @@ namespace MediaBrowser.Model.Entities
var colorTransfer = ColorTransfer;
- if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase))
+ if (string.Equals(colorTransfer, "smpte2084", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(colorTransfer, "arib-std-b67", StringComparison.OrdinalIgnoreCase))
{
return "HDR";
}
@@ -70,7 +103,9 @@ namespace MediaBrowser.Model.Entities
}
public string localizedUndefined { get; set; }
+
public string localizedDefault { get; set; }
+
public string localizedForced { get; set; }
public string DisplayTitle
@@ -79,7 +114,7 @@ namespace MediaBrowser.Model.Entities
{
if (Type == MediaStreamType.Audio)
{
- //if (!string.IsNullOrEmpty(Title))
+ // if (!string.IsNullOrEmpty(Title))
//{
// return AddLanguageIfNeeded(Title);
//}
@@ -90,6 +125,7 @@ namespace MediaBrowser.Model.Entities
{
attributes.Add(StringHelper.FirstToUpper(Language));
}
+
if (!string.IsNullOrEmpty(Codec) && !string.Equals(Codec, "dca", StringComparison.OrdinalIgnoreCase))
{
attributes.Add(AudioCodec.GetFriendlyName(Codec));
@@ -107,6 +143,7 @@ namespace MediaBrowser.Model.Entities
{
attributes.Add(Channels.Value.ToString(CultureInfo.InvariantCulture) + " ch");
}
+
if (IsDefault)
{
attributes.Add("Default");
@@ -173,7 +210,6 @@ namespace MediaBrowser.Model.Entities
if (Type == MediaStreamType.Video)
{
-
}
return null;
@@ -193,42 +229,51 @@ namespace MediaBrowser.Model.Entities
{
return "4K";
}
+
if (width >= 2500)
{
if (i.IsInterlaced)
{
- return "1440I";
+ return "1440i";
}
- return "1440P";
+
+ return "1440p";
}
+
if (width >= 1900 || height >= 1000)
{
if (i.IsInterlaced)
{
- return "1080I";
+ return "1080i";
}
- return "1080P";
+
+ return "1080p";
}
+
if (width >= 1260 || height >= 700)
{
if (i.IsInterlaced)
{
- return "720I";
+ return "720i";
}
- return "720P";
+
+ return "720p";
}
+
if (width >= 700 || height >= 440)
{
if (i.IsInterlaced)
{
- return "480I";
+ return "480i";
}
- return "480P";
+
+ return "480p";
}
return "SD";
}
+
return null;
}
@@ -376,7 +421,10 @@ namespace MediaBrowser.Model.Entities
{
get
{
- if (Type != MediaStreamType.Subtitle) return false;
+ if (Type != MediaStreamType.Subtitle)
+ {
+ return false;
+ }
if (string.IsNullOrEmpty(Codec) && !IsExternal)
{
@@ -414,6 +462,7 @@ namespace MediaBrowser.Model.Entities
{
return false;
}
+
if (string.Equals(fromCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{
return false;
@@ -424,6 +473,7 @@ namespace MediaBrowser.Model.Entities
{
return false;
}
+
if (string.Equals(toCodec, "ssa", StringComparison.OrdinalIgnoreCase))
{
return false;