porting VNC viewer to PalmPilot: some open questions...

Tristan Richardson tjr "at" orl.co.uk
Fri, 06 Mar 1998 18:41:49 +0000


> I'm thinking to build a version of VNC viewer for 3Com PalmPilot Pro.

Excellent!

> I took a look on C sources of the viewer and would say that it sounds quite
> promising.
> 
> The only problem I currenly see is the HUGE buffer statically allocated
> in the viewer:
> 
> /* note that the CoRRE encoding uses this buffer and assumes it is big enough
>    to hold 255 * 255 * 32 bits -> 260100 bytes.  640*480 = 307200 bytes */
> /* also hextile assumes it is big enough to hold 16 * 16 * 32 bits */
> 
> #define BUFFER_SIZE (640*480)
> static char buffer[BUFFER_SIZE];
> 

This shouldn't be a problem.  Firstly you don't need to bother dealing with
CoRRE - you only really need raw, hextile and CopyRect.  Also you will always
be requesting 8-bit pixels because any more colour information would only be
thrown away.  So hextile only needs the buffer to be 16 * 16 * 1 = 256 bytes!

However what it should also say in the comment is that the code for raw
assumes that the buffer is big enough to hold a whole line, so strictly
speaking that's 64K bytes.  In practice you can probably limit this to say 2K,
(viewing a desktop more than 2K in width on a pilot is probably not going to
be sensible!)

You should find the code for a pilot viewer substantially simpler than the X
viewer.  The main complexity in the X viewer code is having to cope with all
the different pixel formats that an X server can throw at you.  For the pilot,
you only need to consider a single pixel format, which you can choose.  Pixel
depths less than 8-bits aren't properly specified in the protocol yet, so the
best format to choose is the 8-bit "BGR233" format which I use in the java
viewer - the servers have translators for this particular format which are
optimised.

Let me know if you need any more help on this - being a Pilot user myself I'd
really like to see a VNC viewer for it.

Cheers

Tristan

+--------------------------------------------------------------------+
|  Tristan Richardson                 Email:  tjr "at" orl.co.uk          |
|  ORL                                  Tel:  +44 1223 343000        |
|  24a Trumpington Street               Fax:  +44 1223 313542        |
|  Cambridge, CB2 1QA, UK               WWW:  http://www.orl.co.uk/  |
+--------------------------------------------------------------------+
|          ORL - The Olivetti & Oracle Research Laboratory           |
+--------------------------------------------------------------------+