1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Log: Use object as context id for complex context

This commit is contained in:
winlin 2020-07-05 23:26:55 +08:00
parent bff7ef085d
commit 6624b8acca
34 changed files with 276 additions and 238 deletions

View file

@ -185,7 +185,7 @@ public:
class SrsRtcPlayer : virtual public ISrsCoroutineHandler, virtual public ISrsReloadHandler
{
protected:
std::string _parent_cid;
SrsContextId _parent_cid;
SrsCoroutine* trd;
SrsRtcSession* session_;
private:
@ -208,7 +208,7 @@ private:
// Whether enabled nack.
bool nack_enabled_;
public:
SrsRtcPlayer(SrsRtcSession* s, std::string parent_cid);
SrsRtcPlayer(SrsRtcSession* s, SrsContextId parent_cid);
virtual ~SrsRtcPlayer();
public:
srs_error_t initialize(uint32_t vssrc, uint32_t assrc, uint16_t v_pt, uint16_t a_pt);
@ -217,7 +217,7 @@ public:
virtual srs_error_t on_reload_vhost_play(std::string vhost);
virtual srs_error_t on_reload_vhost_realtime(std::string vhost);
public:
virtual std::string cid();
virtual SrsContextId cid();
public:
virtual srs_error_t start();
virtual void stop();
@ -337,7 +337,7 @@ private:
srs_utime_t last_stun_time;
private:
// For each RTC session, we use a specified cid for debugging logs.
std::string cid;
SrsContextId cid;
// For each RTC session, whether requires encrypt.
// Read config value, rtc_server.encrypt, default to on.
// Sepcifies by HTTP API, query encrypt, optional.
@ -372,10 +372,10 @@ public:
std::string username();
void set_encrypt(bool v);
void switch_to_context();
std::string context_id();
SrsContextId context_id();
public:
// Before initialize, user must set the local SDP, which is used to inititlize DTLS.
srs_error_t initialize(SrsRtcSource* source, SrsRequest* r, bool is_publisher, std::string username, std::string context_id);
srs_error_t initialize(SrsRtcSource* source, SrsRequest* r, bool is_publisher, std::string username, SrsContextId context_id);
// The peer address may change, we can identify that by STUN messages.
srs_error_t on_stun(SrsUdpMuxSocket* skt, SrsStunPacket* r);
srs_error_t on_dtls(char* data, int nb_data);