reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
flowmanager::MediaStream Class Reference

This class represents a media stream, that consists of a series of componenets or flows. More...

#include <MediaStream.hxx>

Public Types

enum  NatTraversalMode { NoNatTraversal , StunBindDiscovery , TurnAllocation }
 

Public Member Functions

 MediaStream (asio::io_context &ioService, asio::ssl::context &sslContext, MediaStreamHandler &mediaStreamHandler, const StunTuple &localRtpBinding, const StunTuple &localRtcpBinding, dtls::DtlsFactory *dtlsFactory=0, NatTraversalMode natTraversalMode=NoNatTraversal, const char *natTraversalServerHostname=0, unsigned short natTraversalServerPort=0, const char *stunUsername=0, const char *stunPassword=0, bool forceCOMedia=false, std::shared_ptr< RTCPEventLoggingHandler > rtcpEventLoggingHandler=nullptr, std::shared_ptr< FlowContext > context=nullptr, bool validateTlsServerHostname=true)
 
virtual ~MediaStream ()
 
Flow * getRtpFlow ()
 
Flow * getRtcpFlow ()
 
bool createOutboundSRTPSession (resip::MediaConstants::SrtpCryptoSuite cryptoSuite, const char *key, size_t keyLen)
 
bool createInboundSRTPSession (resip::MediaConstants::SrtpCryptoSuite cryptoSuite, const char *key, size_t keyLen)
 

Protected Member Functions

srtp_err_status_t srtpProtect (void *data, int *size, bool rtcp)
 
srtp_err_status_t srtpUnprotect (void *data, int *size, bool rtcp)
 

Protected Attributes

dtls::DtlsFactory * mDtlsFactory
 
volatile bool mSRTPSessionInCreated
 
volatile bool mSRTPSessionOutCreated
 
resip::Mutex mMutex
 
resip::MediaConstants::SrtpCryptoSuite mCryptoSuiteIn
 
resip::MediaConstants::SrtpCryptoSuite mCryptoSuiteOut
 
uint8_t mSRTPMasterKeyIn [SRTP_MASTER_KEY_LEN]
 
uint8_t mSRTPMasterKeyOut [SRTP_MASTER_KEY_LEN]
 
srtp_policy_t mSRTPPolicyIn
 
srtp_policy_t mSRTPPolicyOut
 
srtp_t mSRTPSessionIn
 
srtp_t mSRTPSessionOut
 
NatTraversalMode mNatTraversalMode
 
resip::Data mNatTraversalServerHostname
 
unsigned short mNatTraversalServerPort
 
resip::Data mStunUsername
 
resip::Data mStunPassword
 
bool mForceCOMedia
 
bool mValidateTlsServerHostname
 

Friends

class Flow
 

Detailed Description

This class represents a media stream, that consists of a series of componenets or flows.

For media streams based on RTP, there are two components per media stream - one for RTP, and one for RTCP.

Author: Scott Godin (sgodin AT SipSpectrum DOT com)

Definition at line 57 of file MediaStream.hxx.

Member Enumeration Documentation

◆ NatTraversalMode

Enumerator
NoNatTraversal 
StunBindDiscovery 
TurnAllocation 

Definition at line 60 of file MediaStream.hxx.

Constructor & Destructor Documentation

◆ MediaStream()

MediaStream::MediaStream ( asio::io_context &  ioService,
asio::ssl::context &  sslContext,
MediaStreamHandler &  mediaStreamHandler,
const StunTuple &  localRtpBinding,
const StunTuple &  localRtcpBinding,
dtls::DtlsFactory *  dtlsFactory = 0,
NatTraversalMode  natTraversalMode = NoNatTraversal,
const char *  natTraversalServerHostname = 0,
unsigned short  natTraversalServerPort = 0,
const char *  stunUsername = 0,
const char *  stunPassword = 0,
bool  forceCOMedia = false,
std::shared_ptr< RTCPEventLoggingHandler >  rtcpEventLoggingHandler = nullptr,
std::shared_ptr< FlowContext >  context = nullptr,
bool  validateTlsServerHostname = true 
)

Definition at line 23 of file MediaStream.cxx.

◆ ~MediaStream()

MediaStream::~MediaStream ( )
virtual

Definition at line 108 of file MediaStream.cxx.

Member Function Documentation

◆ createInboundSRTPSession()

bool MediaStream::createInboundSRTPSession ( resip::MediaConstants::SrtpCryptoSuite  cryptoSuite,
const char *  key,
size_t  keyLen 
)

Definition at line 197 of file MediaStream.cxx.

◆ createOutboundSRTPSession()

bool MediaStream::createOutboundSRTPSession ( resip::MediaConstants::SrtpCryptoSuite  cryptoSuite,
const char *  key,
size_t  keyLen 
)

Definition at line 132 of file MediaStream.cxx.

◆ getRtcpFlow()

Flow * flowmanager::MediaStream::getRtcpFlow ( )
inline

Definition at line 85 of file MediaStream.hxx.

◆ getRtpFlow()

Flow * flowmanager::MediaStream::getRtpFlow ( )
inline

Definition at line 84 of file MediaStream.hxx.

◆ srtpProtect()

srtp_err_status_t MediaStream::srtpProtect ( void *  data,
int *  size,
bool  rtcp 
)
protected

Definition at line 262 of file MediaStream.cxx.

◆ srtpUnprotect()

srtp_err_status_t MediaStream::srtpUnprotect ( void *  data,
int *  size,
bool  rtcp 
)
protected

Definition at line 281 of file MediaStream.cxx.

Friends And Related Symbol Documentation

◆ Flow

friend class Flow
friend

Definition at line 92 of file MediaStream.hxx.

Member Data Documentation

◆ mCryptoSuiteIn

resip::MediaConstants::SrtpCryptoSuite flowmanager::MediaStream::mCryptoSuiteIn
protected

Definition at line 99 of file MediaStream.hxx.

◆ mCryptoSuiteOut

resip::MediaConstants::SrtpCryptoSuite flowmanager::MediaStream::mCryptoSuiteOut
protected

Definition at line 100 of file MediaStream.hxx.

◆ mDtlsFactory

dtls::DtlsFactory* flowmanager::MediaStream::mDtlsFactory
protected

Definition at line 95 of file MediaStream.hxx.

◆ mForceCOMedia

bool flowmanager::MediaStream::mForceCOMedia
protected

Definition at line 117 of file MediaStream.hxx.

◆ mMutex

resip::Mutex flowmanager::MediaStream::mMutex
protected

Definition at line 98 of file MediaStream.hxx.

◆ mNatTraversalMode

NatTraversalMode flowmanager::MediaStream::mNatTraversalMode
protected

Definition at line 112 of file MediaStream.hxx.

◆ mNatTraversalServerHostname

resip::Data flowmanager::MediaStream::mNatTraversalServerHostname
protected

Definition at line 113 of file MediaStream.hxx.

◆ mNatTraversalServerPort

unsigned short flowmanager::MediaStream::mNatTraversalServerPort
protected

Definition at line 114 of file MediaStream.hxx.

◆ mSRTPMasterKeyIn

uint8_t flowmanager::MediaStream::mSRTPMasterKeyIn[SRTP_MASTER_KEY_LEN]
protected

Definition at line 101 of file MediaStream.hxx.

◆ mSRTPMasterKeyOut

uint8_t flowmanager::MediaStream::mSRTPMasterKeyOut[SRTP_MASTER_KEY_LEN]
protected

Definition at line 102 of file MediaStream.hxx.

◆ mSRTPPolicyIn

srtp_policy_t flowmanager::MediaStream::mSRTPPolicyIn
protected

Definition at line 103 of file MediaStream.hxx.

◆ mSRTPPolicyOut

srtp_policy_t flowmanager::MediaStream::mSRTPPolicyOut
protected

Definition at line 104 of file MediaStream.hxx.

◆ mSRTPSessionIn

srtp_t flowmanager::MediaStream::mSRTPSessionIn
protected

Definition at line 105 of file MediaStream.hxx.

◆ mSRTPSessionInCreated

volatile bool flowmanager::MediaStream::mSRTPSessionInCreated
protected

Definition at line 96 of file MediaStream.hxx.

◆ mSRTPSessionOut

srtp_t flowmanager::MediaStream::mSRTPSessionOut
protected

Definition at line 106 of file MediaStream.hxx.

◆ mSRTPSessionOutCreated

volatile bool flowmanager::MediaStream::mSRTPSessionOutCreated
protected

Definition at line 97 of file MediaStream.hxx.

◆ mStunPassword

resip::Data flowmanager::MediaStream::mStunPassword
protected

Definition at line 116 of file MediaStream.hxx.

◆ mStunUsername

resip::Data flowmanager::MediaStream::mStunUsername
protected

Definition at line 115 of file MediaStream.hxx.

◆ mValidateTlsServerHostname

bool flowmanager::MediaStream::mValidateTlsServerHostname
protected

Definition at line 118 of file MediaStream.hxx.


The documentation for this class was generated from the following files: