pub struct RtmpHandler<RW: AsyncRead + AsyncWrite + Unpin>(/* private fields */);
Expand description
The default RTMP handler.
This handles the raw RTMP by well-known communication steps. That is, this performs just following steps.
- Specifies the application name via the
Connect
command. - Specifies the playpath via the
ReleaseStream
/FcPublish
command. - Requests a message ID via the
CreateStream
command. - Specifies publication informations via the
Publish
command. - Then sends FLV media data.
If receiving data size exceeds client’s bandwidth, this reports its thing via the Acknowledgement
message to its server.
And if some error occurs in any step, sends commands which are FcUnpublish
and DeleteStream
to its server, then terminates its connection.
These perform to delete the playpath and a message ID from its context.
However also these can be sent from servers.
§Examples
use std::marker::PhantomData;
use sheave_core::handlers::{
RtmpContext,
VecStream
};
use sheave_client::{
Client,
handlers::RtmpHandler,
};
let stream = VecStream::default();
let rtmp_context = RtmpContext::default();
let client = Client::new(stream, rtmp_context, PhantomData::<RtmpHandler<VecStream>>);
Trait Implementations§
Source§impl<RW: AsyncRead + AsyncWrite + Unpin> AsyncHandler for RtmpHandler<RW>
impl<RW: AsyncRead + AsyncWrite + Unpin> AsyncHandler for RtmpHandler<RW>
fn poll_handle( self: Pin<&mut Self>, cx: &mut FutureContext<'_>, rtmp_context: &mut RtmpContext, ) -> Poll<IOResult<()>>
Source§impl<RW: AsyncRead + AsyncWrite + Unpin> HandlerConstructor<StreamWrapper<RW>> for RtmpHandler<RW>
impl<RW: AsyncRead + AsyncWrite + Unpin> HandlerConstructor<StreamWrapper<RW>> for RtmpHandler<RW>
fn new(stream: Arc<StreamWrapper<RW>>) -> Self
Auto Trait Implementations§
impl<RW> Freeze for RtmpHandler<RW>
impl<RW> RefUnwindSafe for RtmpHandler<RW>where
RW: RefUnwindSafe,
impl<RW> Send for RtmpHandler<RW>
impl<RW> Sync for RtmpHandler<RW>
impl<RW> Unpin for RtmpHandler<RW>
impl<RW> UnwindSafe for RtmpHandler<RW>where
RW: RefUnwindSafe,
Blanket Implementations§
Source§impl<H> AsyncHandlerExt for Hwhere
H: AsyncHandler,
impl<H> AsyncHandlerExt for Hwhere
H: AsyncHandler,
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