[host] capture: stop sending DPI information

The client doesn't need DPI information anymore, so there is no point
fetching it.
This commit is contained in:
Quantum 2021-07-17 02:21:26 -04:00 committed by Geoffrey McRae
parent e0c9a71cd8
commit 9ab85fd0b8
5 changed files with 3 additions and 32 deletions

View File

@ -108,7 +108,6 @@ typedef struct CaptureInterface
void (*stop )(); void (*stop )();
bool (*deinit )(); bool (*deinit )();
void (*free )(); void (*free )();
unsigned int (*getMouseScale)();
CaptureResult (*capture )(); CaptureResult (*capture )();
CaptureResult (*waitFrame )(CaptureFrame * frame, const size_t maxFrameSize); CaptureResult (*waitFrame )(CaptureFrame * frame, const size_t maxFrameSize);

View File

@ -165,11 +165,6 @@ static void xcb_free(void)
this = NULL; this = NULL;
} }
static unsigned int xcb_getMouseScale(void)
{
return 100;
}
static CaptureResult xcb_capture(void) static CaptureResult xcb_capture(void)
{ {
assert(this); assert(this);
@ -243,7 +238,6 @@ struct CaptureInterface Capture_XCB =
.init = xcb_init, .init = xcb_init,
.deinit = xcb_deinit, .deinit = xcb_deinit,
.free = xcb_free, .free = xcb_free,
.getMouseScale = xcb_getMouseScale,
.capture = xcb_capture, .capture = xcb_capture,
.waitFrame = xcb_waitFrame, .waitFrame = xcb_waitFrame,
.getFrame = xcb_getFrame .getFrame = xcb_getFrame

View File

@ -26,7 +26,6 @@
#include "common/option.h" #include "common/option.h"
#include "common/locking.h" #include "common/locking.h"
#include "common/event.h" #include "common/event.h"
#include "common/dpi.h"
#include "common/runningavg.h" #include "common/runningavg.h"
#include "common/KVMFR.h" #include "common/KVMFR.h"
@ -98,7 +97,6 @@ struct iface
unsigned int stride; unsigned int stride;
CaptureFormat format; CaptureFormat format;
CaptureRotation rotation; CaptureRotation rotation;
unsigned int dpi;
int lastPointerX, lastPointerY; int lastPointerX, lastPointerY;
bool lastPointerVisible; bool lastPointerVisible;
@ -419,7 +417,6 @@ static bool dxgi_init(void)
break; break;
} }
this->dpi = monitor_dpi(outputDesc.Monitor);
++this->formatVer; ++this->formatVer;
DEBUG_INFO("Feature Level : 0x%x" , this->featureLevel); DEBUG_INFO("Feature Level : 0x%x" , this->featureLevel);
@ -674,14 +671,6 @@ static void dxgi_free(void)
this = NULL; 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) static CaptureResult dxgi_hResultToCaptureResult(const HRESULT status)
{ {
switch(status) switch(status)
@ -1088,7 +1077,6 @@ struct CaptureInterface Capture_DXGI =
.stop = dxgi_stop, .stop = dxgi_stop,
.deinit = dxgi_deinit, .deinit = dxgi_deinit,
.free = dxgi_free, .free = dxgi_free,
.getMouseScale = dxgi_getMouseScale,
.capture = dxgi_capture, .capture = dxgi_capture,
.waitFrame = dxgi_waitFrame, .waitFrame = dxgi_waitFrame,
.getFrame = dxgi_getFrame .getFrame = dxgi_getFrame

View File

@ -27,7 +27,6 @@
#include "common/framebuffer.h" #include "common/framebuffer.h"
#include "common/event.h" #include "common/event.h"
#include "common/thread.h" #include "common/thread.h"
#include "common/dpi.h"
#include "common/KVMFR.h" #include "common/KVMFR.h"
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
@ -59,7 +58,6 @@ struct iface
unsigned int maxWidth , maxHeight; unsigned int maxWidth , maxHeight;
unsigned int width , height; unsigned int width , height;
unsigned int dpi;
unsigned int formatVer; unsigned int formatVer;
unsigned int grabWidth, grabHeight, grabStride; unsigned int grabWidth, grabHeight, grabStride;
@ -86,7 +84,7 @@ static bool nvfbc_deinit(void);
static void nvfbc_free(void); static void nvfbc_free(void);
static int pointerThread(void * unused); 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); HMONITOR monitor = MonitorFromWindow(GetDesktopWindow(), MONITOR_DEFAULTTOPRIMARY);
MONITORINFO monitorInfo = { MONITORINFO monitorInfo = {
@ -94,7 +92,6 @@ static void getDesktopSize(unsigned int * width, unsigned int * height, unsigned
}; };
GetMonitorInfo(monitor, &monitorInfo); GetMonitorInfo(monitor, &monitorInfo);
*dpi = monitor_dpi(monitor);
*width = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left; *width = monitorInfo.rcMonitor.right - monitorInfo.rcMonitor.left;
*height = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top; *height = monitorInfo.rcMonitor.bottom - monitorInfo.rcMonitor.top;
@ -191,7 +188,7 @@ static bool nvfbc_init(void)
} }
free(privData); free(privData);
getDesktopSize(&this->width, &this->height, &this->dpi); getDesktopSize(&this->width, &this->height);
HANDLE event; HANDLE event;
if (!NvFBCToSysSetup( if (!NvFBCToSysSetup(
@ -298,14 +295,9 @@ static void nvfbc_free(void)
NvFBCFree(); NvFBCFree();
} }
static unsigned int nvfbc_getMouseScale(void)
{
return this->dpi * 100 / DPI_100_PERCENT;
}
static CaptureResult nvfbc_capture(void) static CaptureResult nvfbc_capture(void)
{ {
getDesktopSize(&this->width, &this->height, &this->dpi); getDesktopSize(&this->width, &this->height);
NvFBCFrameGrabInfo grabInfo; NvFBCFrameGrabInfo grabInfo;
CaptureResult result = NvFBCToSysCapture( CaptureResult result = NvFBCToSysCapture(
this->nvfbc, this->nvfbc,
@ -602,7 +594,6 @@ struct CaptureInterface Capture_NVFBC =
.stop = nvfbc_stop, .stop = nvfbc_stop,
.deinit = nvfbc_deinit, .deinit = nvfbc_deinit,
.free = nvfbc_free, .free = nvfbc_free,
.getMouseScale = nvfbc_getMouseScale,
.capture = nvfbc_capture, .capture = nvfbc_capture,
.waitFrame = nvfbc_waitFrame, .waitFrame = nvfbc_waitFrame,
.getFrame = nvfbc_getFrame .getFrame = nvfbc_getFrame

View File

@ -235,7 +235,6 @@ static bool sendFrame(void)
fi->stride = frame.stride; fi->stride = frame.stride;
fi->pitch = frame.pitch; fi->pitch = frame.pitch;
fi->offset = app.pageSize - FrameBufferStructSize; fi->offset = app.pageSize - FrameBufferStructSize;
fi->mouseScalePercent = app.iface->getMouseScale();
fi->blockScreensaver = os_blockScreensaver(); fi->blockScreensaver = os_blockScreensaver();
app.frameValid = true; app.frameValid = true;