Mercurial > hg > Members > nobuyasu > tightVNCProxy
diff src/myVncProxy/MyRfbProto.java @ 78:5970410efee7
modify VncProxyService. EncodingRAW -> EncodingZlib
author | e085711 |
---|---|
date | Fri, 29 Jul 2011 19:17:31 +0900 |
parents | fe5925bb9a7e |
children | 712a047908df 762d2b7f1db2 |
line wrap: on
line diff
--- a/src/myVncProxy/MyRfbProto.java Thu Jul 28 18:03:26 2011 +0900 +++ b/src/myVncProxy/MyRfbProto.java Fri Jul 29 19:17:31 2011 +0900 @@ -141,30 +141,22 @@ cliListTmp.add(sock); } - void mark(int len) throws IOException { - is.mark(len); - } - - void reset() throws IOException { - is.reset(); - } - boolean markSupported() { return is.markSupported(); } void readServerInit() throws IOException { - mark(255); + is.mark(255); skipBytes(20); int nlen = readU32(); int blen = 20 + 4 + nlen; initData = new byte[blen]; - reset(); + is.reset(); - mark(blen); + is.mark(blen); readFully(initData); - reset(); + is.reset(); framebufferWidth = readU16(); framebufferHeight = readU16(); @@ -302,7 +294,7 @@ } void bufResetSend(int size) throws IOException { - reset(); + is.reset(); int len = size; if (available() < size) len = available(); @@ -313,7 +305,7 @@ void regiFramebufferUpdate() throws IOException { - mark(20); + is.mark(20); messageType = readU8(); skipBytes(1); rectangles = readU16(); @@ -322,9 +314,10 @@ rectW = readU16(); rectH = readU16(); encoding = readU32(); + System.out.println("encoding = "+encoding); if (encoding == 16) zLen = readU32(); - reset(); + is.reset(); /* int dataLen; switch (encoding) { @@ -360,11 +353,11 @@ switch (encoding) { case RfbProto.EncodingRaw: dataLen = rectW * rectH * 4 + 16; - mark(dataLen); + is.mark(dataLen); break; case RfbProto.EncodingCopyRect: dataLen = 16 + 4; - mark(dataLen); + is.mark(dataLen); break; case RfbProto.EncodingRRE: case RfbProto.EncodingCoRRE: @@ -373,11 +366,19 @@ case RfbProto.EncodingTight: case RfbProto.EncodingZRLE: dataLen = zLen + 20; - mark(dataLen); + is.mark(dataLen); + break; + case RfbProto.EncodingXCursor: + case RfbProto.EncodingRichCursor: + int pixArray = rectW * rectH * 4; + int u8Array = (int)Math.floor((rectW + 7)/8) * rectH; + dataLen = pixArray + u8Array; + printFramebufferUpdate(); + is.mark(dataLen); break; default: dataLen = 1000000; - mark(dataLen); + is.mark(dataLen); } return dataLen; } @@ -386,7 +387,7 @@ byte buffer[] = new byte[dataLen]; readFully(buffer); multicastqueue.put(buffer); - reset(); + is.reset(); /* for (Socket cli : cliList) { @@ -469,6 +470,8 @@ System.out.println("messageType=" + messageType); System.out.println("rectangles=" + rectangles); System.out.println("encoding=" + encoding); + System.out.println("rectX = "+rectX+": rectY = "+rectY); + System.out.println("rectW = "+rectW+": rectH = "+rectH); switch (encoding) { case RfbProto.EncodingRaw: System.out.println("rectW * rectH * 4 + 16 =" + rectW * rectH * 4