uvgRTP 3.1.3
An open-source library for RTP/SRTP media delivery
|
Provides ZRTP synchronization and can be used to create uvgrtp::media_stream objects. More...
#include <session.hh>
Public Member Functions | |
uvgrtp::media_stream * | create_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_stream * | create_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. | |
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.
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.
port | Either local or remote port depending on rce_flags |
fmt | Format of the media stream. see RTP_FORMAT for more details |
rce_flags | RTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details |
uvgrtp::media_stream* | On success |
nullptr | On failure, see print |
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.
src_port | Local port that uvgRTP listens to for incoming RTP packets |
dst_port | Remote port where uvgRTP sends RTP packets |
fmt | Format of the media stream. see RTP_FORMAT for more details |
rce_flags | RTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details |
uvgrtp::media_stream* | On success |
nullptr | On failure, see print and |
rtp_error_t uvgrtp::session::destroy_stream | ( | uvgrtp::media_stream * | stream | ) |
Destroy a media stream.
stream | Pointer to the media stream that should be destroyed |
RTP_OK | On success |
RTP_INVALID_VALUE | If stream is nullptr |
RTP_NOT_FOUND | If stream does not belong to this session |