How Droid VNC works?

烈酒焚心 提交于 2019-12-04 14:00:17

问题


I have install Droid VNC Server on my tablet. I also checkout it's source at http://github.com/oNaiPs/droid-VNC-server but i don't find any line of codes where it capture the screen and upload to Viewer. So, How does it work? How can it capture the Droid's screen?


回答1:


Look in the jni/vnc/ folder. Sure looks like a VNC server to me.




回答2:


It has 3 modes to try and read your screen:

  1. Framebuffer
  2. SurfaceFlinger
  3. Gralloc

I've only tried it on Android x86 and only got the framebuffer mode working. Supposedly 2. and 3. work better if you're on ARM. Basically what that does is directly read the framebuffer device (/dev/graphics/fb0 like on Linux). By read I mean it takes a series of "snapshots" of the screen and sends them to the VNC client as it requests screen updates. The framebuffer device is the layer between where Android writes its screen contents which is then in turn passed through the graphics pipeline to the hardware (graphics display chip -> screen). Think of a framebuffer just being like a frame in a video, a series of frames makes a video, as does a buffer of frames represent the actual dynamically changing contents of the screen.

With regards to input Droid VNC server receives pointer and key events over the network, processes them and then sends them to the /dev/input devices which Android then handles as if they were local keyboard or mouse inputs.



来源:https://stackoverflow.com/questions/12210748/how-droid-vnc-works

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!