pub struct RtmpHandler { /* private fields */ }Available on crate features
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 ProtocolHandler
contract alone. Play (egress) additionally needs read access to live streams,
which run 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 ProtocolHandler for RtmpHandler
impl ProtocolHandler for RtmpHandler
Source§fn run<'life0, 'async_trait>(
&'life0 self,
registry: Arc<dyn PublishRegistry>,
shutdown: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run<'life0, 'async_trait>(
&'life0 self,
registry: Arc<dyn PublishRegistry>,
shutdown: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start accepting connections. Implementations should run until the
provided
shutdown token is cancelled, resolving incoming connections
to a StreamKey and forwarding frames through
registry.Auto Trait Implementations§
impl !RefUnwindSafe for RtmpHandler
impl !UnwindSafe for RtmpHandler
impl Freeze for RtmpHandler
impl Send for RtmpHandler
impl Sync for RtmpHandler
impl Unpin for RtmpHandler
impl UnsafeUnpin for RtmpHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more