aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
diff options
context:
space:
mode:
authorJason Dove <jason@jasondove.me>2022-07-30 08:01:48 -0500
committerJason Dove <jason@jasondove.me>2022-07-30 08:01:48 -0500
commite52f1b52c1ca4d0b3dc5566c72c3731a22aa4907 (patch)
tree24d0d7a766275310931f6ddfc621a3a79738018f /MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
parentfc74c8eecf5bf0023ea59918260a4cdbe9ce787c (diff)
parentce1356b2f2009c246b47cbb27cd886a5025a1ba2 (diff)
Merge branch 'master' into api-key-items-without-user-id
Diffstat (limited to 'MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs')
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 0824590f2..491662861 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -366,6 +366,28 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
+ /// <summary>
+ /// Gets the target video range type.
+ /// </summary>
+ public string TargetVideoRangeType
+ {
+ get
+ {
+ if (BaseRequest.Static || EncodingHelper.IsCopyCodec(OutputVideoCodec))
+ {
+ return VideoStream?.VideoRangeType;
+ }
+
+ var requestedRangeType = GetRequestedRangeTypes(ActualOutputVideoCodec).FirstOrDefault();
+ if (!string.IsNullOrEmpty(requestedRangeType))
+ {
+ return requestedRangeType;
+ }
+
+ return null;
+ }
+ }
+
public string TargetVideoCodecTag
{
get
@@ -579,6 +601,26 @@ namespace MediaBrowser.Controller.MediaEncoding
return Array.Empty<string>();
}
+ public string[] GetRequestedRangeTypes(string codec)
+ {
+ if (!string.IsNullOrEmpty(BaseRequest.VideoRangeType))
+ {
+ return BaseRequest.VideoRangeType.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
+ }
+
+ if (!string.IsNullOrEmpty(codec))
+ {
+ var rangetype = BaseRequest.GetOption(codec, "rangetype");
+
+ if (!string.IsNullOrEmpty(rangetype))
+ {
+ return rangetype.Split(new[] { '|', ',' }, StringSplitOptions.RemoveEmptyEntries);
+ }
+ }
+
+ return Array.Empty<string>();
+ }
+
public string GetRequestedLevel(string codec)
{
if (!string.IsNullOrEmpty(BaseRequest.Level))