Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/ulalaca-xrdp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGyuhwan Park <unstabler@unstabler.pl>2022-10-06 14:48:56 +0300
committerGyuhwan Park <unstabler@unstabler.pl>2022-10-06 14:48:56 +0300
commit3d841ddb09539bb5fb252f6b26c1a738a1129183 (patch)
tree41006a1076c61ce7b6acbbc9c707674f3e82973d
parent83572bb84ead27ac3caa7cbcaa325fecaf6d0244 (diff)
parentf5cec2d0c65722d161805d81e042f0919c31c0c6 (diff)
Merge branch 'main' of github.com:team-unstablers/ulalaca-xrdp
-rw-r--r--ulalaca.cpp18
-rw-r--r--ulalaca.hpp1
2 files changed, 13 insertions, 6 deletions
diff --git a/ulalaca.cpp b/ulalaca.cpp
index 618bf7e..cd3d7b9 100644
--- a/ulalaca.cpp
+++ b/ulalaca.cpp
@@ -48,6 +48,7 @@ XrdpUlalaca::XrdpUlalaca():
si(nullptr),
+ _fullInvalidate(true),
_sessionSize { 0, 0, 640, 480 },
_bpp(0),
@@ -196,6 +197,7 @@ int XrdpUlalaca::lib_mod_server_monitor_resize(XrdpUlalaca *_this, int width, in
}
int XrdpUlalaca::lib_mod_server_monitor_full_invalidate(XrdpUlalaca *_this, int width, int height) {
+ _this->_fullInvalidate = true;
return 0;
}
@@ -251,15 +253,16 @@ int XrdpUlalaca::decideCopyRectSize() const {
bool isRFXCodec = _clientInfo.rfx_codec_id != 0;
bool isJPEGCodec = _clientInfo.jpeg_codec_id != 0;
bool isH264Codec = _clientInfo.h264_codec_id != 0;
+ bool isGFXH264Codec = _clientInfo.capture_code & 3;
- if (isRFXCodec || isJPEGCodec) {
- return 64;
- }
- if (isH264Codec) {
- // return 256;
+ if (isH264Codec || isGFXH264Codec) {
return RECT_SIZE_BYPASS_CREATE;
}
+
+ if (isRFXCodec || isJPEGCodec) {
+ return 64;
+ }
return RECT_SIZE_BYPASS_CREATE;
}
@@ -269,6 +272,7 @@ std::unique_ptr<std::vector<XrdpUlalaca::Rect>> XrdpUlalaca::createCopyRects(
int rectSize
) const {
auto blocks = std::make_unique<std::vector<Rect>>();
+ blocks->reserve(128);
if (rectSize == RECT_SIZE_BYPASS_CREATE) {
std::copy(dirtyRects.begin(), dirtyRects.end(), std::back_insert_iterator(*blocks));
@@ -326,7 +330,7 @@ void XrdpUlalaca::commitUpdate(const uint8_t *image, int32_t width, int32_t heig
Rect screenRect = {0, 0, (short) width, (short) height};
auto copyRectSize = decideCopyRectSize();
- if (_frameId > 0) {
+ if (_frameId > 0 || !_fullInvalidate) {
auto copyRects = createCopyRects(_dirtyRects, copyRectSize);
server_paint_rects(
@@ -350,6 +354,8 @@ void XrdpUlalaca::commitUpdate(const uint8_t *image, int32_t width, int32_t heig
width, height,
0, (_frameId++ % INT32_MAX)
);
+
+ _fullInvalidate = false;
}
_dirtyRects.clear();
diff --git a/ulalaca.hpp b/ulalaca.hpp
index 6960952..248f7e6 100644
--- a/ulalaca.hpp
+++ b/ulalaca.hpp
@@ -229,6 +229,7 @@ private:
std::unique_ptr<UnixSocket> _socket;
std::unique_ptr<ProjectionThread> _projectionThread;
+ std::atomic_bool _fullInvalidate;
std::mutex _commitUpdateLock;
std::vector<Rect> _dirtyRects;