From 9ce49907931c05766fc5538f6ba0bf02181fa61d Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 11 Jul 2021 19:18:59 -0400 Subject: [PATCH] [host] capture: pass frameIndex to capture backends This allows capture backends to track damage made to each frame. --- host/include/interface/capture.h | 2 +- host/platform/Linux/capture/XCB/src/xcb.c | 3 ++- host/platform/Windows/capture/DXGI/src/dxgi.c | 2 +- host/platform/Windows/capture/NVFBC/src/nvfbc.c | 2 +- host/src/app.c | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/host/include/interface/capture.h b/host/include/interface/capture.h index 3d8e9913..c52dc90c 100644 --- a/host/include/interface/capture.h +++ b/host/include/interface/capture.h @@ -112,6 +112,6 @@ typedef struct CaptureInterface CaptureResult (*capture )(); CaptureResult (*waitFrame )(CaptureFrame * frame, const size_t maxFrameSize); - CaptureResult (*getFrame )(FrameBuffer * frame, const unsigned int height); + CaptureResult (*getFrame )(FrameBuffer * frame, const unsigned int height, int frameIndex); } CaptureInterface; diff --git a/host/platform/Linux/capture/XCB/src/xcb.c b/host/platform/Linux/capture/XCB/src/xcb.c index 4eecc55f..07df425c 100644 --- a/host/platform/Linux/capture/XCB/src/xcb.c +++ b/host/platform/Linux/capture/XCB/src/xcb.c @@ -213,7 +213,8 @@ static CaptureResult xcb_waitFrame(CaptureFrame * frame, return CAPTURE_RESULT_OK; } -static CaptureResult xcb_getFrame(FrameBuffer * frame, const unsigned int height) +static CaptureResult xcb_getFrame(FrameBuffer * frame, + const unsigned int height, int frameIndex) { assert(this); assert(this->initialized); diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index a79a3d31..37973645 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -1027,7 +1027,7 @@ static CaptureResult dxgi_waitFrame(CaptureFrame * frame, const size_t maxFrameS } static CaptureResult dxgi_getFrame(FrameBuffer * frame, - const unsigned int height) + const unsigned int height, int frameIndex) { assert(this); assert(this->initialized); diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index d620fab2..6bc9bf45 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -428,7 +428,7 @@ static CaptureResult nvfbc_waitFrame(CaptureFrame * frame, } static CaptureResult nvfbc_getFrame(FrameBuffer * frame, - const unsigned int height) + const unsigned int height, int frameIndex) { framebuffer_write( frame, diff --git a/host/src/app.c b/host/src/app.c index d9ee90f1..efa93164 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -254,7 +254,7 @@ static bool sendFrame(void) return true; } - app.iface->getFrame(fb, frame.height); + app.iface->getFrame(fb, frame.height, app.frameIndex); return true; }