Mercurial > hg > Members > riono > TreeVNC_ja_comment
changeset 493:6f21b6176984
change inflate_size
author | oshiro |
---|---|
date | Fri, 01 Feb 2019 18:34:58 +0900 |
parents | 57e0d052b126 |
children | 7007d9785737 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java |
diffstat | 2 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 01 16:45:56 2019 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java Fri Feb 01 18:34:58 2019 +0900 @@ -26,7 +26,6 @@ // TreeVNC handling int dataLen = getZrleLength(rect, reader); byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; -// byte[] bytes = new byte[renderer.getWidth() * renderer.getHeight() * renderer.getBytesPerPixel()]; reader.reset(); if (rfb.hasViewer()) { ZRLEDecoder decoder = new ZRLEDecoder();
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Feb 01 16:45:56 2019 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/TreeRFBProto.java Fri Feb 01 18:34:58 2019 +0900 @@ -726,10 +726,9 @@ * @throws TransportException * @throws UnsupportedEncodingException */ - public void blockedReadSendData(int dataLen, Reader reader, byte[] bytes, FramebufferUpdateRectangle rect) + public void blockedReadSendData(int dataLen, Reader reader, byte[] bytes, FramebufferUpdateRectangle rect ,int bytePerPixel) throws TransportException, UnsupportedEncodingException { LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); - int BLOCKSIZE = 64 * 1024; int headerLen = rect.getEncodingType() == EncodingType.CHECK_DELAY ? 24 : 16; ByteBuffer header = multicastqueue.allocate(headerLen); ByteBuffer serial = multicastqueue.allocate(4 + 8); @@ -762,8 +761,9 @@ // protocol, clients have to be modified. Deflater nDeflater = deflater; // new Deflater(); LinkedList<ByteBuffer> out = new LinkedList<ByteBuffer>(); + int inflate_size = INFLATE_BUFSIZE - INFLATE_BUFSIZE % (rect.width * bytePerPixel); try { - unzip(inflater, inputs, 0, bytes, INFLATE_BUFSIZE); + unzip(inflater, inputs, 0, bytes, inflate_size); // dump32(inputs); out.add(ByteBuffer.wrap(bytes)); int len2 = 0;