Add VideoRangeType to video conditions

This is used to distinguish whether the client supports specific VideoRangeType,
such as SDR, HDR10, HLG and DOVI. Usage is similar to Video Profile condition.
This commit is contained in:
nyanmisaka
2022-06-16 21:32:54 +08:00
parent fd4ffc6ba3
commit be72001ff9
14 changed files with 191 additions and 30 deletions

View File

@@ -1753,6 +1753,21 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
var requestedRangeTypes = state.GetRequestedRangeTypes(videoStream.Codec);
if (requestedProfiles.Length > 0)
{
if (string.IsNullOrEmpty(videoStream.VideoRangeType))
{
return false;
}
if (!string.IsNullOrEmpty(videoStream.VideoRangeType)
&& !requestedRangeTypes.Contains(videoStream.VideoRangeType, StringComparison.OrdinalIgnoreCase))
{
return false;
}
}
// Video width must fall within requested value
if (request.MaxWidth.HasValue
&& (!videoStream.Width.HasValue || videoStream.Width.Value > request.MaxWidth.Value))