uvgRTP 4.0.0
An open-source library for RTP/SRTP media delivery
Loading...
Searching...
No Matches
session.hh
1#pragma once
2
3#include "util.hh"
4#include "uvgrtp/export.hh"
5#include "uvgrtp/definitions.hh"
6
7#include <mutex>
8#include <string>
9#include <vector>
10#include <unordered_map>
11#include <memory>
12
13namespace uvgrtp {
14
15 class media_stream;
16 class zrtp;
17 class socketfactory;
18 class session_impl;
19
30 class UVGRTP_EXPORT session {
32 friend class context;
34 public:
35
40 ~session();
41
74 uvgrtp::media_stream *create_stream(uint16_t src_port, uint16_t dst_port, rtp_format_t fmt, int rce_flags);
75
99 uvgrtp::media_stream *create_stream(uint16_t port, rtp_format_t fmt, int rce_flags);
100
113
114 // End of CORE_API group
115
116 private:
117
118 session(std::string cname, std::string addr, std::shared_ptr<uvgrtp::socketfactory> sfp);
119 session(std::string cname, std::string remote_addr, std::string local_addr, std::shared_ptr<uvgrtp::socketfactory> sfp);
120
121 /* Get unique key of the session
122 * Used by context to index sessions */
123 std::string& get_key();
124
125 session_impl* pimpl_;
126 };
127}
128
129namespace uvg_rtp = uvgrtp;
Provides CNAME isolation and can be used to create uvgrtp::session objects.
Definition context.hh:19
The media_stream is an entity which represents one RTP stream.
Provides ZRTP synchronization and can be used to create uvgrtp::media_stream objects.
Definition session.hh:30
uvgrtp::media_stream * create_stream(uint16_t port, rtp_format_t fmt, int rce_flags)
Create a unidirectional media_stream for an RTP session.
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.
rtp_error_t destroy_stream(uvgrtp::media_stream *stream)
Destroy a media stream.