Skip to main content

Module protocol

Module protocol 

Source
Available on crate feature ingest only.
Expand description

Reusable protocol scaffolding shared by ingest handlers (RTMP, RTSP, …).

Gated behind ingest. Extracted from sc-protocol-ingest, with the global metrics singleton removed — counters are the caller’s concern.

Modules§

rtmprtmp
A working RTMP InboundProtocol: publish (ingest) and play (egress) over the real Adobe wire protocol.
rtprtsp or webrtc
Shared RTP/RTCP parsing and NAL-codec (de)packetization — RFC 3550 framing plus H.264 (RFC 6184) and H.265 (RFC 7798) payload formats.
rtsprtsp
Native RTSP ingest handler (feature rtsp).
srtsrt
Native SRT ingest handler (feature srt).
webrtcwebrtc
WebRTC WHIP/WHEP ingest & egress signaling with a pluggable crypto transport (feature webrtc).

Structs§

IngestRateLimit
Per-connection sliding-window ingress rate limiter (bytes/second).
KeyframeGate
Gate that suppresses delta frames until the first IDR (keyframe) arrives, so late-joining or re-subscribing clients always start at a clean decoder boundary.
NalStart
A located Annex-B start code within an H.264/H.265 bytestream.

Constants§

MAX_AUDIO_FRAME
Maximum allowed audio frame size (1 MiB).
MAX_VIDEO_FRAME
Maximum allowed video frame size (8 MiB). Frames larger than this should be dropped before parsing so a crafted source cannot exhaust heap memory.

Functions§

find_nal_start
Find the next Annex-B NAL start code (00 00 01 or 00 00 00 01) in buf at or after from.
run_tcp_ingest_server
Generic TCP accept loop shared by RTMP/RTSP handlers.