|
|
|
@ -172,19 +172,19 @@ public class HardwareCapabilitiesFactory : IHardwareCapabilitiesFactory |
|
|
|
|
|
|
|
|
|
|
|
var lines = new List<string>(); |
|
|
|
var lines = new List<string>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string arguments = display == "drm" |
|
|
|
|
|
|
|
? $"--display drm --device {vaapiDevice} -a" |
|
|
|
|
|
|
|
: $"--display {display} -a"; |
|
|
|
|
|
|
|
|
|
|
|
await Cli.Wrap("vainfo") |
|
|
|
await Cli.Wrap("vainfo") |
|
|
|
.WithArguments($"--display {display} --device {vaapiDevice} -a") |
|
|
|
.WithArguments(arguments) |
|
|
|
.WithEnvironmentVariables(envVars) |
|
|
|
.WithEnvironmentVariables(envVars) |
|
|
|
.WithValidation(CommandResultValidation.None) |
|
|
|
.WithValidation(CommandResultValidation.None) |
|
|
|
.WithStandardOutputPipe(PipeTarget.ToDelegate(lines.Add)) |
|
|
|
.WithStandardOutputPipe(PipeTarget.ToDelegate(lines.Add)) |
|
|
|
.WithStandardErrorPipe(PipeTarget.ToDelegate(lines.Add)) |
|
|
|
.WithStandardErrorPipe(PipeTarget.ToDelegate(lines.Add)) |
|
|
|
.ExecuteAsync(); |
|
|
|
.ExecuteAsync(); |
|
|
|
|
|
|
|
|
|
|
|
var mergedOutput = string.Join(System.Environment.NewLine, lines); |
|
|
|
return string.Join(System.Environment.NewLine, lines); |
|
|
|
|
|
|
|
|
|
|
|
return mergedOutput.Contains("trying display", StringComparison.OrdinalIgnoreCase) |
|
|
|
|
|
|
|
? mergedOutput |
|
|
|
|
|
|
|
: string.Empty; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async Task<List<string>> GetVaapiDisplays() |
|
|
|
public async Task<List<string>> GetVaapiDisplays() |
|
|
|
@ -326,12 +326,22 @@ public class HardwareCapabilitiesFactory : IHardwareCapabilitiesFactory |
|
|
|
|
|
|
|
|
|
|
|
if (profileEntrypoints is not null && profileEntrypoints.Count != 0) |
|
|
|
if (profileEntrypoints is not null && profileEntrypoints.Count != 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogDebug( |
|
|
|
if (display == "drm") |
|
|
|
"Detected {Count} VAAPI profile entrypoints for using {Display} {Driver} {Device}", |
|
|
|
{ |
|
|
|
profileEntrypoints.Count, |
|
|
|
_logger.LogDebug( |
|
|
|
display, |
|
|
|
"Detected {Count} VAAPI profile entrypoints using {Driver} {Device}", |
|
|
|
driver, |
|
|
|
profileEntrypoints.Count, |
|
|
|
device); |
|
|
|
driver, |
|
|
|
|
|
|
|
device); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_logger.LogDebug( |
|
|
|
|
|
|
|
"Detected {Count} VAAPI profile entrypoints using {Display} {Driver}", |
|
|
|
|
|
|
|
profileEntrypoints.Count, |
|
|
|
|
|
|
|
display, |
|
|
|
|
|
|
|
driver); |
|
|
|
|
|
|
|
} |
|
|
|
_memoryCache.Set(cacheKey, profileEntrypoints); |
|
|
|
_memoryCache.Set(cacheKey, profileEntrypoints); |
|
|
|
return new VaapiHardwareCapabilities(profileEntrypoints, _logger); |
|
|
|
return new VaapiHardwareCapabilities(profileEntrypoints, _logger); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -394,7 +404,7 @@ public class HardwareCapabilitiesFactory : IHardwareCapabilitiesFactory |
|
|
|
if (profileEntrypoints is not null && profileEntrypoints.Count != 0) |
|
|
|
if (profileEntrypoints is not null && profileEntrypoints.Count != 0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogDebug( |
|
|
|
_logger.LogDebug( |
|
|
|
"Detected {Count} VAAPI profile entrypoints for using QSV device {Device}", |
|
|
|
"Detected {Count} VAAPI profile entrypoints using QSV device {Device}", |
|
|
|
profileEntrypoints.Count, |
|
|
|
profileEntrypoints.Count, |
|
|
|
device); |
|
|
|
device); |
|
|
|
|
|
|
|
|
|
|
|
|