node-x11
node-x11 copied to clipboard
Is there share memory functions to get display canvas data like xcb_shm?
Is there share memory functions to get display canvas data like xcb_shm?
no, shm extensions is not implemnted yet. It's relatively straightforward at protocol level, but I need to check what is the status of shm addons for node
https://www.npmjs.com/browse/keyword/shm
http://www.x.org/releases/X11R7.7/doc/xextproto/shm.txt
DRI might be more useful - it serves similar purpose: you ask server to allocate region of video memory for you and then write to it directly bypassing server and serialisation ( similar to shm works only locally of course ) - also on my TODO list - http://www.x.org/releases/X11R7.7/doc/dri2proto/dri2proto.txt
Thanks for your reply, and I will check DRI and node shm later. In my application, I must get display flow with low latency, and send it to another process to compress and publish. I think I could add some code to Xorg to implement mmap file to work with node, this may be a just passable way.
what are you displaying? One easy option would be to wrap external application, see example in https://github.com/sidorares/node-x11/blob/master/examples/simple/embed.js For example you can embed mplayer via -wid [parent id]
command line parameter and stream some dynamic data to it
I want to render x11 window to a client browser, just like x11 architecture but use browser as xserver, but not total same as x11 arch, let me use a picture to explain.
In one word, I want to make a software which uses browser as display and uses browser tab as window manager to run remote software.
I need to send mouse and keyboard event to app server and the proxy is writen by node(in order to fit with socket.io in websocket server). Now the xserver changed bitmap is send by another domain sock to proxy, and proxy compress it and send it to websocket server. In this issue, I think if node-x11 has shm functions, there is no need to use another domain socket and reduce the complexity of it.
I am a totally newbie of x11 and node, and say sorry if my question is naive in this area. So do you have any advices or suggestions on it?
similar to https://github.com/ttaubert/x-server-js or https://github.com/GothAck/javascript-x-server ?
not sure how shm could help you as you going to serialise communication over websockets
Thank you, I have already studied the 2 projects above, the difference is that I use original xorg as xserver, but not rewrite a new xserver in js, so I need to get rendered bitmap from xorg, Currently, I use xcb functions to get image from shm, but it must be copied to proxy. So I am looking for ways to get image directlly in proxy.
so it's more like RDP or VNC viewer in the browser?
Yes, just like VNC, but only render one application window nor the desktop.
"-id windowid" in http://www.karlrunge.com/x11vnc/x11vnc_opts.html
really helpful! I'll look into it, thanks again!
Sounds like VNC may be the best option for you, but I've had to solve a similar problem and looked a bit into Crouton, which is the project for ChromeOS that lets you run X11. It packs up X11 to run over a websocket. Unfortunately the code for it is very ChromeOS-specific, but it may be something to look into.
@polpo very interesting