Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use compressLevel in ZRLEEncoder #1645

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

adamhalim
Copy link
Contributor

Currently, setting a custom compression level in vncviewer only affects the TightEncoder. This change makes the ZRLEEncoder respect a client's desired compressLevel as well.

Tested using x0vncserver, seems to work.

@CendioOssman
Copy link
Member

Thanks. There is the "ZlibLevel" setting that also needs to be marked deprecated in some way. The documentation needs to be updated at least, but ideally, there is some warning to users that use this setting.

@CendioOssman CendioOssman added the enhancement New feature or request label Jul 11, 2023
@adamhalim adamhalim force-pushed the zrlee-compression-level branch 2 times, most recently from e7d14cc to 8c9dd96 Compare July 20, 2023 08:15
@adamhalim
Copy link
Contributor Author

I've updated it to work in the same way the fullScreenAllMonitors parameter is marked deprecated in vncviewer.

if (compressLevel != -1) {
vlog.info("ZlibLevel is deprecated, let clients set the compression level instead.");
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting is in the core library, so it is used in all servers. Which means we cannot have the warning just here in x0vncserver.

Perhaps in the constructor for the encoder? It should just be instantiated once per server.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake, completely forgot about Xvnc.

The encoders are only constructed once a client actually connects to the servers. I figured it would be nice to display a warning message as soon as the server starts instead of when a client connects, so I moved the logging to Configuration.cxx which parses arguments during startup in both x0vncserver and Xvnc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reasonable concern, but I don't think it is worth breaking modularity in Configuration.cxx for. I think this is a very rarely used option. So we can live with the fact that the warning isn't perfect to keep the code simple and clean.

If we get many confused users, then we can always revisit the issue again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough, I've moved the warning to the ZRLEEncoder's constructor.

@@ -31,7 +31,7 @@

using namespace rfb;

IntParameter zlibLevel("ZlibLevel","Zlib compression level",-1);
IntParameter zlibLevel("ZlibLevel","[DEPRECATED] Zlib compression level",-1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also stop using it so we get a clear switch to using the normal compression setting.

@adamhalim adamhalim force-pushed the zrlee-compression-level branch 2 times, most recently from e2c4471 to de1abda Compare November 20, 2023 10:30
Copy link
Member

@CendioOssman CendioOssman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one more thing. There was a header there that doesn't seem to be used. From an earlier iteration?

@@ -17,6 +17,7 @@
* USA.
*/

#include <cstdio>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I missed this before. This doesn't look like it is used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct, removed it.

if (zlibLevel != -1) {
vlog.info("Warning: The ZlibLevel option is deprecated and is "
"ignored by the server. The compression level can be set "
"by the client instead.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation looks like it is off here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

This change makes the ZRLEEncoder respect a client's desired
compressionLevel. The ZlibLevel option is marked deprecated and removed
from the manpages.
@CendioOssman CendioOssman merged commit be3d0bc into TigerVNC:master Nov 20, 2023
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants