uvgRTP
Public Member Functions | List of all members
uvgrtp::session Class Reference

Public Member Functions

uvgrtp::media_streamcreate_stream (int src_port, int dst_port, rtp_format_t fmt, int flags)
 Create a bidirectional media stream for an RTP session. More...
 
rtp_error_t destroy_stream (uvgrtp::media_stream *stream)
 Destroy a media stream. More...
 

Member Function Documentation

◆ create_stream()

uvgrtp::media_stream* uvgrtp::session::create_stream ( int  src_port,
int  dst_port,
rtp_format_t  fmt,
int  flags 
)

Create a bidirectional media stream for an RTP session.

If local_addr was provided when uvgrtp::session was created, uvgRTP binds itself to local_addr:src_port, otherwise to INADDR_ANY:src_port

This object is used for both sending and receiving media, see documentation for uvgrtp::media_stream for more details.

User can enable and disable functionality of uvgRTP by OR'ing RCE_* flags together and passing them using the flags parameter

Parameters
src_portLocal port that uvgRTP listens to for incoming RTP packets
dst_portRemote port where uvgRTP sends RTP packets
fmtFormat of the media stream. see RTP_FORMAT for more details
flagsRTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details
Returns
RTP media stream object
Return values
uvgrtp::media_stream*On success
nullptrIf src_port or dst_port is 0
nullptrIf fmt is not a supported media format
nullptrIf socket initialization failed
nullptrIf ZRTP was enabled and it failed to finish handshaking
nullptrIf RCE_SRTP is given but uvgRTP has not been compiled with Crypto++ enabled
nullptrIf RCE_SRTP is given but RCE_SRTP_KMNGMNT_* flag is not given
nullptrIf memory allocation failed

◆ destroy_stream()

rtp_error_t uvgrtp::session::destroy_stream ( uvgrtp::media_stream stream)

Destroy a media stream.

Parameters
streamPointer to the media stream that should be destroyed
Returns
RTP error code
Return values
RTP_OKOn success
RTP_INVALID_VALUEIf stream is nullptr
RTP_NOT_FOUNDIf stream does not belong to this session

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