libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.22k stars 1.86k forks source link

RFE: remote desktop protocol support #6831

Open stsp opened 1 year ago

stsp commented 1 year ago

Hi guys.

Have you considered the support of VNC or SPICE protocols? Both of them have remote framebuffer, that can be a video output for sdl. Both has input events, and SPICE also has audio remoting support. VNC also has unofficial audio extensions. So today's remote desktop protocols have everything that SDL needs to function. With such functionality, any "local" sdl app can be trivially converted to the "remote" app, accessible by either vncviewer or spiceviewer. How difficult would it be to support something like that?

stsp commented 1 year ago

https://gitlab.freedesktop.org/spice/x11spice/-/blob/master/src/spice.c x11spice is a sample application that captures x11 display output and forwards it to spice server, which then forwards it to client. It installs listeners for display events, keyboard and tablet (mouse) to receive display configuration events (resize etc I suppose) and input events. https://gitlab.freedesktop.org/spice/x11spice/-/blob/master/src/scan.c Here it can be seen how x11 shm images are converted into spice drawables. I think this gives a rough overview (and perhaps a source of code porting), except that the audio remoting is not here.

icculus commented 1 year ago

This is an interesting idea, and probably worth exploring once we aren't buried under the initial SDL3 work (but we'll definitely take a pull request if someone else wants to explore this before we can get to it).