selkies-project / selkies-gstreamer

Open-Source Low-Latency Accelerated Linux WebRTC HTML5 Remote Desktop Streaming Platform for Self-Hosting, Containers, Kubernetes, or Cloud/HPC
Mozilla Public License 2.0
330 stars 48 forks source link

[META] Implement chunked transport for WebRTC DataChannel / Image Clipboards #74

Open ehfd opened 1 year ago

ehfd commented 1 year ago

The issue #43 has been patched by #73, but the core issue is that there is no graceful handling for a DataChannel message which is above the size of 65535 bytes.

Therefore, it would be VERY useful to implement chunked messages for DataChannels, as the benefit can be applicable to any workload which can use DataChannel messages between the client and server using WebRTC.

If implemented, remove the restrictions placed by: https://github.com/selkies-project/selkies-gstreamer/blob/1f2070b4f93155ad65431d822c49c6b086504c88/src/selkies_gstreamer/gstwebrtc_app.py#L758

Moreover, more diverse formats of clipboards (including images) can be supported, but is not practical unless chunked DataChannels are implemented. xclip provides this capability explicitly but has been sidelined in favor to xsel because of a long-standing bug. It should be manually parsed to base64 with the image type and reconstruct it in either side.

ehfd commented 5 months ago

https://groups.google.com/g/discuss-webrtc/c/f3dfmu3oh00