uvgrtp-base/src/lib.hh

32 lines
902 B
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
namespace kvz_rtp {
class context {
public:
context();
~context();
/* Create new session if "addr" is unique or return pointer to previously created session */
kvz_rtp::session *create_session(std::string 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 */
rtp_error_t destroy_session(kvz_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
};