Feature: Add native region, window and monitor capture to get_screenshot
New Windows clients advertise CLIENT_CAP_SCREEN_REGION and accept a 24-byte ScreenPreviewReqEx appended to the existing 8-byte preview request, so get_screenshot can capture a region, a window or a single monitor at 1:1 resolution instead of only the scaled virtual desktop. Successful v2 responses append an optional ScreenCaptureMeta block reporting the source rect and scale, letting callers map coordinates back for remote input. Old clients and old servers keep the v1 byte stream unchanged. The 8192 px per-side bound only applies to native (1:1) capture, where it guards bitmap memory; scaled captures are unaffected so ultra-wide virtual desktops (for example triple 4K) still produce thumbnails and previews. max_width is clamped to [64,1920] as before instead of rejected, matching the documented schema. Co-Authored-By: deepseek-flash
This commit is contained in:
1 parent
b2c0d81396
commit
235a8a622c
11 files changed
+668
-97
No files matched your search
@@ -673,6 +673,10 @@ public:
|
||||
void ChooseScreenPreviewParams(context* ctx, WORD& maxWidth, BYTE& jpegQuality) const;
|
||||
// 发起预览请求;reqId 应与 m_PreviewReqId 同步
|
||||
void SendScreenPreviewRequest(context* ctx, WORD reqId, WORD maxWidth, BYTE jpegQuality);
|
||||
// v2:在 v1 请求后追加 ScreenPreviewReqEx(区域/窗口/显示器 + 原生分辨率标志)。
|
||||
// 只对声明 CLIENT_CAP_SCREEN_REGION 的客户端使用。
|
||||
void SendScreenPreviewRequestEx(context* ctx, WORD reqId, WORD maxWidth, BYTE jpegQuality,
|
||||
const ScreenPreviewReqEx& ex);
|
||||
// 预览响应规范化:Linux 客户端回原始 BGRA(SCREEN_PREVIEW_FMT_BGRX),在 IO 线程入口
|
||||
// 统一转成 JPEG,下游(浮窗/列表缩略图/MCP)只处理 JPEG。返回 false 表示畸形包,应丢弃。
|
||||
static bool NormalizeScreenPreviewPacket(std::vector<BYTE>& pkt);
|
||||
|
||||
Reference in new issue
Block a user