xpra icon
Bug tracker and wiki

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

Ticket #328: actual-video-size.patch

File actual-video-size.patch, 2.2 KB (added by Antoine Martin, 8 years ago)

use the correct video size when decoding (hackish solution)

  • xpra/client/window_backing_base.py

    223223        assert x==0 and y==0
    224224        try:
    225225            self._decoder_lock.acquire()
    226             enc_width, enc_height = options.get("scaled_size", (width, height))
     226            #the actual output size (after csc, if any)
     227            out_width, out_height = options.get("video_size", (width, height))
     228            #the encoding size (before csc/scaling)
     229            enc_width, enc_height = options.get("scaled_size", (out_width, out_height))
    227230            colorspace = options.get("csc")
    228231            if not colorspace:
    229232                # Backwards compatibility with pre 0.10.x clients
    256259            if not img:
    257260                raise Exception("paint_with_video_decoder: %s decompression error on %s bytes of picture data for %sx%s pixels, options=%s" % (
    258261                      coding, len(img_data), width, height, options))
    259             self.do_video_paint(img, x, y, enc_width, enc_height, width, height, options, callbacks)
     262            self.do_video_paint(img, x, y, enc_width, enc_height, out_width, out_height, options, callbacks)
    260263        finally:
    261264            self._decoder_lock.release()
    262265        return  False
  • xpra/server/window_video_source.py

    505505                #tell the client about scaling:
    506506                if self._csc_encoder and (enc_width!=width or enc_height!=height):
    507507                    client_options["scaled_size"] = enc_width, enc_height
     508                client_options["video_size"] = (width, height)
    508509            debug("video_encode encoder: %s %sx%s result is %s bytes (%.1f MPixels/s), client options=%s",
    509510                                encoding, enc_width, enc_height, len(data), (enc_width*enc_height/(end-start+0.000001)/1024.0/1024.0), client_options)
    510511            return Compressed(encoding, data), client_options, 0