RecvSession

Type Alias RecvSession 

Source
pub type RecvSession = Session<RecvStream>;
Expand description

Session type used for receiving streams

Aliased Type§

pub struct RecvSession { /* private fields */ }

Implementations§

Source§

impl RecvSession

Source

pub fn set_roc(&mut self, ssrc: u32, roc: u32) -> Result<(), SrtpError>

set the ROC on a specific stream

Used for late joiners to a multicasted stream. This function is usually called just after the stream is added otherwise unprotect will fail.

The ROC is confirmed in the stream after the next successfull unprotect operation

The given ROC must be lower or equal than the current one (which should be 0 if this is called just after the stream is added to the session)

§Arguments
  • ssrc: the ssrc identifying the stream
  • roc: the roc value
§Returns Ok or
  • StreamNotFound: no stream matching this SSRC in the session
  • InvalidPacketIndex: given ROC < current ROC
Source

pub fn rtp_unprotect(&mut self, cipher: Vec<u8>) -> Result<Vec<u8>, SrtpError>

Decrypt a RTP packet

Packet is decrypted in place, the function gets packet ownership and gives it back

§Arguments
  • cipher : the encrypted RTP packet
§Returns

the decrypted RP packet or an error

Source

pub fn rtcp_unprotect(&mut self, cipher: Vec<u8>) -> Result<Vec<u8>, SrtpError>

Decrypt a RTCP packet

Packet is decrypted in place, the function gets packet ownership and gives it back

§Arguments
  • cipher : the encrypted RTCP packet
§Returns

the decrypted RTCP packet or an error