mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 05:34:16 -04:00
Merge pull request #12384 from evanjarrett/qsv-renderdevice
Update QSV device args to use the renderNodePath
This commit is contained in:
commit
737a1b8a37
@ -878,17 +878,23 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
renderNodePath);
|
renderNodePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetQsvDeviceArgs(string alias)
|
private string GetQsvDeviceArgs(string renderNodePath, string alias)
|
||||||
{
|
{
|
||||||
var arg = " -init_hw_device qsv=" + (alias ?? QsvAlias);
|
var arg = " -init_hw_device qsv=" + (alias ?? QsvAlias);
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
{
|
{
|
||||||
// derive qsv from vaapi device
|
// 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())
|
if (OperatingSystem.IsWindows())
|
||||||
{
|
{
|
||||||
|
// on Windows, the deviceIndex is an int
|
||||||
|
if (int.TryParse(renderNodePath, NumberStyles.Integer, CultureInfo.InvariantCulture, out int deviceIndex))
|
||||||
|
{
|
||||||
|
return GetD3d11vaDeviceArgs(deviceIndex, string.Empty, D3d11vaAlias) + arg + "@" + D3d11vaAlias;
|
||||||
|
}
|
||||||
|
|
||||||
// derive qsv from d3d11va device
|
// derive qsv from d3d11va device
|
||||||
return GetD3d11vaDeviceArgs(0, "0x8086", D3d11vaAlias) + arg + "@" + D3d11vaAlias;
|
return GetD3d11vaDeviceArgs(0, "0x8086", D3d11vaAlias) + arg + "@" + D3d11vaAlias;
|
||||||
}
|
}
|
||||||
@ -1048,7 +1054,7 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.Append(GetQsvDeviceArgs(QsvAlias));
|
args.Append(GetQsvDeviceArgs(options.QsvDevice, QsvAlias));
|
||||||
var filterDevArgs = GetFilterHwDeviceArgs(QsvAlias);
|
var filterDevArgs = GetFilterHwDeviceArgs(QsvAlias);
|
||||||
// child device used by qsv.
|
// child device used by qsv.
|
||||||
if (_mediaEncoder.SupportsHwaccel("vaapi") || _mediaEncoder.SupportsHwaccel("d3d11va"))
|
if (_mediaEncoder.SupportsHwaccel("vaapi") || _mediaEncoder.SupportsHwaccel("d3d11va"))
|
||||||
|
@ -26,6 +26,7 @@ public class EncodingOptions
|
|||||||
// This is a DRM device that is almost guaranteed to be there on every intel platform,
|
// This is a DRM device that is almost guaranteed to be there on every intel platform,
|
||||||
// plus it's the default one in ffmpeg if you don't specify anything
|
// plus it's the default one in ffmpeg if you don't specify anything
|
||||||
VaapiDevice = "/dev/dri/renderD128";
|
VaapiDevice = "/dev/dri/renderD128";
|
||||||
|
QsvDevice = string.Empty;
|
||||||
EnableTonemapping = false;
|
EnableTonemapping = false;
|
||||||
EnableVppTonemapping = false;
|
EnableVppTonemapping = false;
|
||||||
EnableVideoToolboxTonemapping = false;
|
EnableVideoToolboxTonemapping = false;
|
||||||
@ -136,6 +137,11 @@ public class EncodingOptions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string VaapiDevice { get; set; }
|
public string VaapiDevice { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the QSV device.
|
||||||
|
/// </summary>
|
||||||
|
public string QsvDevice { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether tonemapping is enabled.
|
/// Gets or sets a value indicating whether tonemapping is enabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user