Use hardware encoding string over boolean

This commit is contained in:
Brandon Nguyen 2021-07-03 15:29:07 -07:00
parent 7e3c94d094
commit df17c67f11
2 changed files with 4 additions and 2 deletions

View File

@ -444,6 +444,8 @@ 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;
hardwareAccelerationType = string.IsNullOrEmpty(hardwareAccelerationType) ? "none" : hardwareAccelerationType;
_sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo _sessionManager.ReportTranscodingInfo(deviceId, new TranscodingInfo
{ {
@ -458,7 +460,7 @@ namespace Jellyfin.Api.Helpers
AudioChannels = state.OutputAudioChannels, AudioChannels = state.OutputAudioChannels,
IsAudioDirect = EncodingHelper.IsCopyCodec(state.OutputAudioCodec), IsAudioDirect = EncodingHelper.IsCopyCodec(state.OutputAudioCodec),
IsVideoDirect = EncodingHelper.IsCopyCodec(state.OutputVideoCodec), IsVideoDirect = EncodingHelper.IsCopyCodec(state.OutputVideoCodec),
IsHardwareEncode = !string.IsNullOrEmpty(_serverConfigurationManager.GetEncodingOptions().HardwareAccelerationType), HardwareAccelerationType = hardwareAccelerationType,
TranscodeReasons = state.TranscodeReasons TranscodeReasons = state.TranscodeReasons
}); });
} }

View File

@ -34,7 +34,7 @@ namespace MediaBrowser.Model.Session
public int? AudioChannels { get; set; } public int? AudioChannels { get; set; }
public bool IsHardwareEncode { get; set; } public string HardwareAccelerationType { get; set; }
public TranscodeReason[] TranscodeReasons { get; set; } public TranscodeReason[] TranscodeReasons { get; set; }
} }