mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-04 14:58:36 +01:00
Merge branch 'master' into network-rewrite
This commit is contained in:
@@ -28,12 +28,16 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
public Series()
|
||||
{
|
||||
AirDays = Array.Empty<DayOfWeek>();
|
||||
SeasonNames = new Dictionary<int, string>();
|
||||
}
|
||||
|
||||
public DayOfWeek[] AirDays { get; set; }
|
||||
|
||||
public string AirTime { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Dictionary<int, string> SeasonNames { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public override bool SupportsAddingToPlaylist => true;
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private readonly Version _minFFmpegImplictHwaccel = new Version(6, 0);
|
||||
private readonly Version _minFFmpegHwaUnsafeOutput = new Version(6, 0);
|
||||
private readonly Version _minFFmpegOclCuTonemapMode = new Version(5, 1, 3);
|
||||
|
||||
private static readonly string[] _videoProfilesH264 = new[]
|
||||
{
|
||||
@@ -162,7 +163,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
private bool IsVaapiFullSupported()
|
||||
{
|
||||
return _mediaEncoder.SupportsHwaccel("vaapi")
|
||||
return _mediaEncoder.SupportsHwaccel("drm")
|
||||
&& _mediaEncoder.SupportsHwaccel("vaapi")
|
||||
&& _mediaEncoder.SupportsFilter("scale_vaapi")
|
||||
&& _mediaEncoder.SupportsFilter("deinterlace_vaapi")
|
||||
&& _mediaEncoder.SupportsFilter("tonemap_vaapi")
|
||||
@@ -712,28 +714,43 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
options);
|
||||
}
|
||||
|
||||
private string GetVaapiDeviceArgs(string renderNodePath, string driver, string kernelDriver, string alias)
|
||||
private string GetVaapiDeviceArgs(string renderNodePath, string driver, string kernelDriver, string srcDeviceAlias, string alias)
|
||||
{
|
||||
alias ??= VaapiAlias;
|
||||
renderNodePath = renderNodePath ?? "/dev/dri/renderD128";
|
||||
var options = string.IsNullOrEmpty(driver)
|
||||
? renderNodePath
|
||||
: ",driver=" + driver + (string.IsNullOrEmpty(kernelDriver) ? string.Empty : ",kernel_driver=" + kernelDriver);
|
||||
var driverOpts = string.IsNullOrEmpty(driver)
|
||||
? ":" + renderNodePath
|
||||
: ":,driver=" + driver + (string.IsNullOrEmpty(kernelDriver) ? string.Empty : ",kernel_driver=" + kernelDriver);
|
||||
var options = string.IsNullOrEmpty(srcDeviceAlias)
|
||||
? driverOpts
|
||||
: "@" + srcDeviceAlias;
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
" -init_hw_device vaapi={0}:{1}",
|
||||
" -init_hw_device vaapi={0}{1}",
|
||||
alias,
|
||||
options);
|
||||
}
|
||||
|
||||
private string GetDrmDeviceArgs(string renderNodePath, string alias)
|
||||
{
|
||||
alias ??= DrmAlias;
|
||||
renderNodePath = renderNodePath ?? "/dev/dri/renderD128";
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
" -init_hw_device drm={0}:{1}",
|
||||
alias,
|
||||
renderNodePath);
|
||||
}
|
||||
|
||||
private string GetQsvDeviceArgs(string alias)
|
||||
{
|
||||
var arg = " -init_hw_device qsv=" + (alias ?? QsvAlias);
|
||||
if (OperatingSystem.IsLinux())
|
||||
{
|
||||
// derive qsv from vaapi device
|
||||
return GetVaapiDeviceArgs(null, "iHD", "i915", VaapiAlias) + arg + "@" + VaapiAlias;
|
||||
return GetVaapiDeviceArgs(null, "iHD", "i915", null, VaapiAlias) + arg + "@" + VaapiAlias;
|
||||
}
|
||||
|
||||
if (OperatingSystem.IsWindows())
|
||||
@@ -754,9 +771,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
public string GetGraphicalSubCanvasSize(EncodingJobInfo state)
|
||||
{
|
||||
// DVBSUB and DVDSUB use the fixed canvas size 720x576
|
||||
if (state.SubtitleStream is not null
|
||||
&& state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode
|
||||
&& !state.SubtitleStream.IsTextSubtitleStream)
|
||||
&& !state.SubtitleStream.IsTextSubtitleStream
|
||||
&& !string.Equals(state.SubtitleStream.Codec, "DVBSUB", StringComparison.OrdinalIgnoreCase)
|
||||
&& !string.Equals(state.SubtitleStream.Codec, "DVDSUB", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var inW = state.VideoStream?.Width;
|
||||
var inH = state.VideoStream?.Height;
|
||||
@@ -824,21 +844,17 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
if (_mediaEncoder.IsVaapiDeviceInteliHD)
|
||||
{
|
||||
args.Append(GetVaapiDeviceArgs(null, "iHD", null, VaapiAlias));
|
||||
args.Append(GetVaapiDeviceArgs(null, "iHD", null, null, VaapiAlias));
|
||||
}
|
||||
else if (_mediaEncoder.IsVaapiDeviceInteli965)
|
||||
{
|
||||
// Only override i965 since it has lower priority than iHD in libva lookup.
|
||||
Environment.SetEnvironmentVariable("LIBVA_DRIVER_NAME", "i965");
|
||||
Environment.SetEnvironmentVariable("LIBVA_DRIVER_NAME_JELLYFIN", "i965");
|
||||
args.Append(GetVaapiDeviceArgs(null, "i965", null, VaapiAlias));
|
||||
}
|
||||
else
|
||||
{
|
||||
args.Append(GetVaapiDeviceArgs(options.VaapiDevice, null, null, VaapiAlias));
|
||||
args.Append(GetVaapiDeviceArgs(null, "i965", null, null, VaapiAlias));
|
||||
}
|
||||
|
||||
var filterDevArgs = GetFilterHwDeviceArgs(VaapiAlias);
|
||||
var filterDevArgs = string.Empty;
|
||||
var doOclTonemap = isHwTonemapAvailable && IsOpenclFullSupported();
|
||||
|
||||
if (_mediaEncoder.IsVaapiDeviceInteliHD || _mediaEncoder.IsVaapiDeviceInteli965)
|
||||
@@ -855,15 +871,24 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
&& _mediaEncoder.IsVaapiDeviceSupportVulkanFmtModifier
|
||||
&& Environment.OSVersion.Version >= _minKernelVersionAmdVkFmtModifier)
|
||||
{
|
||||
args.Append(GetDrmDeviceArgs(options.VaapiDevice, DrmAlias));
|
||||
args.Append(GetVaapiDeviceArgs(null, null, null, DrmAlias, VaapiAlias));
|
||||
args.Append(GetVulkanDeviceArgs(0, null, DrmAlias, VulkanAlias));
|
||||
|
||||
// libplacebo wants an explicitly set vulkan filter device.
|
||||
args.Append(GetVulkanDeviceArgs(0, null, VaapiAlias, VulkanAlias));
|
||||
filterDevArgs = GetFilterHwDeviceArgs(VulkanAlias);
|
||||
}
|
||||
else if (doOclTonemap)
|
||||
else
|
||||
{
|
||||
// ROCm/ROCr OpenCL runtime
|
||||
args.Append(GetOpenclDeviceArgs(0, "Advanced Micro Devices", null, OpenclAlias));
|
||||
filterDevArgs = GetFilterHwDeviceArgs(OpenclAlias);
|
||||
args.Append(GetVaapiDeviceArgs(options.VaapiDevice, null, null, null, VaapiAlias));
|
||||
filterDevArgs = GetFilterHwDeviceArgs(VaapiAlias);
|
||||
|
||||
if (doOclTonemap)
|
||||
{
|
||||
// ROCm/ROCr OpenCL runtime
|
||||
args.Append(GetOpenclDeviceArgs(0, "Advanced Micro Devices", null, OpenclAlias));
|
||||
filterDevArgs = GetFilterHwDeviceArgs(OpenclAlias);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (doOclTonemap)
|
||||
@@ -1549,11 +1574,11 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
param += " -preset p7";
|
||||
break;
|
||||
|
||||
case "slow":
|
||||
case "slower":
|
||||
param += " -preset p6";
|
||||
break;
|
||||
|
||||
case "slower":
|
||||
case "slow":
|
||||
param += " -preset p5";
|
||||
break;
|
||||
|
||||
@@ -1586,8 +1611,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
switch (encodingOptions.EncoderPreset)
|
||||
{
|
||||
case "veryslow":
|
||||
case "slow":
|
||||
case "slower":
|
||||
case "slow":
|
||||
param += " -quality quality";
|
||||
break;
|
||||
|
||||
@@ -2929,7 +2954,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public static string GetHwTonemapFilter(EncodingOptions options, string hwTonemapSuffix, string videoFormat)
|
||||
public string GetHwTonemapFilter(EncodingOptions options, string hwTonemapSuffix, string videoFormat)
|
||||
{
|
||||
if (string.IsNullOrEmpty(hwTonemapSuffix))
|
||||
{
|
||||
@@ -2941,7 +2966,8 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
|
||||
if (string.Equals(hwTonemapSuffix, "vaapi", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args = "tonemap_vaapi=format={0}:p=bt709:t=bt709:m=bt709,procamp_vaapi=b={1}:c={2}:extra_hw_frames=16";
|
||||
args = "procamp_vaapi=b={2}:c={3}," + args + ":extra_hw_frames=32";
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
args,
|
||||
@@ -2972,14 +2998,24 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
args = "tonemap_{0}=format={1}:p=bt709:t=bt709:m=bt709:tonemap={2}:peak={3}:desat={4}";
|
||||
|
||||
if (options.TonemappingParam != 0)
|
||||
if (string.Equals(options.TonemappingMode, "max", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(options.TonemappingMode, "rgb", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args += ":param={5}";
|
||||
if (_mediaEncoder.EncoderVersion >= _minFFmpegOclCuTonemapMode)
|
||||
{
|
||||
args += ":tonemap_mode={5}";
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.Equals(options.TonemappingRange, "auto", StringComparison.OrdinalIgnoreCase))
|
||||
if (options.TonemappingParam != 0)
|
||||
{
|
||||
args += ":range={6}";
|
||||
args += ":param={6}";
|
||||
}
|
||||
|
||||
if (string.Equals(options.TonemappingRange, "tv", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(options.TonemappingRange, "pc", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
args += ":range={7}";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2991,10 +3027,80 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
algorithm,
|
||||
options.TonemappingPeak,
|
||||
options.TonemappingDesat,
|
||||
options.TonemappingMode,
|
||||
options.TonemappingParam,
|
||||
options.TonemappingRange);
|
||||
}
|
||||
|
||||
public string GetLibplaceboFilter(
|
||||
EncodingOptions options,
|
||||
string videoFormat,
|
||||
bool doTonemap,
|
||||
int? videoWidth,
|
||||
int? videoHeight,
|
||||
int? requestedWidth,
|
||||
int? requestedHeight,
|
||||
int? requestedMaxWidth,
|
||||
int? requestedMaxHeight)
|
||||
{
|
||||
var (outWidth, outHeight) = GetFixedOutputSize(
|
||||
videoWidth,
|
||||
videoHeight,
|
||||
requestedWidth,
|
||||
requestedHeight,
|
||||
requestedMaxWidth,
|
||||
requestedMaxHeight);
|
||||
|
||||
var isFormatFixed = !string.IsNullOrEmpty(videoFormat);
|
||||
var isSizeFixed = !videoWidth.HasValue
|
||||
|| outWidth.Value != videoWidth.Value
|
||||
|| !videoHeight.HasValue
|
||||
|| outHeight.Value != videoHeight.Value;
|
||||
|
||||
var sizeArg = isSizeFixed ? (":w=" + outWidth.Value + ":h=" + outHeight.Value) : string.Empty;
|
||||
var formatArg = isFormatFixed ? (":format=" + videoFormat) : string.Empty;
|
||||
var tonemapArg = string.Empty;
|
||||
|
||||
if (doTonemap)
|
||||
{
|
||||
var algorithm = options.TonemappingAlgorithm;
|
||||
var mode = options.TonemappingMode;
|
||||
var range = options.TonemappingRange;
|
||||
|
||||
if (string.Equals(algorithm, "bt2390", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
algorithm = "bt.2390";
|
||||
}
|
||||
else if (string.Equals(algorithm, "none", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
algorithm = "clip";
|
||||
}
|
||||
|
||||
tonemapArg = ":tonemapping=" + algorithm;
|
||||
|
||||
if (string.Equals(mode, "max", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(mode, "rgb", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
tonemapArg += ":tonemapping_mode=" + mode;
|
||||
}
|
||||
|
||||
tonemapArg += ":peak_detect=0:color_primaries=bt709:color_trc=bt709:colorspace=bt709";
|
||||
|
||||
if (string.Equals(range, "tv", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(range, "pc", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
tonemapArg += ":range=" + range;
|
||||
}
|
||||
}
|
||||
|
||||
return string.Format(
|
||||
CultureInfo.InvariantCulture,
|
||||
"libplacebo=upscaler=none:downscaler=none{0}{1}{2}",
|
||||
sizeArg,
|
||||
formatArg,
|
||||
tonemapArg);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parameter of software filter chain.
|
||||
/// </summary>
|
||||
@@ -4224,7 +4330,6 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
var isVaapiEncoder = vidEncoder.Contains("vaapi", StringComparison.OrdinalIgnoreCase);
|
||||
var isSwDecoder = string.IsNullOrEmpty(vidDecoder);
|
||||
var isSwEncoder = !isVaapiEncoder;
|
||||
var isVaInVaOut = isVaapiDecoder && isVaapiEncoder;
|
||||
|
||||
var doDeintH264 = state.DeInterlace("h264", true) || state.DeInterlace("avc", true);
|
||||
var doDeintHevc = state.DeInterlace("h265", true) || state.DeInterlace("hevc", true);
|
||||
@@ -4253,99 +4358,81 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
mainFilters.Add(swDeintFilter);
|
||||
}
|
||||
|
||||
var outFormat = doVkTonemap ? "yuv420p10le" : "nv12";
|
||||
var swScaleFilter = GetSwScaleFilter(state, options, vidEncoder, inW, inH, threeDFormat, reqW, reqH, reqMaxW, reqMaxH);
|
||||
// sw scale
|
||||
mainFilters.Add(swScaleFilter);
|
||||
mainFilters.Add("format=" + outFormat);
|
||||
|
||||
// keep video at memory except vk tonemap,
|
||||
// since the overhead caused by hwupload >>> using sw filter.
|
||||
// sw => hw
|
||||
if (doVkTonemap)
|
||||
if (doVkTonemap || hasSubs)
|
||||
{
|
||||
mainFilters.Add("hwupload=derive_device=vaapi");
|
||||
mainFilters.Add("format=vaapi");
|
||||
mainFilters.Add("hwmap=derive_device=vulkan");
|
||||
// sw => hw
|
||||
mainFilters.Add("hwupload=derive_device=vulkan");
|
||||
mainFilters.Add("format=vulkan");
|
||||
}
|
||||
else
|
||||
{
|
||||
// sw scale
|
||||
var swScaleFilter = GetSwScaleFilter(state, options, vidEncoder, inW, inH, threeDFormat, reqW, reqH, reqMaxW, reqMaxH);
|
||||
mainFilters.Add(swScaleFilter);
|
||||
mainFilters.Add("format=nv12");
|
||||
}
|
||||
}
|
||||
else if (isVaapiDecoder)
|
||||
{
|
||||
// INPUT vaapi surface(vram)
|
||||
if (doVkTonemap || hasSubs)
|
||||
{
|
||||
// map from vaapi to vulkan/drm via interop (Vega/gfx9+).
|
||||
mainFilters.Add("hwmap=derive_device=vulkan");
|
||||
mainFilters.Add("format=vulkan");
|
||||
}
|
||||
else
|
||||
{
|
||||
// hw deint
|
||||
if (doDeintH2645)
|
||||
{
|
||||
var deintFilter = GetHwDeinterlaceFilter(state, options, "vaapi");
|
||||
mainFilters.Add(deintFilter);
|
||||
}
|
||||
|
||||
// hw scale
|
||||
var hwScaleFilter = GetHwScaleFilter("vaapi", "nv12", inW, inH, reqW, reqH, reqMaxW, reqMaxH);
|
||||
mainFilters.Add(hwScaleFilter);
|
||||
}
|
||||
}
|
||||
|
||||
// vk libplacebo
|
||||
if (doVkTonemap || hasSubs)
|
||||
{
|
||||
var libplaceboFilter = GetLibplaceboFilter(options, "bgra", doVkTonemap, inW, inH, reqW, reqH, reqMaxW, reqMaxH);
|
||||
mainFilters.Add(libplaceboFilter);
|
||||
}
|
||||
|
||||
if (doVkTonemap && !hasSubs)
|
||||
{
|
||||
// OUTPUT vaapi(nv12) surface(vram)
|
||||
// map from vulkan/drm to vaapi via interop (Vega/gfx9+).
|
||||
mainFilters.Add("hwmap=derive_device=drm");
|
||||
mainFilters.Add("format=drm_prime");
|
||||
mainFilters.Add("hwmap=derive_device=vaapi");
|
||||
mainFilters.Add("format=vaapi");
|
||||
|
||||
// clear the surf->meta_offset and output nv12
|
||||
mainFilters.Add("scale_vaapi=format=nv12");
|
||||
|
||||
// hw deint
|
||||
if (doDeintH2645)
|
||||
{
|
||||
var deintFilter = GetHwDeinterlaceFilter(state, options, "vaapi");
|
||||
mainFilters.Add(deintFilter);
|
||||
}
|
||||
|
||||
var outFormat = doVkTonemap ? string.Empty : (hasSubs && isVaInVaOut ? "bgra" : "nv12");
|
||||
var hwScaleFilter = GetHwScaleFilter("vaapi", outFormat, inW, inH, reqW, reqH, reqMaxW, reqMaxH);
|
||||
|
||||
// allocate extra pool sizes for overlay_vulkan
|
||||
if (!string.IsNullOrEmpty(hwScaleFilter) && isVaInVaOut && hasSubs)
|
||||
{
|
||||
hwScaleFilter += ":extra_hw_frames=32";
|
||||
}
|
||||
|
||||
// hw scale
|
||||
mainFilters.Add(hwScaleFilter);
|
||||
}
|
||||
|
||||
if ((isVaapiDecoder && doVkTonemap) || (isVaInVaOut && (doVkTonemap || hasSubs)))
|
||||
if (!hasSubs)
|
||||
{
|
||||
// map from vaapi to vulkan via vaapi-vulkan interop (Vega/gfx9+).
|
||||
mainFilters.Add("hwmap=derive_device=vulkan");
|
||||
mainFilters.Add("format=vulkan");
|
||||
}
|
||||
|
||||
// vk tonemap
|
||||
if (doVkTonemap)
|
||||
{
|
||||
var outFormat = isVaInVaOut && hasSubs ? "bgra" : "nv12";
|
||||
var tonemapFilter = GetHwTonemapFilter(options, "vulkan", outFormat);
|
||||
mainFilters.Add(tonemapFilter);
|
||||
}
|
||||
|
||||
if (doVkTonemap && isVaInVaOut && !hasSubs)
|
||||
{
|
||||
// OUTPUT vaapi(nv12/bgra) surface(vram)
|
||||
// reverse-mapping via vaapi-vulkan interop.
|
||||
mainFilters.Add("hwmap=derive_device=vaapi:reverse=1");
|
||||
mainFilters.Add("format=vaapi");
|
||||
}
|
||||
|
||||
var memoryOutput = false;
|
||||
var isUploadForVkTonemap = isSwDecoder && doVkTonemap;
|
||||
if ((isVaapiDecoder && isSwEncoder) || isUploadForVkTonemap)
|
||||
{
|
||||
memoryOutput = true;
|
||||
|
||||
// OUTPUT nv12 surface(memory)
|
||||
mainFilters.Add("hwdownload");
|
||||
mainFilters.Add("format=nv12");
|
||||
}
|
||||
|
||||
// OUTPUT nv12 surface(memory)
|
||||
if (isSwDecoder && isVaapiEncoder)
|
||||
{
|
||||
memoryOutput = true;
|
||||
}
|
||||
|
||||
if (memoryOutput)
|
||||
{
|
||||
// text subtitles
|
||||
if (hasTextSubs)
|
||||
if (isSwEncoder && (doVkTonemap || isVaapiDecoder))
|
||||
{
|
||||
var textSubtitlesFilter = GetTextSubtitlesFilter(state, false, false);
|
||||
mainFilters.Add(textSubtitlesFilter);
|
||||
mainFilters.Add("hwdownload");
|
||||
mainFilters.Add("format=nv12");
|
||||
}
|
||||
}
|
||||
|
||||
if (memoryOutput && isVaapiEncoder)
|
||||
{
|
||||
if (!hasGraphicalSubs)
|
||||
if (isSwDecoder && isVaapiEncoder && !doVkTonemap)
|
||||
{
|
||||
mainFilters.Add("hwupload_vaapi");
|
||||
}
|
||||
@@ -4354,55 +4441,53 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
/* Make sub and overlay filters for subtitle stream */
|
||||
var subFilters = new List<string>();
|
||||
var overlayFilters = new List<string>();
|
||||
if (isVaInVaOut)
|
||||
{
|
||||
if (hasSubs)
|
||||
{
|
||||
if (hasGraphicalSubs)
|
||||
{
|
||||
// scale=s=1280x720,format=bgra,hwupload
|
||||
var subSwScaleFilter = GetCustomSwScaleFilter(inW, inH, reqW, reqH, reqMaxW, reqMaxH);
|
||||
subFilters.Add(subSwScaleFilter);
|
||||
subFilters.Add("format=bgra");
|
||||
}
|
||||
else if (hasTextSubs)
|
||||
{
|
||||
var alphaSrcFilter = GetAlphaSrcFilter(state, inW, inH, reqW, reqH, reqMaxW, reqMaxH, hasAssSubs ? 10 : 5);
|
||||
var subTextSubtitlesFilter = GetTextSubtitlesFilter(state, true, true);
|
||||
subFilters.Add(alphaSrcFilter);
|
||||
subFilters.Add("format=bgra");
|
||||
subFilters.Add(subTextSubtitlesFilter);
|
||||
}
|
||||
|
||||
// prefer vaapi hwupload to vulkan hwupload,
|
||||
// Mesa RADV does not support a dedicated transfer queue.
|
||||
subFilters.Add("hwupload=derive_device=vaapi");
|
||||
subFilters.Add("format=vaapi");
|
||||
subFilters.Add("hwmap=derive_device=vulkan");
|
||||
subFilters.Add("format=vulkan");
|
||||
|
||||
overlayFilters.Add("overlay_vulkan=eof_action=endall:shortest=1:repeatlast=0");
|
||||
|
||||
// TODO: figure out why libplacebo can sync without vaSyncSurface VPP support in radeonsi.
|
||||
overlayFilters.Add("libplacebo=format=nv12:apply_filmgrain=0:apply_dolbyvision=0:upscaler=none:downscaler=none:dithering=none");
|
||||
|
||||
// OUTPUT vaapi(nv12/bgra) surface(vram)
|
||||
// reverse-mapping via vaapi-vulkan interop.
|
||||
overlayFilters.Add("hwmap=derive_device=vaapi:reverse=1");
|
||||
overlayFilters.Add("format=vaapi");
|
||||
}
|
||||
}
|
||||
else if (memoryOutput)
|
||||
if (hasSubs)
|
||||
{
|
||||
if (hasGraphicalSubs)
|
||||
{
|
||||
// scale=s=1280x720,format=bgra,hwupload
|
||||
var subSwScaleFilter = GetCustomSwScaleFilter(inW, inH, reqW, reqH, reqMaxW, reqMaxH);
|
||||
subFilters.Add(subSwScaleFilter);
|
||||
overlayFilters.Add("overlay=eof_action=pass:shortest=1:repeatlast=0");
|
||||
subFilters.Add("format=bgra");
|
||||
}
|
||||
else if (hasTextSubs)
|
||||
{
|
||||
var alphaSrcFilter = GetAlphaSrcFilter(state, inW, inH, reqW, reqH, reqMaxW, reqMaxH, hasAssSubs ? 10 : 5);
|
||||
var subTextSubtitlesFilter = GetTextSubtitlesFilter(state, true, true);
|
||||
subFilters.Add(alphaSrcFilter);
|
||||
subFilters.Add("format=bgra");
|
||||
subFilters.Add(subTextSubtitlesFilter);
|
||||
}
|
||||
|
||||
if (isVaapiEncoder)
|
||||
subFilters.Add("hwupload=derive_device=vulkan");
|
||||
subFilters.Add("format=vulkan");
|
||||
|
||||
overlayFilters.Add("overlay_vulkan=eof_action=endall:shortest=1:repeatlast=0");
|
||||
|
||||
if (isSwEncoder)
|
||||
{
|
||||
// OUTPUT nv12 surface(memory)
|
||||
overlayFilters.Add("scale_vulkan=format=nv12");
|
||||
overlayFilters.Add("hwdownload");
|
||||
overlayFilters.Add("format=nv12");
|
||||
}
|
||||
else if (isVaapiEncoder)
|
||||
{
|
||||
// OUTPUT vaapi(nv12) surface(vram)
|
||||
// map from vulkan/drm to vaapi via interop (Vega/gfx9+).
|
||||
overlayFilters.Add("hwmap=derive_device=drm");
|
||||
overlayFilters.Add("format=drm_prime");
|
||||
overlayFilters.Add("hwmap=derive_device=vaapi");
|
||||
overlayFilters.Add("format=vaapi");
|
||||
|
||||
// clear the surf->meta_offset and output nv12
|
||||
overlayFilters.Add("scale_vaapi=format=nv12");
|
||||
|
||||
// hw deint
|
||||
if (doDeintH2645)
|
||||
{
|
||||
overlayFilters.Add("hwupload_vaapi");
|
||||
var deintFilter = GetHwDeinterlaceFilter(state, options, "vaapi");
|
||||
overlayFilters.Add(deintFilter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
28
MediaBrowser.Controller/Net/WebSocketMessage.cs
Normal file
28
MediaBrowser.Controller/Net/WebSocketMessage.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Text.Json.Serialization;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net;
|
||||
|
||||
/// <summary>
|
||||
/// Websocket message without data.
|
||||
/// </summary>
|
||||
public abstract class WebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the type of the message.
|
||||
/// TODO make this abstract and get only.
|
||||
/// </summary>
|
||||
public virtual SessionMessageType MessageType { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the message id.
|
||||
/// </summary>
|
||||
public Guid MessageId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the server id.
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public string? ServerId { get; set; }
|
||||
}
|
||||
33
MediaBrowser.Controller/Net/WebSocketMessageOfT.cs
Normal file
33
MediaBrowser.Controller/Net/WebSocketMessageOfT.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
#pragma warning disable SA1649 // File name must equal class name.
|
||||
|
||||
namespace MediaBrowser.Controller.Net;
|
||||
|
||||
/// <summary>
|
||||
/// Class WebSocketMessage.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the data.</typeparam>
|
||||
// TODO make this abstract, remove empty ctor.
|
||||
public class WebSocketMessage<T> : WebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
public WebSocketMessage()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="WebSocketMessage{T}"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The data to send.</param>
|
||||
protected WebSocketMessage(T data)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data.
|
||||
/// </summary>
|
||||
// TODO make this set only.
|
||||
public T? Data { get; set; }
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing that the websocket message is inbound.
|
||||
/// </summary>
|
||||
public interface IInboundWebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma warning disable CA1040
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing that the websocket message is outbound.
|
||||
/// </summary>
|
||||
public interface IOutboundWebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry start message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStartMessage : WebSocketMessage<IReadOnlyCollection<ActivityLogEntry>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of activity log entries.</param>
|
||||
public ActivityLogEntryStartMessage(IReadOnlyCollection<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStart;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log entry stop message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryStopMessage : WebSocketMessage<IReadOnlyCollection<ActivityLogEntry>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of activity log entries.</param>
|
||||
public ActivityLogEntryStopMessage(IReadOnlyCollection<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntryStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntryStop;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info start message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStartMessage : WebSocketMessage<IReadOnlyCollection<TaskInfo>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of task info.</param>
|
||||
public ScheduledTasksInfoStartMessage(IReadOnlyCollection<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStart;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info stop message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoStopMessage : WebSocketMessage<IReadOnlyCollection<TaskInfo>>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Collection of task info.</param>
|
||||
public ScheduledTasksInfoStopMessage(IReadOnlyCollection<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfoStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfoStop;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions start message.
|
||||
/// </summary>
|
||||
public class SessionsStartMessage : WebSocketMessage<SessionInfo>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsStartMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsStartMessage(SessionInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStart)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStart;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Inbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions stop message.
|
||||
/// </summary>
|
||||
public class SessionsStopMessage : WebSocketMessage<SessionInfo>, IInboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsStopMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsStopMessage(SessionInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SessionsStop)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SessionsStop;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Class representing the list of outbound websocket message types.
|
||||
/// Only used in openapi generation.
|
||||
/// </summary>
|
||||
public class InboundWebSocketMessage : WebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Activity;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Activity log created message.
|
||||
/// </summary>
|
||||
public class ActivityLogEntryMessage : WebSocketMessage<IReadOnlyList<ActivityLogEntry>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ActivityLogEntryMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">List of activity log entries.</param>
|
||||
public ActivityLogEntryMessage(IReadOnlyList<ActivityLogEntry> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ActivityLogEntry)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ActivityLogEntry;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Force keep alive websocket messages.
|
||||
/// </summary>
|
||||
public class ForceKeepAliveMessage : WebSocketMessage<int>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ForceKeepAliveMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timeout in seconds.</param>
|
||||
public ForceKeepAliveMessage(int data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ForceKeepAlive)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ForceKeepAlive;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// General command websocket message.
|
||||
/// </summary>
|
||||
public class GeneralCommandMessage : WebSocketMessage<GeneralCommand>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GeneralCommandMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The general command.</param>
|
||||
public GeneralCommandMessage(GeneralCommand data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.GeneralCommand)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.GeneralCommand;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Library changed message.
|
||||
/// </summary>
|
||||
public class LibraryChangedMessage : WebSocketMessage<LibraryUpdateInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LibraryChangedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The library update info.</param>
|
||||
public LibraryChangedMessage(LibraryUpdateInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.LibraryChanged)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.LibraryChanged;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Play command websocket message.
|
||||
/// </summary>
|
||||
public class PlayMessage : WebSocketMessage<PlayRequest>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The play request.</param>
|
||||
public PlayMessage(PlayRequest data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Play)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Play;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Playstate message.
|
||||
/// </summary>
|
||||
public class PlaystateMessage : WebSocketMessage<PlaystateRequest>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlaystateMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Playstate request data.</param>
|
||||
public PlaystateMessage(PlaystateRequest data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Playstate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Playstate;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation cancelled message.
|
||||
/// </summary>
|
||||
public class PluginInstallationCancelledMessage : WebSocketMessage<InstallationInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationCancelledMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationCancelled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation completed message.
|
||||
/// </summary>
|
||||
public class PluginInstallationCompletedMessage : WebSocketMessage<InstallationInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationCompletedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationCompletedMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationCompleted)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationCompleted;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin installation failed message.
|
||||
/// </summary>
|
||||
public class PluginInstallationFailedMessage : WebSocketMessage<InstallationInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallationFailedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallationFailedMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstallationFailed)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstallationFailed;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Updates;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Package installing message.
|
||||
/// </summary>
|
||||
public class PluginInstallingMessage : WebSocketMessage<InstallationInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginInstallingMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Installation info.</param>
|
||||
public PluginInstallingMessage(InstallationInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageInstalling)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageInstalling;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Plugins;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Plugin uninstalled message.
|
||||
/// </summary>
|
||||
public class PluginUninstalledMessage : WebSocketMessage<PluginInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PluginUninstalledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Plugin info.</param>
|
||||
public PluginUninstalledMessage(PluginInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.PackageUninstalled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.PackageUninstalled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Refresh progress message.
|
||||
/// </summary>
|
||||
public class RefreshProgressMessage : WebSocketMessage<Dictionary<string, string>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="RefreshProgressMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Refresh progress data.</param>
|
||||
public RefreshProgressMessage(Dictionary<string, string> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.RefreshProgress)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.RefreshProgress;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Restart required.
|
||||
/// </summary>
|
||||
public class RestartRequiredMessage : WebSocketMessage, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.RestartRequired)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.RestartRequired;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled task ended message.
|
||||
/// </summary>
|
||||
public class ScheduledTaskEndedMessage : WebSocketMessage<TaskResult>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTaskEndedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Task result.</param>
|
||||
public ScheduledTaskEndedMessage(TaskResult data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTaskEnded)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTaskEnded;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Scheduled tasks info message.
|
||||
/// </summary>
|
||||
public class ScheduledTasksInfoMessage : WebSocketMessage<IReadOnlyList<TaskInfo>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ScheduledTasksInfoMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">List of task infos.</param>
|
||||
public ScheduledTasksInfoMessage(IReadOnlyList<TaskInfo> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ScheduledTasksInfo)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ScheduledTasksInfo;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Series timer cancelled message.
|
||||
/// </summary>
|
||||
public class SeriesTimerCancelledMessage : WebSocketMessage<TimerEventInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesTimerCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The timer event info.</param>
|
||||
public SeriesTimerCancelledMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SeriesTimerCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SeriesTimerCancelled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Series timer created message.
|
||||
/// </summary>
|
||||
public class SeriesTimerCreatedMessage : WebSocketMessage<TimerEventInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SeriesTimerCreatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">timer event info.</param>
|
||||
public SeriesTimerCreatedMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SeriesTimerCreated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SeriesTimerCreated;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Server restarting down message.
|
||||
/// </summary>
|
||||
public class ServerRestartingMessage : WebSocketMessage, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ServerRestarting)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ServerRestarting;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Server shutting down message.
|
||||
/// </summary>
|
||||
public class ServerShuttingDownMessage : WebSocketMessage, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.ServerShuttingDown)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.ServerShuttingDown;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.Session;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sessions message.
|
||||
/// </summary>
|
||||
public class SessionsMessage : WebSocketMessage<SessionInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SessionsMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Session info.</param>
|
||||
public SessionsMessage(SessionInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.Sessions)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.Sessions;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play command.
|
||||
/// </summary>
|
||||
public class SyncPlayCommandMessage : WebSocketMessage<SendCommand>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayCommandMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The send command.</param>
|
||||
public SyncPlayCommandMessage(SendCommand data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayCommand)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayCommand;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Untyped sync play command.
|
||||
/// </summary>
|
||||
public class SyncPlayGroupUpdateCommandMessage : WebSocketMessage<GroupUpdate>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupUpdateCommandMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The send command.</param>
|
||||
public SyncPlayGroupUpdateCommandMessage(GroupUpdate data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayGroupUpdate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayGroupUpdate;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play group update command with group info.
|
||||
/// GroupUpdateTypes: GroupJoined.
|
||||
/// </summary>
|
||||
public class SyncPlayGroupUpdateCommandOfGroupInfoMessage : WebSocketMessage<GroupUpdate<GroupInfoDto>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupUpdateCommandOfGroupInfoMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The group info.</param>
|
||||
public SyncPlayGroupUpdateCommandOfGroupInfoMessage(GroupUpdate<GroupInfoDto> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayGroupUpdate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayGroupUpdate;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play group update command with group state update.
|
||||
/// GroupUpdateTypes: StateUpdate.
|
||||
/// </summary>
|
||||
public class SyncPlayGroupUpdateCommandOfGroupStateUpdateMessage : WebSocketMessage<GroupUpdate<GroupStateUpdate>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupUpdateCommandOfGroupStateUpdateMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The group info.</param>
|
||||
public SyncPlayGroupUpdateCommandOfGroupStateUpdateMessage(GroupUpdate<GroupStateUpdate> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayGroupUpdate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayGroupUpdate;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play group update command with play queue update.
|
||||
/// GroupUpdateTypes: PlayQueue.
|
||||
/// </summary>
|
||||
public class SyncPlayGroupUpdateCommandOfPlayQueueUpdateMessage : WebSocketMessage<GroupUpdate<PlayQueueUpdate>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupUpdateCommandOfPlayQueueUpdateMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The play queue update.</param>
|
||||
public SyncPlayGroupUpdateCommandOfPlayQueueUpdateMessage(GroupUpdate<PlayQueueUpdate> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayGroupUpdate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayGroupUpdate;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
using MediaBrowser.Model.SyncPlay;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Sync play group update command with string.
|
||||
/// GroupUpdateTypes: GroupDoesNotExist (error), LibraryAccessDenied (error), NotInGroup (error), GroupLeft (groupId), UserJoined (username), UserLeft (username).
|
||||
/// </summary>
|
||||
public class SyncPlayGroupUpdateCommandOfStringMessage : WebSocketMessage<GroupUpdate<string>>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="SyncPlayGroupUpdateCommandOfStringMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The send command.</param>
|
||||
public SyncPlayGroupUpdateCommandOfStringMessage(GroupUpdate<string> data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.SyncPlayGroupUpdate)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.SyncPlayGroupUpdate;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Timer cancelled message.
|
||||
/// </summary>
|
||||
public class TimerCancelledMessage : WebSocketMessage<TimerEventInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TimerCancelledMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Timer event info.</param>
|
||||
public TimerCancelledMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.TimerCancelled)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.TimerCancelled;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// Timer created message.
|
||||
/// </summary>
|
||||
public class TimerCreatedMessage : WebSocketMessage<TimerEventInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TimerCreatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Timer event info.</param>
|
||||
public TimerCreatedMessage(TimerEventInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.TimerCreated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.TimerCreated;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User data changed message.
|
||||
/// </summary>
|
||||
public class UserDataChangedMessage : WebSocketMessage<UserDataChangeInfo>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserDataChangedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The data change info.</param>
|
||||
public UserDataChangedMessage(UserDataChangeInfo data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserDataChanged)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserDataChanged;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User deleted message.
|
||||
/// </summary>
|
||||
public class UserDeletedMessage : WebSocketMessage<Guid>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserDeletedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The user id.</param>
|
||||
public UserDeletedMessage(Guid data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserDeleted)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserDeleted;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Outbound;
|
||||
|
||||
/// <summary>
|
||||
/// User updated message.
|
||||
/// </summary>
|
||||
public class UserUpdatedMessage : WebSocketMessage<UserDto>, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UserUpdatedMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The user dto.</param>
|
||||
public UserUpdatedMessage(UserDto data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.UserUpdated)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.UserUpdated;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages;
|
||||
|
||||
/// <summary>
|
||||
/// Class representing the list of outbound websocket message types.
|
||||
/// Only used in openapi generation.
|
||||
/// </summary>
|
||||
public class OutboundWebSocketMessage : WebSocketMessage
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.ComponentModel;
|
||||
using MediaBrowser.Model.Session;
|
||||
|
||||
namespace MediaBrowser.Controller.Net.WebSocketMessages.Shared;
|
||||
|
||||
/// <summary>
|
||||
/// Keep alive websocket messages.
|
||||
/// </summary>
|
||||
public class KeepAliveMessage : WebSocketMessage<int>, IInboundWebSocketMessage, IOutboundWebSocketMessage
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="KeepAliveMessage"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">The seconds to keep alive for.</param>
|
||||
public KeepAliveMessage(int data)
|
||||
: base(data)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
[DefaultValue(SessionMessageType.KeepAlive)]
|
||||
public override SessionMessageType MessageType => SessionMessageType.KeepAlive;
|
||||
}
|
||||
@@ -23,13 +23,13 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// The sorted playlist.
|
||||
/// </summary>
|
||||
/// <value>The sorted playlist, or play queue of the group.</value>
|
||||
private List<QueueItem> _sortedPlaylist = new List<QueueItem>();
|
||||
private List<SyncPlayQueueItem> _sortedPlaylist = new List<SyncPlayQueueItem>();
|
||||
|
||||
/// <summary>
|
||||
/// The shuffled playlist.
|
||||
/// </summary>
|
||||
/// <value>The shuffled playlist, or play queue of the group.</value>
|
||||
private List<QueueItem> _shuffledPlaylist = new List<QueueItem>();
|
||||
private List<SyncPlayQueueItem> _shuffledPlaylist = new List<SyncPlayQueueItem>();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PlayQueueManager" /> class.
|
||||
@@ -76,7 +76,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// Gets the current playlist considering the shuffle mode.
|
||||
/// </summary>
|
||||
/// <returns>The playlist.</returns>
|
||||
public IReadOnlyList<QueueItem> GetPlaylist()
|
||||
public IReadOnlyList<SyncPlayQueueItem> GetPlaylist()
|
||||
{
|
||||
return GetPlaylistInternal();
|
||||
}
|
||||
@@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
_sortedPlaylist = CreateQueueItemsFromArray(items);
|
||||
if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
|
||||
{
|
||||
_shuffledPlaylist = new List<QueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist = new List<SyncPlayQueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist.Shuffle();
|
||||
}
|
||||
|
||||
@@ -125,14 +125,14 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
{
|
||||
if (PlayingItemIndex == NoPlayingItemIndex)
|
||||
{
|
||||
_shuffledPlaylist = new List<QueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist = new List<SyncPlayQueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist.Shuffle();
|
||||
}
|
||||
else if (ShuffleMode.Equals(GroupShuffleMode.Sorted))
|
||||
{
|
||||
// First time shuffle.
|
||||
var playingItem = _sortedPlaylist[PlayingItemIndex];
|
||||
_shuffledPlaylist = new List<QueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist = new List<SyncPlayQueueItem>(_sortedPlaylist);
|
||||
_shuffledPlaylist.RemoveAt(PlayingItemIndex);
|
||||
_shuffledPlaylist.Shuffle();
|
||||
_shuffledPlaylist.Insert(0, playingItem);
|
||||
@@ -407,7 +407,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// Gets the next item in the playlist considering repeat mode and shuffle mode.
|
||||
/// </summary>
|
||||
/// <returns>The next item in the playlist.</returns>
|
||||
public QueueItem GetNextItemPlaylistId()
|
||||
public SyncPlayQueueItem GetNextItemPlaylistId()
|
||||
{
|
||||
int newIndex;
|
||||
var playlist = GetPlaylistInternal();
|
||||
@@ -502,12 +502,12 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// Creates a list from the array of items. Each item is given an unique playlist identifier.
|
||||
/// </summary>
|
||||
/// <returns>The list of queue items.</returns>
|
||||
private List<QueueItem> CreateQueueItemsFromArray(IReadOnlyList<Guid> items)
|
||||
private List<SyncPlayQueueItem> CreateQueueItemsFromArray(IReadOnlyList<Guid> items)
|
||||
{
|
||||
var list = new List<QueueItem>();
|
||||
var list = new List<SyncPlayQueueItem>();
|
||||
foreach (var item in items)
|
||||
{
|
||||
var queueItem = new QueueItem(item);
|
||||
var queueItem = new SyncPlayQueueItem(item);
|
||||
list.Add(queueItem);
|
||||
}
|
||||
|
||||
@@ -518,7 +518,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// Gets the current playlist considering the shuffle mode.
|
||||
/// </summary>
|
||||
/// <returns>The playlist.</returns>
|
||||
private List<QueueItem> GetPlaylistInternal()
|
||||
private List<SyncPlayQueueItem> GetPlaylistInternal()
|
||||
{
|
||||
if (ShuffleMode.Equals(GroupShuffleMode.Shuffle))
|
||||
{
|
||||
@@ -532,7 +532,7 @@ namespace MediaBrowser.Controller.SyncPlay.Queue
|
||||
/// Gets the current playing item, depending on the shuffle mode.
|
||||
/// </summary>
|
||||
/// <returns>The playing item.</returns>
|
||||
private QueueItem GetPlayingItem()
|
||||
private SyncPlayQueueItem GetPlayingItem()
|
||||
{
|
||||
if (PlayingItemIndex == NoPlayingItemIndex)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user