Skip to content

Commit

Permalink
#1637 raise scrolling threshold for html5 client to 65% (since we wil…
Browse files Browse the repository at this point in the history
…l have to use "rgb" for the rest)

git-svn-id: https://xpra.org/svn/Xpra/trunk@17112 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 5, 2017
1 parent 1c19929 commit 7c38aeb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/html5/js/Client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1033,6 +1033,7 @@ XpraClient.prototype._make_hello = function() {
"encoding.client_options" : true,
"encoding.csc_atoms" : true,
"encoding.scrolling" : true,
"encoding.scrolling.min-percent" : 65,
"encoding.color-gamut" : Utilities.getColorGamut(),
"encoding.non-scroll" : ["rgb32"],
//video stuff:
Expand Down
11 changes: 8 additions & 3 deletions src/xpra/server/window/window_video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def __init__(self, *args):
WindowSource.__init__(self, *args)
self.scroll_encoding = SCROLL_ENCODING
self.supports_scrolling = self.scroll_encoding and self.encoding_options.boolget("scrolling") and not STRICT_MODE
self.scroll_min_percent = self.encoding_options.intget("scrolling.min-percent", SCROLL_MIN_PERCENT)
self.supports_video_scaling = self.encoding_options.boolget("video_scaling", False)
self.supports_video_b_frames = self.encoding_options.strlistget("video_b_frames", [])

Expand Down Expand Up @@ -209,7 +210,10 @@ def addcinfo(prefix, x):
})
einfo = {
"pipeline_param" : self.get_pipeline_info(),
"scrolling" : self.supports_scrolling,
"scrolling" : {
"enabled" : self.supports_scrolling,
"min-percent" : self.scroll_min_percent,
}
}
if self._last_pipeline_check>0:
einfo["pipeline_last_check"] = int(1000*(monotonic_time()-self._last_pipeline_check))
Expand Down Expand Up @@ -322,6 +326,7 @@ def do_set_client_properties(self, properties):
#client may restrict csc modes for specific windows
self.parse_csc_modes(properties.dictget("encoding.full_csc_modes", default_value=None))
self.supports_scrolling = self.scroll_encoding and properties.boolget("encoding.scrolling", self.supports_scrolling) and not STRICT_MODE
self.scroll_min_percent = properties.intget("scrolling.min-percent", self.scroll_min_percent)
self.supports_video_scaling = properties.boolget("encoding.video_scaling", self.supports_video_scaling)
self.video_subregion.supported = properties.boolget("encoding.video_subregion", VIDEO_SUBREGION) and VIDEO_SUBREGION
self.scaling_control = max(0, min(100, properties.intget("scaling.control", self.scaling_control)))
Expand Down Expand Up @@ -1656,7 +1661,7 @@ def do_video_encode(self, encoding, image, options):
image.restride(newstride)
bpp = image.get_bytesperpixel()
scroll_data.update(image.get_pixels(), x, y, w, h, image.get_rowstride(), bpp)
max_distance = min(1000, (100-SCROLL_MIN_PERCENT)*h//100)
max_distance = min(1000, (100-self.scroll_min_percent)*h//100)
scroll_data.calculate(max_distance)
#marker telling us not to invalidate the scroll data from here on:
options["scroll"] = True
Expand All @@ -1665,7 +1670,7 @@ def do_video_encode(self, encoding, image, options):
match_pct = int(100*count/h)
scrolllog("best scroll guess took %ims, matches %i%% of %i lines: %s", (end-start)*1000, match_pct, h, scroll)
#if enough scrolling is detected, use scroll encoding for this frame:
if match_pct>=SCROLL_MIN_PERCENT:
if match_pct>=self.scroll_min_percent:
return self.encode_scrolling(scroll_data, image, options)
except Exception:
scrolllog.error("Error during scrolling detection")
Expand Down

0 comments on commit 7c38aeb

Please sign in to comment.