Greenfield
The in-browser Wayland compositor
Greenfield The in-browser Wayland compositor Introduction $ - - PowerPoint PPT Presentation
Greenfield The in-browser Wayland compositor Introduction $ whoami Erik De Rijcke Self employed ; udev.be [ Kotlin, Java ] @ Day ; [ JavaScript, C, ] @ Night $ which greenfield Wayland compositor
The in-browser Wayland compositor
Introduction
○ Erik De Rijcke ○ Self employed ; udev.be ○ [ Kotlin, Java ] @ Day ; [ JavaScript, C, … ] @ Night
○ Wayland compositor ○ JavaScript 😲 ■ ES6 ■ File per class ■ JSDoc type comments ○ WebAssembly ■ Native libraries available in the browser
What does Greenfield offer?
==
HTML5.
solution - but not limited to that...
!=
la VNC/RDP/Citrix
First some basic concepts explained
signaling/broker
Compositor Wayland App. Peer A Signaling server Peer B
Peer Connection
How does Greenfield work?
○ Wayland compositor
○ Underlying library ○ JavaScript protocol generator
○ Node.js ⇒ Rust? ○ Stateless proxy compositor ○ Libwayland-server fork ○ Forwards to browser or to native libraries ○ Encodes application frames
○ WebRTC data channel ○ (WebSocket)
○ h264 ○ jpeg
Browser Compositor
App. Endpoint. App. Endpoint. Wayland App. Wayland App.
C
p
i t
Life of an h264 application frame
encoding/decoding semantics ○ Video streaming solutions unsuited!
○ Gstreamer
○ WebAssembly h264 software decoder
○ long pipeline ○ full round-trip takes a lot
pipeline ○ hard to predict speed of frame in pipeline
Wayland Buffer with alpha channel Encoded image YUV Encoded image YUV Decoded image YUV HTML5 Canvas (back-buffer) Encoded image A Encoded image A Decoded image A HTML5 ImageBitmap HTML5 Canvas (front-buffer) WebGL Alpha & Color Conversion GStreamer Network WASM h264 decoder requestAnimationFrame
Commit frame
Running applications in a web worker*
○ No network latency ○ Zero copy data transfer ○ All the good stuff!
○ Needs special protocol, much like wl_drm ○
■ Skia WASM ○
○ Account based application access ○
○
*work in progress
Browser Compositor
App. Endpoint. App. Endpoint. Wayland App. Wayland App.
C
p
i t
JS Client library JS or Wasm Wayland App.
KThxBye!
Contact: Erik De Rijcke: derijcke.erik@gmail.com udev.be BVBA: www.udev.be info@udev.be