uvgrtp-base/include/lib.hh

36 lines
1.1 KiB
C++
Raw Normal View History

2019-03-30 09:51:30 +00:00
#pragma once
#include <map>
#include "session.hh"
2019-03-30 09:51:30 +00:00
2020-04-27 11:07:24 +00:00
namespace uvg_rtp {
class context {
public:
context();
~context();
/* Create a new session with remote participant */
2020-04-27 11:07:24 +00:00
uvg_rtp::session *create_session(std::string addr);
/* 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);
/* 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);
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
};