Ticket #2056: text-hint-less-video.patch
File text-hint-less-video.patch, 1.5 KB (added by , 4 years ago) |
---|
-
xpra/server/window/window_video_source.py
421 421 cww = ww & self.width_mask 422 422 cwh = wh & self.height_mask 423 423 video_hint = self.content_type=="video" 424 text_hint = self.content_type=="text" 424 425 425 426 rgbmax = self._rgb_auto_threshold 426 videomin = min(640*480, cww*cwh)// (1+video_hint*2)427 videomin = cww*cwh // (1+video_hint*2) 427 428 sr = self.video_subregion.rectangle 428 429 if sr: 429 430 videomin = min(videomin, sr.width * sr.height) 430 431 rgbmax = min(rgbmax, sr.width*sr.height//2) 432 elif not text_hint: 433 videomin = min(640*480, cww*cwh) 431 434 if pixel_count<=rgbmax or cww<8 or cwh<8: 432 435 return lossless("low pixel count") 433 436 … … 457 460 lde = tuple(self.statistics.last_damage_events) 458 461 lim = now-4 459 462 pixels_last_4secs = sum(w*h for when,_,_,w,h in lde if when>lim) 460 text_hint = self.content_type=="text" 461 if pixels_last_4secs<((3+text_hint*3)*videomin): 463 if pixels_last_4secs<((3+text_hint*6)*videomin): 462 464 return nonvideo(quality+30, "not enough frames") 463 465 lim = now-1 464 466 pixels_last_sec = sum(w*h for when,_,_,w,h in lde if when>lim)