Skip to main content

Module wire

Module wire 

Source
Expand description

The call’s wire format over one Iroh connection: a reliable control stream for the few messages that must arrive, unreliable QUIC datagrams for audio, where a late frame is worth less than nothing, and one unidirectional QUIC stream per video frame, so a keyframe always lands whole and a stale delta can be reset.

Structs§

Frame
Tracks
Which of the two a side is sending.
VideoHeader

Enums§

Control
Control messages, length-prefixed JSON on the bidirectional stream.
VideoCodec
The codec byte in a video frame header. A fixed table, so nothing from the wire is ever handed to a decoder as a string.
VideoKind
The two pictures a side can send at once; a frame’s flags say which it is.

Constants§

CALL_ALPN
HEADER_LEN
Datagram header: sequence, milliseconds since the sender’s media start, flags.
MAX_CONTROL_LEN
MAX_VIDEO_FRAME
A frame bigger than this is refused: the whole connection window is only 2 MB, and a bigger frame would sit in front of the control stream. A crisp 1440p keyframe at the top of the screen ladder is a few hundred kilobytes.
VIDEO_HEADER_LEN
Header on every video frame, on the QUIC stream and on the link alike.
VIDEO_KEY
Video frame flags.
VIDEO_SCREEN

Functions§

pack
read_control
unpack
write_control