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

Provides ZRTP synchronization and can be used to create uvgrtp::media_stream objects. More...

#include <session.hh>

Public Member Functions

uvgrtp::media_streamcreate_stream (uint16_t src_port, uint16_t dst_port, rtp_format_t fmt, int rce_flags)
 Create a uni- or bidirectional media stream.
 
uvgrtp::media_streamcreate_stream (uint16_t port, rtp_format_t fmt, int rce_flags)
 Create a unidirectional media_stream for an RTP session.
 
rtp_error_t destroy_stream (uvgrtp::media_stream *stream)
 Destroy a media stream.
 

Detailed Description

Provides ZRTP synchronization and can be used to create uvgrtp::media_stream objects.

By itself session does not do anything. The actual RTP streaming is done by media_stream objects, which can be created by session. media_stream corresponds to an RTP session in RFC 3550.

Definition at line 27 of file session.hh.

Member Function Documentation

◆ create_stream() [1/2]

uvgrtp::media_stream * uvgrtp::session::create_stream ( uint16_t port,
rtp_format_t fmt,
int rce_flags )

Create a unidirectional media_stream for an RTP session.

The created object is used for sending or receiving media, see documentation for uvgrtp::media_stream for more details.

User can enable and disable functionality of uvgRTP by OR'ing (using |) RCE_* flags together and passing them using the rce_flags parameter. The RCE_SEND_ONLY flag in rce_flags means the port is interpreted as a remote port. The RCE_RECEIVE_ONLY means the port is used for binding to a local interface. Without either flag, this function defaults to RCE_SEND_ONLY.

Parameters
portEither local or remote port depending on rce_flags
fmtFormat of the media stream. see RTP_FORMAT for more details
rce_flagsRTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details
Returns
RTP media stream object
Return values
uvgrtp::media_stream*On success
nullptrOn failure, see print

◆ create_stream() [2/2]

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

Create a uni- or bidirectional media stream.

The created object is used for sending and/or receiving media, see documentation for uvgrtp::media_stream for more details.

If both addresses were provided when uvgrtp::session was created, by default uvgRTP binds itself to local_addr:src_port and sends packets to remote_addr:dst_port.

User can enable and disable functionality of media_stream by OR'ing (using |) RCE_* flags together and passing them using the rce_flags parameter. In rce_flags, the RCE_SEND_ONLY flag can be used to avoid binding and src_port is thus ignored. Correspondinly RCE_RECEIVE_ONLY flag means dst_port is ignored. Without either RCE_SEND_ONLY or RCE_RECEIVE_ONLY, and if only one address was provided for session that address is interpreted as remote_addr and binding happens to ANY:src_port.

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
rce_flagsRTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details
Returns
RTP media stream object
Return values
uvgrtp::media_stream*On success
nullptrOn failure, see print and

◆ 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: