Mercurial > hg > Applications > tvnjviewer
changeset 19:6886a2e890cc
separate pixelByteArray from AliceVNCMessage
author | sugi |
---|---|
date | Tue, 04 Nov 2014 11:37:09 +0900 |
parents | 80b4d7efba08 |
children | 419ac2f759d5 |
files | src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java |
diffstat | 4 files changed, 14 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java Mon Nov 03 17:14:28 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/AliceVNCMessage.java Tue Nov 04 11:37:09 2014 +0900 @@ -13,7 +13,7 @@ public int width; public int height; public int encodingTypeId; - public byte[] buf; + //public byte[] buf; public int offset; public String name;
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java Mon Nov 03 17:14:28 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/RichCursorDecoder.java Tue Nov 04 11:37:09 2014 +0900 @@ -63,9 +63,11 @@ AliceVNCMessage message = new AliceVNCMessage(); message.setRectangle(rect); - message.buf = buffer.clone(); message.bitmask = bitmask.clone(); - ReceiveData rData = new ReceiveData(message, false, false); + + ReceiveData rData = new ReceiveData(buffer.clone(), false, false); + DataSegment.getLocal().put("pixelByteArray", rData, null); + rData = new ReceiveData(message, false, false); DataSegment.getLocal().put("aliceVNCMessage", rData, null); sb = new StringBuilder(" "); @@ -88,14 +90,13 @@ return (aByte & 1 << 7 - index) > 0; } - public void decode(Renderer renderer, AliceVNCMessage message) + public void decode(Renderer renderer, AliceVNCMessage message, byte[] buffer) throws TransportException { FramebufferUpdateRectangle rect = message.getFramebufferUpdateRectangle(); int bytesPerPixel = renderer.getBytesPerPixel(); int length = rect.width * rect.height * bytesPerPixel; if (0 == length) - return; - byte[] buffer = message.buf; + return; byte[] bitmask = message.bitmask; StringBuilder sb = new StringBuilder(" ");
--- a/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Mon Nov 03 17:14:28 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEDecoder.java Tue Nov 04 11:37:09 2014 +0900 @@ -47,10 +47,11 @@ AliceVNCMessage message = new AliceVNCMessage(); message.setRectangle(rect); - message.buf = bytes.clone(); message.offset = offset; - ReceiveData rData = new ReceiveData(message, false, false); + ReceiveData rData = new ReceiveData(bytes.clone(), false, false); + DataSegment.getLocal().put("pixelByteArray", rData, null); + rData = new ReceiveData(message, false, false); DataSegment.getLocal().put("aliceVNCMessage", rData, null); decode(renderer, rect, bytes, offset); }
--- a/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Mon Nov 03 17:14:28 2014 +0900 +++ b/src/main/java/com/glavsoft/rfb/protocol/ReceiverTask.java Tue Nov 04 11:37:09 2014 +0900 @@ -184,7 +184,10 @@ AliceVNCMessage message = new AliceVNCMessage(); message.setRectangle(rect); message.setPixelFormat(context.getPixelFormat()); - ReceiveData rData = new ReceiveData(message, false, false); + + ReceiveData rData = new ReceiveData("dummy", false, false); + DataSegment.getLocal().put("pixelByteArray", rData, null); + rData = new ReceiveData(message, false, false); DataSegment.getLocal().put("aliceVNCMessage", rData, null); context.sendMessage(new FramebufferUpdateRequestMessage(0, 0, rect.width, rect.height, false));