pub struct RtmpHandler { /* private fields */ }ingest and rtmp only.Expand description
RTMP protocol handler. One instance serves an address; each connection is an independent publish or play session.
Publish (ingest) works through the InboundProtocol
contract alone — the IngestContext handed to
serve carries the publish registry. Play
(egress) additionally needs read access to live streams, which the ingest
context does not provide, so supply a PlaybackRegistry via
with_playback (the bundled Engine
implements both). Without it, play requests are answered with a failure status.
Implementations§
Source§impl RtmpHandler
impl RtmpHandler
Sourcepub fn new(addr: SocketAddr) -> Self
pub fn new(addr: SocketAddr) -> Self
Create a handler bound to addr (typically 0.0.0.0:1935).
Sourcepub fn max_connections(self, max: usize) -> Self
pub fn max_connections(self, max: usize) -> Self
Cap the number of concurrent connections (default 1024).
Sourcepub fn with_playback(self, playback: Arc<dyn PlaybackRegistry>) -> Self
pub fn with_playback(self, playback: Arc<dyn PlaybackRegistry>) -> Self
Enable play (egress) by providing a PlaybackRegistry to resolve live
streams from. Pass the same engine you publish into.
Trait Implementations§
Source§impl InboundProtocol for RtmpHandler
RtmpHandler is the reference InboundProtocol
implementation: a real-world template for the multi-protocol ingestion
architecture. It owns a TCP listener via
run_tcp_ingest_server, performs the
RTMP handshake per connection, and bridges FLV AVC/AAC onto the bus through the
IngestContext’s registry — exactly the shape
an RTSP, SRT, or WHIP worker would take.
impl InboundProtocol for RtmpHandler
RtmpHandler is the reference InboundProtocol
implementation: a real-world template for the multi-protocol ingestion
architecture. It owns a TCP listener via
run_tcp_ingest_server, performs the
RTMP handshake per connection, and bridges FLV AVC/AAC onto the bus through the
IngestContext’s registry — exactly the shape
an RTSP, SRT, or WHIP worker would take.