Mercurial > hg > Applications > TreeVNC
changeset 613:994a710100fd
add_multicastPut_tileXY
author | anatofuz |
---|---|
date | Fri, 21 Feb 2020 18:20:36 +0900 |
parents | 42ddba3af8b2 |
children | cab01ab88422 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java |
diffstat | 3 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Fri Feb 21 17:23:19 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Fri Feb 21 18:20:36 2020 +0900 @@ -142,16 +142,17 @@ * * keep completed previous rectangle in c0rect, which is possibly none. * at the last or packet full, flush c0rect first, then flush c1rect if it exists - * - * @param rfb + * @param rfb * @param last * @param bytes * @param offset * @param tileW * @param tileH + * @param tileX + * @param tileY */ - public void multicastPut(TreeRFBProto rfb, boolean last, byte[] bytes, int offset, int tileW, int tileH) throws TransportException { + public void multicastPut(TreeRFBProto rfb, boolean last, byte[] bytes, int offset, int tileW, int tileH, int tileX, int tileY) throws TransportException { if (!blocking) return; int span = offset - prevoffset; deflater.setInput(bytes, prevoffset, span); @@ -277,6 +278,7 @@ */ private void flushRectangle(FramebufferUpdateRectangle rect,int pos) { if (rect.width==0) return; + System.out.println("sending broadcast" + rect); c1.putShort(prevC1Offset - 16, (short) rect.x); c1.putShort(prevC1Offset - 14, (short) rect.y); c1.putShort(prevC1Offset - 12, (short) rect.width); @@ -383,11 +385,11 @@ } } if (WifiMulticast) - tileloop.multicastPut(rfbProto, false, bytes, offset, tileWidth, tileHeight); + tileloop.multicastPut(rfbProto, false, bytes, offset, tileWidth, tileHeight, tileX, tileY); } } if (WifiMulticast) - tileloop.multicastPut(rfbProto, true, bytes, offset, 0, 0); + tileloop.multicastPut(rfbProto, true, bytes, offset, 0, 0, 0, 0); } catch (Exception e) { e.printStackTrace(); throw e;
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 21 17:23:19 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Fri Feb 21 18:20:36 2020 +0900 @@ -432,9 +432,9 @@ static public boolean multiasting = true; - public void handleMulticastFrameBufferUpdate(ByteBuffer c1) { + public void handleMulticastFrameBufferUpdate(ByteArrayInputStream c1) { FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); - Reader in = new Reader(new ByteArrayInputStream(c1.array())); + Reader in = new Reader(c1); if (!multiasting) { System.out.println("broadcasting!"); @@ -450,8 +450,8 @@ Decoder decoder = zdecoder; while (numberOfRectangeles-- > 0) { rect.fill(in); + System.out.println("bloadcast rectangle "+rect); if (rect.getEncodingType() == EncodingType.ZRLEE) { - System.out.println(); decoder.decode(in,renderer,rect); if (rfb.getCuiVersion()) continue; repaintController.repaintBitmap(rect);
--- a/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 21 17:23:19 2020 +0900 +++ b/src/main/java/jp/ac/u_ryukyu/treevnc/BroadcastRFBListener.java Fri Feb 21 18:20:36 2020 +0900 @@ -59,7 +59,7 @@ byte[] reply = recvPacket.getData(); if (receiverTask != null) { if (reply[0] == FRAMEBUFFER_UPDATE) { - receiverTask.handleMulticastFrameBufferUpdate(ByteBuffer.wrap(reply,recvPacket.getOffset(), recvPacket.getLength())); + receiverTask.handleMulticastFrameBufferUpdate(new ByteArrayInputStream(reply,recvPacket.getOffset(), recvPacket.getLength())); } } } catch (Exception e) {