◆ 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_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 |
| flags | RTP context enable flags, see RTP_CTX_ENABLE_FLAGS for more details |
- Returns
- RTP media stream object
- Return values
-
| uvgrtp::media_stream* | On success |
| nullptr | If src_port or dst_port is 0 |
| nullptr | If fmt is not a supported media format |
| nullptr | If socket initialization failed |
| nullptr | If ZRTP was enabled and it failed to finish handshaking |
| nullptr | If RCE_SRTP is given but uvgRTP has not been compiled with Crypto++ enabled |
| nullptr | If RCE_SRTP is given but RCE_SRTP_KMNGMNT_* flag is not given |
| nullptr | If memory allocation failed |
◆ destroy_stream()
Destroy a media stream.
- Parameters
-
| stream | Pointer to the media stream that should be destroyed |
- Returns
- RTP error code
- Return values
-
| RTP_OK | On success |
| RTP_INVALID_VALUE | If stream is nullptr |
| RTP_NOT_FOUND | If stream does not belong to this session |
The documentation for this class was generated from the following file: