pub struct PipeTransport { /* private fields */ }
Expand description
A pipe transport represents a network path through which RTP, RTCP (optionally secured with
SRTP) and SCTP (DataChannel) is transmitted. Pipe transports are intended to intercommunicate
two Router
instances collocated on the same host or on separate hosts.
§Notes on usage
When calling PipeTransport::consume
, all RTP streams of the Producer
are transmitted
verbatim (in contrast to what happens in WebRtcTransport
and PlainTransport
in which a single and continuous
RTP stream is sent to the consuming endpoint).
Implementations§
Source§impl PipeTransport
impl PipeTransport
Sourcepub async fn connect(
&self,
remote_parameters: PipeTransportRemoteParameters,
) -> Result<(), RequestError>
pub async fn connect( &self, remote_parameters: PipeTransportRemoteParameters, ) -> Result<(), RequestError>
Provide the PipeTransport
with remote parameters.
Sourcepub async fn set_max_incoming_bitrate(
&self,
bitrate: u32,
) -> Result<(), RequestError>
pub async fn set_max_incoming_bitrate( &self, bitrate: u32, ) -> Result<(), RequestError>
Set maximum incoming bitrate for media streams sent by the remote endpoint over this transport.
Sourcepub fn tuple(&self) -> TransportTuple
pub fn tuple(&self) -> TransportTuple
The transport tuple. It refers to both RTP and RTCP since pipe transports use RTCP-mux by design.
§Notes on usage
- Once the pipe transport is created,
transport.tuple()
will contain information about itslocal_address
,local_port
andprotocol
. - Information about
remote_ip
andremote_port
will be set after callingconnect()
method.
Sourcepub fn sctp_parameters(&self) -> Option<SctpParameters>
pub fn sctp_parameters(&self) -> Option<SctpParameters>
Local SCTP parameters. Or None
if SCTP is not enabled.
Sourcepub fn sctp_state(&self) -> Option<SctpState>
pub fn sctp_state(&self) -> Option<SctpState>
Current SCTP state. Or None
if SCTP is not enabled.
Sourcepub fn srtp_parameters(&self) -> Option<SrtpParameters>
pub fn srtp_parameters(&self) -> Option<SrtpParameters>
Local SRTP parameters representing the crypto suite and key material used to encrypt sending
RTP and SRTP. Those parameters must be given to the paired PipeTransport
in the
connect()
method.
Sourcepub fn on_tuple<F: Fn(&TransportTuple) + Send + Sync + 'static>(
&self,
callback: F,
) -> HandlerId
pub fn on_tuple<F: Fn(&TransportTuple) + Send + Sync + 'static>( &self, callback: F, ) -> HandlerId
Callback is called after the remote RTP origin has been discovered. Only if comedia
mode
was set.
Sourcepub fn on_sctp_state_change<F: Fn(SctpState) + Send + Sync + 'static>(
&self,
callback: F,
) -> HandlerId
pub fn on_sctp_state_change<F: Fn(SctpState) + Send + Sync + 'static>( &self, callback: F, ) -> HandlerId
Callback is called when the transport SCTP state changes.
Sourcepub fn downgrade(&self) -> WeakPipeTransport
pub fn downgrade(&self) -> WeakPipeTransport
Downgrade PipeTransport
to WeakPipeTransport
instance.
Trait Implementations§
Source§impl Clone for PipeTransport
impl Clone for PipeTransport
Source§fn clone(&self) -> PipeTransport
fn clone(&self) -> PipeTransport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PipeTransport
impl Debug for PipeTransport
Source§impl Transport for PipeTransport
impl Transport for PipeTransport
Source§fn id(&self) -> TransportId
fn id(&self) -> TransportId
Source§fn produce<'life0, 'async_trait>(
&'life0 self,
producer_options: ProducerOptions,
) -> Pin<Box<dyn Future<Output = Result<Producer, ProduceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn produce<'life0, 'async_trait>(
&'life0 self,
producer_options: ProducerOptions,
) -> Pin<Box<dyn Future<Output = Result<Producer, ProduceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn consume<'life0, 'async_trait>(
&'life0 self,
consumer_options: ConsumerOptions,
) -> Pin<Box<dyn Future<Output = Result<Consumer, ConsumeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn consume<'life0, 'async_trait>(
&'life0 self,
consumer_options: ConsumerOptions,
) -> Pin<Box<dyn Future<Output = Result<Consumer, ConsumeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn produce_data<'life0, 'async_trait>(
&'life0 self,
data_producer_options: DataProducerOptions,
) -> Pin<Box<dyn Future<Output = Result<DataProducer, ProduceDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn produce_data<'life0, 'async_trait>(
&'life0 self,
data_producer_options: DataProducerOptions,
) -> Pin<Box<dyn Future<Output = Result<DataProducer, ProduceDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
DataChannel
in WebRTC) or can be directly sent from the Rust application if the transport is a
DirectTransport
. Read moreSource§fn consume_data<'life0, 'async_trait>(
&'life0 self,
data_consumer_options: DataConsumerOptions,
) -> Pin<Box<dyn Future<Output = Result<DataConsumer, ConsumeDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn consume_data<'life0, 'async_trait>(
&'life0 self,
data_consumer_options: DataConsumerOptions,
) -> Pin<Box<dyn Future<Output = Result<DataConsumer, ConsumeDataError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
DataChannel
in WebRTC)
or directly to the Rust process if the transport is a
DirectTransport
. Read moreSource§fn enable_trace_event<'life0, 'async_trait>(
&'life0 self,
types: Vec<TransportTraceEventType>,
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn enable_trace_event<'life0, 'async_trait>(
&'life0 self,
types: Vec<TransportTraceEventType>,
) -> Pin<Box<dyn Future<Output = Result<(), RequestError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn on_new_producer(
&self,
callback: Arc<dyn Fn(&Producer) + Send + Sync + 'static>,
) -> HandlerId
fn on_new_producer( &self, callback: Arc<dyn Fn(&Producer) + Send + Sync + 'static>, ) -> HandlerId
Source§fn on_new_consumer(
&self,
callback: Arc<dyn Fn(&Consumer) + Send + Sync + 'static>,
) -> HandlerId
fn on_new_consumer( &self, callback: Arc<dyn Fn(&Consumer) + Send + Sync + 'static>, ) -> HandlerId
Source§fn on_new_data_producer(
&self,
callback: Arc<dyn Fn(&DataProducer) + Send + Sync + 'static>,
) -> HandlerId
fn on_new_data_producer( &self, callback: Arc<dyn Fn(&DataProducer) + Send + Sync + 'static>, ) -> HandlerId
Source§fn on_new_data_consumer(
&self,
callback: Arc<dyn Fn(&DataConsumer) + Send + Sync + 'static>,
) -> HandlerId
fn on_new_data_consumer( &self, callback: Arc<dyn Fn(&DataConsumer) + Send + Sync + 'static>, ) -> HandlerId
Source§fn on_trace(
&self,
callback: Arc<dyn Fn(&TransportTraceEventData) + Send + Sync + 'static>,
) -> HandlerId
fn on_trace( &self, callback: Arc<dyn Fn(&TransportTraceEventData) + Send + Sync + 'static>, ) -> HandlerId
Source§fn on_router_close(
&self,
callback: Box<dyn FnOnce() + Send + 'static>,
) -> HandlerId
fn on_router_close( &self, callback: Box<dyn FnOnce() + Send + 'static>, ) -> HandlerId
on_transport_close
callbacks are also called on all
its producers and consumers.