net/quinn: Add support for WebTransport
This MR adds support for WebTransport, a new web API that allows for low-level, bidirectional communication between a client and a server, available in the browser as an alternative to HTTP and WebSockets.
The following 2 new elements have been created:
- quinnwtserversink: Acts as a WebTransport server allowing to stream to a WebTransport client (the client can be a browser or a GStreamer app)
- quinnwtclientsrc: Acts as a WebTransport client and it can be used to test the server.
The implementation uses the web_transport_quinn crate, which in turn uses the quinn
crate. For this reason, we decided to include the new elements in the quinn
plugin.
Design choices:
- The sink element always acts as a WebTransport server.
- The sink element blocks in
start
until a new connection is made. - When working with streams instead of datagrams, the server creates the connection, which is bi-directional to support upstream events in the future.
- A secure connection is always required.
Usage:
gst-launch-1.0 quinnwtclientsrc url="https://localhost:4445" certificate-file=net/quinn/tests/certs/localhost.crt caps=audio/x-opus ! opusparse ! opusdec ! audioconvert ! autovideosink
gst-launch-1.0 audiotestsrc is-live=true ! opusenc ! quinnwtserversink address=127.0.0.1 port=4445 certificate-file=net/quinn/tests/certs/localhost.crt private-key-file=net/quinn/tests/certs/localhost.key
Missing features
The following features are missing:
- allowPolling: the server only supports one session per connection.
- requireUnreliable: there is no fallback to establish a connection over HTTP/2
- congestionControl: congestion control can't be configured
This work was started during the GStreamer hackfest and has been co-authored with @rgonzalez.
cc: @SanchayanMaity
Edited by Andoni Morales Alastruey