Mercurial > hg > Applications > TreeVNC
comparison src/main/java/com/glavsoft/rfb/encoding/decoder/ZRLEESender.java @ 533:4be31e107121
fix bloking
author | riono210 |
---|---|
date | Sun, 05 May 2019 18:32:55 +0900 |
parents | fcd833c2e148 |
children | ac8fd355b8bb |
comparison
equal
deleted
inserted
replaced
532:9292035b8d93 | 533:4be31e107121 |
---|---|
1 package com.glavsoft.rfb.encoding.decoder; | 1 package com.glavsoft.rfb.encoding.decoder; |
2 | 2 |
3 import java.io.UnsupportedEncodingException; | 3 import java.io.UnsupportedEncodingException; |
4 import java.nio.ByteBuffer; | 4 import java.nio.ByteBuffer; |
5 | 5 |
6 import com.glavsoft.rfb.protocol.NullRenderer; | |
6 import jp.ac.u_ryukyu.treevnc.TreeRFBProto; | 7 import jp.ac.u_ryukyu.treevnc.TreeRFBProto; |
7 | 8 |
8 import com.glavsoft.drawing.Renderer; | 9 import com.glavsoft.drawing.Renderer; |
9 import com.glavsoft.exceptions.TransportException; | 10 import com.glavsoft.exceptions.TransportException; |
10 import com.glavsoft.rfb.encoding.EncodingType; | 11 import com.glavsoft.rfb.encoding.EncodingType; |
32 ZRLEDecoder decoder = new ZRLEDecoder(); | 33 ZRLEDecoder decoder = new ZRLEDecoder(); |
33 if (rect.getEncodingType() == EncodingType.ZRLE) { | 34 if (rect.getEncodingType() == EncodingType.ZRLE) { |
34 // ReadSendData convert ZRLE to ZRLEE | 35 // ReadSendData convert ZRLE to ZRLEE |
35 // unzipped data in the bytes | 36 // unzipped data in the bytes |
36 byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; | 37 byte[] bytes = new byte[rect.width * rect.height * renderer.getBytesPerPixel()]; |
37 ByteBuffer header = rfb.readSendData(dataLen, reader, bytes, rect); | 38 if (rfb.multicastBlocking) { |
38 decoder.decode1(renderer, header, rect, bytes, 0, rfb); | 39 decoder.multicastDecode(reader, renderer, rect, rfb); |
40 } else { | |
41 ByteBuffer header = rfb.readSendData(dataLen, reader, bytes, rect); | |
42 decoder.decode1(renderer, header, rect, bytes, 0, rfb); | |
43 } | |
39 return; | 44 return; |
40 } else { | 45 } else { |
41 // no reencoding is required | 46 // no reencoding is required |
42 // readSend does not peform unzip, do the fullrecoding | 47 // readSend does not peform unzip, do the fullrecoding |
43 rfb.readSendData(dataLen, reader, null, rect); | 48 rfb.readSendData(dataLen, reader, null, rect); |
49 } | 54 } |
50 decoder.decode(reader, renderer, rect); | 55 decoder.decode(reader, renderer, rect); |
51 return; | 56 return; |
52 } | 57 } |
53 } | 58 } |
54 byte[] bytes = new byte[dataLen]; | 59 if (rfb.multicastBlocking) { |
55 rfb.readSendData(dataLen, reader, bytes, rect); | 60 // do something |
61 ZRLEDecoder decoder = new ZRLEDecoder(); | |
62 decoder.multicastDecode(reader, renderer, rect, rfb); | |
63 } else { | |
64 byte[] bytes = new byte[dataLen]; | |
65 rfb.readSendData(dataLen, reader, bytes, rect); | |
66 } | |
56 } | 67 } |
57 | 68 |
58 private int getZrleLength(FramebufferUpdateRectangle rect, Reader reader) | 69 private int getZrleLength(FramebufferUpdateRectangle rect, Reader reader) |
59 throws TransportException { | 70 throws TransportException { |
60 int zrleLength = 0; | 71 int zrleLength = 0; |