Extend MousePadPlugin to see the screen under the mouse pointer

Bernhard Übelacker bernhardu at vr-web.de
Tue Dec 16 19:33:17 UTC 2014


Hello List,

 Am 16.12.2014 um 08:38 schrieb Albert Vaca:
> However, I would try to change the way yo send the images, because
> base64-encode every image and send that as text doesn't seem very
> efficient. A better way to do it would be to establish a connection
> using a socket just for that, where you could keep "streaming" the image
> data in binary format. It can be a bit challenging technologically, but
> do you think you could implement something like that? If you want to use
> it, the "setPayload" option of the NetworkPackage class automatically
> establishes the socket connection for you and you only have to write
> through it.

Once I did not base64-encode it and attached it to np with setPayload.
But that was not relieable for me.

I noticed now that: mPayloadSize; } //-1 means it is an endless stream
--> that means the connection will stay open and do all the work for me?

And when image sizes became too huge the movements delayed significantly.
That would probably also better with a separate socket.



Am 16.12.2014 um 08:38 schrieb Albert Vaca:
> Another good optimization would be to compress the image before sending
> it, so we don't send a image unnecessarily big.

Therefore I wanted also to avoid the base64 encoding, and therefore
I did use the PNG format.



Am 16.12.2014 um 11:19 schrieb rahil momin:> Hey,
> VNC does this already, so we can look into how they handle streaming the
> images/videos on the network, which is pretty efficient.

VNC came to my mind too, I thought using it on kde side would be no
problem, but on android there would be a third party library needed.
But if we do not want to link against a vnc library (at least a vnc app in fdroid
exists) then probably the screen capturing could be done by it.



Am 16.12.2014 um 17:06 schrieb Allen Webb:
> I would recommend looking at how it is done for remote desktop clients.
> It might make sense to send the whole screen once and paint changes over
> it. Also you could look into lowering the color depth. There might be
> code you could use from krdc.

As I tested it with a phone with a small screen I did not want to
transmit the whole screen if not needed.
Also I wanted to resize it already on kde side/before transmission.
Right now only if the complete region is unchanged it is not retransmitted.
I needed to split it for transfer already, so splitting it
with the possibility to avoid transmits would be preferable.



OK, thank you all for your feedback.
I will try to put some more time into it.



TODO:
- optimize transport
- check scroll events
  (is change to MinDistanceToSendScroll acceptable?)
  (still some not wanted scroll events when zooming.)
- reverse direction of mouse movement (make it optional)
- draw some kind of mouse pointer on android
- make the screen transmission optional (probably per session)
- could some vnc library used for one or all of
  screen capturing/tiling/cache handling/transmission?
- colour depth selectable?


More information about the KDEConnect mailing list