Allow QSV to use the renderNodePath instead of defaulting to the first available device

This commit is contained in:
Evan Jarrett 2024-08-03 11:56:56 -05:00
parent a82527dcdf
commit 51433528a1

View File

@ -891,13 +891,13 @@ namespace MediaBrowser.Controller.MediaEncoding
renderNodePath);
}
private string GetQsvDeviceArgs(string alias)
private string GetQsvDeviceArgs(string renderNodePath, string alias)
{
var arg = " -init_hw_device qsv=" + (alias ?? QsvAlias);
if (OperatingSystem.IsLinux())
{
// derive qsv from vaapi device
return GetVaapiDeviceArgs(null, "iHD", "i915", null, VaapiAlias) + arg + "@" + VaapiAlias;
return GetVaapiDeviceArgs(renderNodePath, "iHD", "i915", null, VaapiAlias) + arg + "@" + VaapiAlias;
}
if (OperatingSystem.IsWindows())
@ -1061,7 +1061,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return string.Empty;
}
args.Append(GetQsvDeviceArgs(QsvAlias));
args.Append(GetQsvDeviceArgs(options.VaapiDevice, QsvAlias));
var filterDevArgs = GetFilterHwDeviceArgs(QsvAlias);
// child device used by qsv.
if (_mediaEncoder.SupportsHwaccel("vaapi") || _mediaEncoder.SupportsHwaccel("d3d11va"))