Greenfield The in-browser Wayland compositor Introduction $ - - PowerPoint PPT Presentation

greenfield
SMART_READER_LITE
LIVE PREVIEW

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


slide-1
SLIDE 1

Greenfield

The in-browser Wayland compositor

slide-2
SLIDE 2

Introduction

  • $ whoami

○ Erik De Rijcke ○ Self employed ; udev.be ○ [ Kotlin, Java ] @ Day ; [ JavaScript, C, … ] @ Night

  • $ which greenfield

○ Wayland compositor ○ JavaScript 😲 ■ ES6 ■ File per class ■ JSDoc type comments ○ WebAssembly ■ Native libraries available in the browser

slide-3
SLIDE 3

What does Greenfield offer?

==

  • Something super awesome!
  • Pure JavaScript and a wee bit of
  • WebAssembly. No plugins required, all

HTML5.

  • A per application remote rendering

solution - but not limited to that...

  • A true cloud ☁ desktop environment
  • A work in progress.

!=

  • A resumable screen forwarding solution à

la VNC/RDP/Citrix

  • Something finished
slide-4
SLIDE 4

First some basic concepts explained

  • A Wayland compositor
  • binary wire protocol
  • also FDs
  • WebRTC
  • p2p communication
  • needs central

signaling/broker

Compositor Wayland App. Peer A Signaling server Peer B

Peer Connection

slide-5
SLIDE 5

How does Greenfield work?

  • Browser

○ Wayland compositor

  • Westfield

○ Underlying library ○ JavaScript protocol generator

  • Application Endpoint

○ Node.js ⇒ Rust? ○ Stateless proxy compositor ○ Libwayland-server fork ○ Forwards to browser or to native libraries ○ Encodes application frames

  • Connection per wayland application

○ WebRTC data channel ○ (WebSocket)

  • Encoded application content

○ h264 ○ jpeg

Browser Compositor

App. Endpoint. App. Endpoint. Wayland App. Wayland App.

C

  • m

p

  • s

i t

  • r
172.16.254.1 2001:db8:0:1234:0:567:8:1 154.19.251.2
slide-6
SLIDE 6

Life of an h264 application frame

  • Need precise

encoding/decoding semantics ○ Video streaming solutions unsuited!

  • Encoding

○ Gstreamer

  • Decoding

○ WebAssembly h264 software decoder

  • Frame rendering is throttled

○ long pipeline ○ full round-trip takes a lot

  • f time
  • Possibility to “parallelize”

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

slide-7
SLIDE 7

Running applications in a web worker*

  • Web worker runs a JavaScript
  • r WebAssemly Wayland app.

○ No network latency ○ Zero copy data transfer ○ All the good stuff!

  • Offscreen WebGL

○ Needs special protocol, much like wl_drm ○

  • App. toolkit

■ Skia WASM ○

  • Apps. to WASM
  • Cloud desktop environment

○ Account based application access ○

  • WebApp. store

  • WebApp. repositories

*work in progress

Browser Compositor

App. Endpoint. App. Endpoint. Wayland App. Wayland App.

C

  • m

p

  • s

i t

  • r
172.16.254.1 2001:db8:0:1234:0:567:8:1 154.19.251.2

JS Client library JS or Wasm Wayland App.

slide-8
SLIDE 8

Demo Time!

slide-9
SLIDE 9

KThxBye!

Contact: Erik De Rijcke: derijcke.erik@gmail.com udev.be BVBA: www.udev.be info@udev.be

You have questions!