xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #2056: text-hint-less-video.patch

File text-hint-less-video.patch, 1.5 KB (added by Antoine Martin, 4 years ago)

don't lower videomin when text hint is set

  • xpra/server/window/window_video_source.py

     
    421421        cww = ww & self.width_mask
    422422        cwh = wh & self.height_mask
    423423        video_hint = self.content_type=="video"
     424        text_hint = self.content_type=="text"
    424425
    425426        rgbmax = self._rgb_auto_threshold
    426         videomin = min(640*480, cww*cwh) // (1+video_hint*2)
     427        videomin = cww*cwh // (1+video_hint*2)
    427428        sr = self.video_subregion.rectangle
    428429        if sr:
    429430            videomin = min(videomin, sr.width * sr.height)
    430431            rgbmax = min(rgbmax, sr.width*sr.height//2)
     432        elif not text_hint:
     433            videomin = min(640*480, cww*cwh)
    431434        if pixel_count<=rgbmax or cww<8 or cwh<8:
    432435            return lossless("low pixel count")
    433436
     
    457460                lde = tuple(self.statistics.last_damage_events)
    458461                lim = now-4
    459462                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):
    462464                    return nonvideo(quality+30, "not enough frames")
    463465                lim = now-1
    464466                pixels_last_sec = sum(w*h for when,_,_,w,h in lde if when>lim)