This commit is contained in:
Boki 2026-02-16 13:18:04 -05:00
parent 2d6a6bd3a1
commit d80e723b94
28 changed files with 1801 additions and 352 deletions

View file

@ -0,0 +1,37 @@
using Serilog;
namespace Poe2Trade.Screen;
public class FramePipelineService : IDisposable
{
public FramePipeline Pipeline { get; }
public IScreenCapture Backend { get; }
public FramePipelineService()
{
Backend = CreateBackend();
Pipeline = new FramePipeline(Backend);
}
private static IScreenCapture CreateBackend()
{
try
{
var dxgi = new DesktopDuplication();
Log.Information("Screen capture: DXGI Desktop Duplication");
return dxgi;
}
catch (Exception ex)
{
Log.Warning(ex, "DXGI unavailable, falling back to GDI");
}
Log.Information("Screen capture: GDI (CopyFromScreen)");
return new GdiCapture();
}
public void Dispose()
{
Pipeline.Dispose();
}
}