Feature: Add menu to switch screen for remote control

This commit is contained in:
yuanyuanxiang
2025-11-28 20:53:28 +01:00
parent 3270527dd0
commit 9a3277d638
6 changed files with 83 additions and 24 deletions

View File

@@ -133,6 +133,7 @@ public:
int m_GOP; // <20>ؼ<EFBFBD>֡<EFBFBD><D6A1><EFBFBD><EFBFBD>
bool m_SendKeyFrame; // <20><><EFBFBD>͹ؼ<CDB9>֡
CX264Encoder *m_encoder; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
int m_nScreenCount; // <20><>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD>
ScreenCapture(int n = 32, BYTE algo = ALGORITHM_DIFF, BOOL all = FALSE) :
m_ThreadPool(nullptr), m_FirstBuffer(nullptr), m_RectBuffer(nullptr),
@@ -141,11 +142,11 @@ public:
m_FrameID(0), m_GOP(DEFAULT_GOP), m_iScreenX(0), m_iScreenY(0), m_biBitCount(n),
m_SendKeyFrame(false), m_encoder(nullptr)
{
m_BlockNum = 8;
m_ThreadPool = new ThreadPool(m_BlockNum);
static auto monitors = GetAllMonitors();
static int index = 0;
m_nScreenCount = monitors.size();
if (all && !monitors.empty()) {
int idx = index++ % (monitors.size()+1);
if (idx == 0) {
@@ -207,6 +208,10 @@ public:
SAFE_DELETE(m_encoder);
}
virtual int GetScreenCount() const {
return m_nScreenCount;
}
virtual int SendQuality(int quality)
{
int old = m_SendQuality;