From 80ab4b539327c75ee16cef398f9ff5237cac6624 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 10 Jul 2021 18:39:40 -0400 Subject: [PATCH] [host] capture: add damage rectangles to capture interface --- host/include/interface/capture.h | 3 +++ host/src/app.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/host/include/interface/capture.h b/host/include/interface/capture.h index d073635f..3d8e9913 100644 --- a/host/include/interface/capture.h +++ b/host/include/interface/capture.h @@ -23,6 +23,7 @@ #include #include #include "common/framebuffer.h" +#include "common/KVMFR.h" typedef enum CaptureResult { @@ -69,6 +70,8 @@ typedef struct CaptureFrame unsigned int stride; CaptureFormat format; CaptureRotation rotation; + uint32_t damageRectsCount; + FrameDamageRect damageRects[KVMFR_MAX_DAMAGE_RECTS]; } CaptureFrame; diff --git a/host/src/app.c b/host/src/app.c index bd91b824..d9ee90f1 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -239,6 +239,9 @@ static bool sendFrame(void) fi->blockScreensaver = os_blockScreensaver(); app.frameValid = true; + fi->damageRectsCount = frame.damageRectsCount; + memcpy(fi->damageRects, frame.damageRects, frame.damageRectsCount * sizeof(FrameDamageRect)); + // put the framebuffer on the border of the next page // this is to allow for aligned DMA transfers by the receiver FrameBuffer * fb = (FrameBuffer *)(((uint8_t*)fi) + fi->offset);