mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-09 07:10:34 +02:00
Use nullable enum type instead of strings
This commit is contained in:
parent
df17c67f11
commit
d0c5e25ec0
|
@ -444,8 +444,10 @@ namespace Jellyfin.Api.Helpers
|
||||||
{
|
{
|
||||||
var audioCodec = state.ActualOutputAudioCodec;
|
var audioCodec = state.ActualOutputAudioCodec;
|
||||||
var videoCodec = state.ActualOutputVideoCodec;
|
var videoCodec = state.ActualOutputVideoCodec;
|
||||||
var hardwareAccelerationType = _serverConfigurationManager.GetEncodingOptions().HardwareAccelerationType;
|
var hardwareAccelerationTypeString = _serverConfigurationManager.GetEncodingOptions().HardwareAccelerationType;
|
||||||
hardwareAccelerationType = string.IsNullOrEmpty(hardwareAccelerationType) ? "none" : hardwareAccelerationType;
|
HardwareEncodingType? hardwareAccelerationType = string.IsNullOrEmpty(hardwareAccelerationTypeString)
|
||||||
|
? null
|
||||||
|
: (HardwareEncodingType)Enum.Parse(typeof(HardwareEncodingType), hardwareAccelerationTypeString, true);
|
||||||
|
|
||||||
_sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo
|
_sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo
|
||||||
{
|
{
|
||||||
|
|
48
MediaBrowser.Model/Session/HardwareEncodingType.cs
Normal file
48
MediaBrowser.Model/Session/HardwareEncodingType.cs
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
namespace MediaBrowser.Model.Session
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Enum HardwareEncodingType.
|
||||||
|
/// </summary>
|
||||||
|
public enum HardwareEncodingType
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// AMD AMF
|
||||||
|
/// </summary>
|
||||||
|
AMF,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Intel Quick Sync Video
|
||||||
|
/// </summary>
|
||||||
|
QSV,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// NVIDIA NVENC
|
||||||
|
/// </summary>
|
||||||
|
NVENC,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// OpenMax OMX
|
||||||
|
/// </summary>
|
||||||
|
OMX,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Exynos V4L2 MFC
|
||||||
|
/// </summary>
|
||||||
|
V4L2M2M,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// MediaCodec Android
|
||||||
|
/// </summary>
|
||||||
|
MediaCodec,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Video Acceleration API (VAAPI)
|
||||||
|
/// </summary>
|
||||||
|
VAAPI,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Video ToolBox
|
||||||
|
/// </summary>
|
||||||
|
VideoToolBox
|
||||||
|
}
|
||||||
|
}
|
|
@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Session
|
||||||
|
|
||||||
public int? AudioChannels { get; set; }
|
public int? AudioChannels { get; set; }
|
||||||
|
|
||||||
public string HardwareAccelerationType { get; set; }
|
public HardwareEncodingType? HardwareAccelerationType { get; set; }
|
||||||
|
|
||||||
public TranscodeReason[] TranscodeReasons { get; set; }
|
public TranscodeReason[] TranscodeReasons { get; set; }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue