sudo apt-get install libtool
sudo apt-get install vncviewer
wget https://github.com/LibVNC/libvncserver/archive/LibVNCServer-0.9.11.tar.gz
tar xvf LibVNCServer-0.9.11.tar.gz
cd LibVNCServer-0.9.11
./autogen.sh
./configure
make
cd examples
./camera
vncviewer localhost
最近编辑记录 落雁 (2018-02-15 12:07:54)
离线
短短几行代码就可以构建一个简单的 vnc 服务端程序:
https://libvnc.github.io/
#include <rfb/rfb.h>
int main(int argc,char** argv)
{
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);
server->frameBuffer=malloc(400*300*4);
rfbInitServer(server);
rfbRunEventLoop(server,-1,FALSE);
return(0);
}
离线
#include <rfb/rfb.h>
int main(int argc,char** argv)
{
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4);
server->frameBuffer=malloc(400*300*4);
rfbInitServer(server);
rfbRunEventLoop(server,-1,FALSE);
return(0);
}
如果你不想下载编译 libvncserver 的源码,那么直接执行下面的安装命令也可以:
sudo apt-get install libvncserver-dev
gcc -o test test.c -lvncserver -lpthread -lgnutls -lgcrypt -lz -ljpeg -lresolv
短短几行代码实现一个vnc server.
最近编辑记录 落雁 (2018-02-15 15:51:50)
离线
离线
https://github.com/ponty/framebuffer-vncserver
我现在用这个 demo 在 ubuntu 跑起来 demo
但是不能输入:
firstman@ubuntu:/opt/framebuffer-vncserver/build$ sudo ./framebuffer-vncserver
Initializing framebuffer device /dev/fb0...
xres=800, yres=600, xresv=2048, yresv=1920, xoffs=0, yoffs=0, bpp=32
offset:length red=16:8 green=8:8 blue=0:8
No touch device
Initializing VNC server:
width: 800
height: 600
bpp: 32
port: 5900
Initializing server...
24/08/2019 11:08:40 Listening for VNC connections on TCP port 5900
24/08/2019 11:08:40 Listening for VNC connections on TCP6 port 5900
24/08/2019 11:16:22 Got connection from client 192.168.1.189
24/08/2019 11:16:22 other clients:
24/08/2019 11:16:22 Normal socket connection
24/08/2019 11:16:22 Client Protocol Version 3.3
24/08/2019 11:16:22 Protocol version sent 3.3, using 3.3
24/08/2019 11:16:23 Pixel format for client 192.168.1.189:
24/08/2019 11:16:23 32 bpp, depth 32, little endian
24/08/2019 11:16:23 true colour: max r 31 g 31 b 31, shift r 0 g 5 b 10
24/08/2019 11:16:23 no translation needed
24/08/2019 11:16:23 rfbProcessClientNormalMessage: ignoring unsupported encoding type Enc(0x00000003)
24/08/2019 11:16:23 Using hextile encoding for client 192.168.1.189
请问楼主, No touch device 如何解决?
代码在这里: https://github.com/ponty/framebuffer-vncserver/blob/master/src/framebuffer-vncserver.c
最近编辑记录 firstman (2019-08-24 11:41:09)
离线