uvgRTP 3.1.3
An open-source library for RTP/SRTP media delivery
Loading...
Searching...
No Matches
uvgrtp::context Class Reference

Provides CNAME isolation and can be used to create uvgrtp::session objects. More...

#include <context.hh>

Public Member Functions

 context ()
 RTP context constructor.
 
 ~context ()
 RTP context destructor.
 
uvgrtp::sessioncreate_session (std::pair< std::string, std::string > addresses)
 Create a new RTP session between two IP addresses.
 
uvgrtp::sessioncreate_session (std::string address)
 Create a new RTP session.
 
rtp_error_t destroy_session (uvgrtp::session *session)
 Destroy RTP session and all of its media streams.
 
bool crypto_enabled () const
 Has Crypto++ been included in uvgRTP library.
 

Detailed Description

Provides CNAME isolation and can be used to create uvgrtp::session objects.

Definition at line 18 of file context.hh.

Constructor & Destructor Documentation

◆ context()

uvgrtp::context::context ( )

RTP context constructor.

Most of the time one RTP context per application is enough. If CNAME namespace isolation is required, multiple context objects can be created.

◆ ~context()

uvgrtp::context::~context ( )

RTP context destructor.

This does not destroy active sessions. They must be destroyed manually by calling uvgrtp::context::destroy_session()

Member Function Documentation

◆ create_session() [1/2]

uvgrtp::session * uvgrtp::context::create_session ( std::pair< std::string, std::string > addresses)

Create a new RTP session between two IP addresses.

Parameters
addressesLocal and remote IP address for session as a pair
Returns
RTP session object
Return values
uvgrtp::sessionOn success
nullptrIf memory allocation failed

◆ create_session() [2/2]

uvgrtp::session * uvgrtp::context::create_session ( std::string address)

Create a new RTP session.

Parameters
addressIP address of the remote participant
Returns
RTP session object
Return values
uvgrtp::sessionOn success
nullptrIf "address" is empty or memory allocation failed

◆ crypto_enabled()

bool uvgrtp::context::crypto_enabled ( ) const

Has Crypto++ been included in uvgRTP library.

Return values
trueCrypto++ has been included, using SRTP is possible
falseCrypto++ has not been included, using SRTP is not possible

◆ destroy_session()

rtp_error_t uvgrtp::context::destroy_session ( uvgrtp::session * session)

Destroy RTP session and all of its media streams.

Parameters
sessionPointer to the session object that should be destroyed
Returns
RTP error code
Return values
RTP_OKOn success
RTP_INVALID_VALUEIf session is nullptr

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