Fix: macOS use quality profile FPS/bitrate, add HW resolution downscaling

This commit is contained in:
yuanyuanxiang
2026-06-09 12:02:15 +02:00
parent 8e5ec20cf2
commit 3f662f1ca7
10 changed files with 254 additions and 77 deletions

View File

@@ -110,6 +110,8 @@ private:
// Screen info
int m_width; // Physical pixel width (sent to server)
int m_height; // Physical pixel height (sent to server)
int m_encodeWidth; // Encode/transmit width (capped by profile maxWidth)
int m_encodeHeight; // Encode/transmit height
int m_logicalWidth; // Logical point width (for CGEvent)
int m_logicalHeight; // Logical point height (for CGEvent)
double m_scaleFactor; // Retina scale factor (physical / logical)
@@ -127,6 +129,11 @@ private:
std::atomic<int> m_maxFPS;
int8_t m_qualityLevel;
// Pending resolution change (set by applyQualityLevel, consumed by captureLoop)
std::atomic<bool> m_dimensionsChanged{false};
std::atomic<int> m_pendingEncodeWidth{0};
std::atomic<int> m_pendingEncodeHeight{0};
// H264 encoder
std::unique_ptr<H264Encoder> m_h264Encoder;
int m_h264Bitrate;