Mercurial > hg > Applications > TreeVNC
changeset 572:a0eeba3ee5d4
make bytes test routine
author | riono |
---|---|
date | Thu, 06 Feb 2020 20:02:19 +0900 |
parents | 1dd4eea9f566 |
children | 4636bbd2e1f7 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/Protocol.java src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 4 files changed, 17 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Thu Feb 06 17:33:58 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Thu Feb 06 20:02:19 2020 +0900 @@ -51,6 +51,7 @@ private int prevC1LineOffset; private int prevoffset; private Deflater deflater; + private int flushOffset; /** * Multicast framebufferUpdate to children. @@ -76,6 +77,7 @@ public TileLoop(TreeRFBProto rfb, int offset) { prevoffset = prevLineOffset = offset; prevC1Offset = 0; + flushOffset = 0; if (rfb == null || offset < deflate_size + spanGap) { // packet size fit in broadcast send it all at once blocking = false; @@ -92,7 +94,7 @@ if (!blocking) { deflater.setInput(bytes, 0, prevoffset); deflater.deflate(c1); - flushMuticast(rfb); + flushMuticast(rfb, bytes); } return; } @@ -164,14 +166,14 @@ output = deflater.deflate(c1, Deflater.FULL_FLUSH); prevoffset = offset; flushRectangle(rect); - flushMuticast(rfb); + flushMuticast(rfb, bytes); if (!last) { newMulticastPacket(rfb, rect); deflater.deflate(c1, Deflater.NO_FLUSH); } else { deflater.deflate(c1, Deflater.NO_FLUSH); deflater.finish(); - flushMuticast(rfb); + flushMuticast(rfb, bytes); } return ; } @@ -223,14 +225,15 @@ width = 0; } - private void flushMuticast(TreeRFBProto rfb) { + private void flushMuticast(TreeRFBProto rfb, byte[] checkBytes) { c1.flip(); //System.out.println("multicastPut: " + c1rect + " length: " + (c1.remaining()-c1headerPos-header.limit())); deflater.reset(); LinkedList<ByteBuffer> bufs = new LinkedList<ByteBuffer>(); bufs.add(c1); - rfb.getContext().checkFrameBufferRectanble(c1); + rfb.getContext().checkFrameBufferRectanble(c1, checkBytes, flushOffset, prevoffset); + flushOffset = prevoffset; if (rfb.isTreeManager() && rfb.connectionPresenter.isUseMulticast()) { for (ByteBuffer buf : bufs) rfb.getViewer().getRfbBroadcastListener().multicastUpdateRectangle(buf);
--- a/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Feb 06 17:33:58 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/Protocol.java Thu Feb 06 20:02:19 2020 +0900 @@ -338,8 +338,8 @@ } @Override - public void checkFrameBufferRectanble(ByteBuffer c1) { - receiverTask.checkFrameBufferRectanble(c1); + public void checkFrameBufferRectanble(ByteBuffer c1, byte[] checkBytes, int flushOffset, int flushEnd) { + receiverTask.checkFrameBufferRectanble(c1, checkBytes, flushOffset, flushEnd); } @Override
--- a/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Thu Feb 06 17:33:58 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ProtocolContext.java Thu Feb 06 20:02:19 2020 +0900 @@ -88,9 +88,9 @@ boolean isRunning(); - void checkFrameBufferRectanble(ByteBuffer c1); + void checkFrameBufferRectanble(ByteBuffer c1, byte[] checkBytes, int flushOffset, int prevoffset); - /** + /** * TreeVNC expension command (server to client) * 0 : command byte * 1-3 : padding
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 06 17:33:58 2020 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Thu Feb 06 20:02:19 2020 +0900 @@ -373,7 +373,7 @@ sendFrameBufferUpdateRequest(); } - public void checkFrameBufferRectanble(ByteBuffer c1) { + public void checkFrameBufferRectanble(ByteBuffer c1, byte[] checkBytes, int flushOffset, int flushEnd) { FramebufferUpdateRectangle rect = new FramebufferUpdateRectangle(); Reader in = new Reader(new ByteArrayInputStream(c1.array())); try { @@ -395,6 +395,10 @@ } } + private void CompairBytes(Byte[] checkBytes, int flushOffset, int flushEnd) { + + } + private void setScreenParameter(FramebufferUpdateRectangle rect,int singleWidth ,int singleHeight) { ViewerInterface v = rfb.getViewer(); ConnectionPresenter cp = v.getConnectionPresenter();