2019-03-30 09:51:30 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <map>
|
2020-02-07 10:22:58 +00:00
|
|
|
#include "session.hh"
|
2019-03-30 09:51:30 +00:00
|
|
|
|
2020-04-27 11:07:24 +00:00
|
|
|
namespace uvg_rtp {
|
2020-01-08 08:55:00 +00:00
|
|
|
|
|
|
|
|
class context {
|
|
|
|
|
public:
|
2020-01-13 08:00:02 +00:00
|
|
|
context();
|
2020-01-08 08:55:00 +00:00
|
|
|
~context();
|
|
|
|
|
|
2020-04-03 08:45:19 +00:00
|
|
|
/* Create a new session with remote participant */
|
2020-04-27 11:07:24 +00:00
|
|
|
uvg_rtp::session *create_session(std::string addr);
|
2020-01-08 08:55:00 +00:00
|
|
|
|
2020-04-03 08:45:19 +00:00
|
|
|
/* Create a new session with remote participant
|
|
|
|
|
* Bind ourselves to interface pointed to by "local_addr" */
|
2020-04-27 11:07:24 +00:00
|
|
|
uvg_rtp::session *create_session(std::string remote_addr, std::string local_addr);
|
2020-04-03 08:45:19 +00:00
|
|
|
|
2020-02-21 07:20:57 +00:00
|
|
|
/* Destroy session and all media streams
|
|
|
|
|
*
|
|
|
|
|
* Return RTP_INVALID_VALUE if "session" is nullptr
|
|
|
|
|
* Return RTP_NOT_FOUND if "session" has not been allocated from this context */
|
2020-04-27 11:07:24 +00:00
|
|
|
rtp_error_t destroy_session(uvg_rtp::session *session);
|
2020-01-08 08:55:00 +00:00
|
|
|
|
|
|
|
|
std::string& get_cname();
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
/* Generate CNAME for participant using host and login names */
|
|
|
|
|
std::string generate_cname();
|
|
|
|
|
|
|
|
|
|
/* CNAME is the same for all connections */
|
|
|
|
|
std::string cname_;
|
|
|
|
|
};
|
2019-03-30 09:51:30 +00:00
|
|
|
};
|