From 9ab85fd0b8cc1da0054749a1d8a911f2452463d2 Mon Sep 17 00:00:00 2001 From: Quantum Date: Sat, 17 Jul 2021 02:21:26 -0400 Subject: [PATCH] [host] capture: stop sending DPI information The client doesn't need DPI information anymore, so there is no point fetching it. --- host/include/interface/capture.h | 1 - host/platform/Linux/capture/XCB/src/xcb.c | 6 ------ host/platform/Windows/capture/DXGI/src/dxgi.c | 12 ------------ host/platform/Windows/capture/NVFBC/src/nvfbc.c | 15 +++------------ host/src/app.c | 1 - 5 files changed, 3 insertions(+), 32 deletions(-) diff --git a/host/include/interface/capture.h b/host/include/interface/capture.h index c52dc90c..7efea0ea 100644 --- a/host/include/interface/capture.h +++ b/host/include/interface/capture.h @@ -108,7 +108,6 @@ typedef struct CaptureInterface void (*stop )(); bool (*deinit )(); void (*free )(); - unsigned int (*getMouseScale)(); CaptureResult (*capture )(); CaptureResult (*waitFrame )(CaptureFrame * frame, const size_t maxFrameSize); diff --git a/host/platform/Linux/capture/XCB/src/xcb.c b/host/platform/Linux/capture/XCB/src/xcb.c index 07df425c..1f343989 100644 --- a/host/platform/Linux/capture/XCB/src/xcb.c +++ b/host/platform/Linux/capture/XCB/src/xcb.c @@ -165,11 +165,6 @@ static void xcb_free(void) this = NULL; } -static unsigned int xcb_getMouseScale(void) -{ - return 100; -} - static CaptureResult xcb_capture(void) { assert(this); @@ -243,7 +238,6 @@ struct CaptureInterface Capture_XCB = .init = xcb_init, .deinit = xcb_deinit, .free = xcb_free, - .getMouseScale = xcb_getMouseScale, .capture = xcb_capture, .waitFrame = xcb_waitFrame, .getFrame = xcb_getFrame diff --git a/host/platform/Windows/capture/DXGI/src/dxgi.c b/host/platform/Windows/capture/DXGI/src/dxgi.c index 4a8652cd..00d477ab 100644 --- a/host/platform/Windows/capture/DXGI/src/dxgi.c +++ b/host/platform/Windows/capture/DXGI/src/dxgi.c @@ -26,7 +26,6 @@ #include "common/option.h" #include "common/locking.h" #include "common/event.h" -#include "common/dpi.h" #include "common/runningavg.h" #include "common/KVMFR.h" @@ -98,7 +97,6 @@ struct iface unsigned int stride; CaptureFormat format; CaptureRotation rotation; - unsigned int dpi; int lastPointerX, lastPointerY; bool lastPointerVisible; @@ -419,7 +417,6 @@ static bool dxgi_init(void) break; } - this->dpi = monitor_dpi(outputDesc.Monitor); ++this->formatVer; DEBUG_INFO("Feature Level : 0x%x" , this->featureLevel); @@ -674,14 +671,6 @@ static void dxgi_free(void) this = NULL; } -static unsigned int dxgi_getMouseScale(void) -{ - assert(this); - assert(this->initialized); - - return this->dpi * 100 / DPI_100_PERCENT; -} - static CaptureResult dxgi_hResultToCaptureResult(const HRESULT status) { switch(status) @@ -1088,7 +1077,6 @@ struct CaptureInterface Capture_DXGI = .stop = dxgi_stop, .deinit = dxgi_deinit, .free = dxgi_free, - .getMouseScale = dxgi_getMouseScale, .capture = dxgi_capture, .waitFrame = dxgi_waitFrame, .getFrame = dxgi_getFrame diff --git a/host/platform/Windows/capture/NVFBC/src/nvfbc.c b/host/platform/Windows/capture/NVFBC/src/nvfbc.c index b2305989..fe587852 100644 --- a/host/platform/Windows/capture/NVFBC/src/nvfbc.c +++ b/host/platform/Windows/capture/NVFBC/src/nvfbc.c @@ -27,7 +27,6 @@ #include "common/framebuffer.h" #include "common/event.h" #include "common/thread.h" -#include "common/dpi.h" #include "common/KVMFR.h" #include #include @@ -59,7 +58,6 @@ struct iface unsigned int maxWidth , maxHeight; unsigned int width , height; - unsigned int dpi; unsigned int formatVer; unsigned int grabWidth, grabHeight, grabStride; @@ -86,7 +84,7 @@ static bool nvfbc_deinit(void); static void nvfbc_free(void); static int pointerThread(void * unused); -static void getDesktopSize(unsigned int * width, unsigned int * height, unsigned int * dpi) +static void getDesktopSize(unsigned int * width, unsigned int * height) { HMONITOR monitor = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTOPRIMARY); MONITORINFO monitorInfo = { @@ -94,7 +92,6 @@ static void getDesktopSize(unsigned int * width, unsigned int * height, unsigned }; GetMonitorInfo(monitor, &monitorInfo); - *dpi = monitor_dpi(monitor); *width = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left; *height = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top; @@ -191,7 +188,7 @@ static bool nvfbc_init(void) } free(privData); - getDesktopSize(&this->width, &this->height, &this->dpi); + getDesktopSize(&this->width, &this->height); HANDLE event; if (!NvFBCToSysSetup( @@ -298,14 +295,9 @@ static void nvfbc_free(void) NvFBCFree(); } -static unsigned int nvfbc_getMouseScale(void) -{ - return this->dpi * 100 / DPI_100_PERCENT; -} - static CaptureResult nvfbc_capture(void) { - getDesktopSize(&this->width, &this->height, &this->dpi); + getDesktopSize(&this->width, &this->height); NvFBCFrameGrabInfo grabInfo; CaptureResult result = NvFBCToSysCapture( this->nvfbc, @@ -602,7 +594,6 @@ struct CaptureInterface Capture_NVFBC = .stop = nvfbc_stop, .deinit = nvfbc_deinit, .free = nvfbc_free, - .getMouseScale = nvfbc_getMouseScale, .capture = nvfbc_capture, .waitFrame = nvfbc_waitFrame, .getFrame = nvfbc_getFrame diff --git a/host/src/app.c b/host/src/app.c index efa93164..ee2208d9 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -235,7 +235,6 @@ static bool sendFrame(void) fi->stride = frame.stride; fi->pitch = frame.pitch; fi->offset = app.pageSize - FrameBufferStructSize; - fi->mouseScalePercent = app.iface->getMouseScale(); fi->blockScreensaver = os_blockScreensaver(); app.frameValid = true;