Skip to content

Commit

Permalink
#3337 expose encoders for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Nov 28, 2021
1 parent a2c5113 commit d7a848d
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions xpra/server/window/window_source.py
Expand Up @@ -38,6 +38,7 @@
bandwidthlog = Logger("bandwidth")

TRUE_LOSSLESS = envbool("XPRA_TRUE_LOSSLESS", False)
LOG_ENCODERS = envbool("XPRA_LOG_ENCODERS", True)

AUTO_REFRESH = envbool("XPRA_AUTO_REFRESH", True)
AUTO_REFRESH_QUALITY = envint("XPRA_AUTO_REFRESH_QUALITY", 100)
Expand Down Expand Up @@ -342,12 +343,13 @@ def init_encoders(self):
picture_encodings = []
def add(encoder_name):
encoder = get_codec(encoder_name)
if encoder:
for encoding in encoder.get_encodings():
if encoding in self.server_core_encodings:
self.add_encoder(encoding, encoder.encode)
if encoding not in picture_encodings:
picture_encodings.append(encoding)
if not encoder:
return None
for encoding in encoder.get_encodings():
if encoding in self.server_core_encodings:
self.add_encoder(encoding, encoder.encode)
if encoding not in picture_encodings:
picture_encodings.append(encoding)
return encoder
rgb = add("enc_rgb")
assert rgb, "rgb encoder is missing"
Expand Down Expand Up @@ -2555,6 +2557,14 @@ def nodata(msg, *args):
client_options["z.sha256"] = chksum
client_options["z.len"] = len(data)
log("added len and hash of compressed data integrity %19s: %8i / %s", type(v), len(v), chksum)
if LOG_ENCODERS:
mod = getattr(encoder, "__module__") #ie: 'xpra.codecs.pillow.encoder'
if mod:
if mod.endswith(".encoder"):
mod = mod[:-len(".encoder")] #ie: 'xpra.codecs.pillow'
mod = mod.split(".")[-1] #ie: 'pillow'
if mod:
client_options["encoder"] = mod
#actual network packet:
if flush not in (None, 0):
client_options["flush"] = flush
Expand Down

0 comments on commit d7a848d

Please sign in to comment.