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

@ -271,7 +271,7 @@ SrsRtcOutgoingInfo::~SrsRtcOutgoingInfo()
{
}
SrsRtcPlayer::SrsRtcPlayer(SrsRtcSession* s, string parent_cid)
SrsRtcPlayer::SrsRtcPlayer(SrsRtcSession* s, SrsContextId parent_cid)
{
_parent_cid = parent_cid;
trd = new SrsDummyCoroutine();
@ -345,7 +345,7 @@ srs_error_t SrsRtcPlayer::on_reload_vhost_realtime(string vhost)
return on_reload_vhost_play(vhost);
}
std::string SrsRtcPlayer::cid()
SrsContextId SrsRtcPlayer::cid()
{
return trd->cid();
}
@ -1725,8 +1725,8 @@ block +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
void SrsRtcPublisher::request_keyframe()
{
std::string scid = _srs_context->get_id();
std::string pcid = session_->context_id();
SrsContextId scid = _srs_context->get_id();
SrsContextId pcid = session_->context_id();
srs_trace("RTC play=[%d][%s] request keyframe from publish=[%d][%s]", ::getpid(), scid.c_str(), ::getpid(), pcid.c_str());
request_keyframe_ = true;
@ -1767,7 +1767,6 @@ void SrsRtcPublisher::simulate_drop_packet(SrsRtpHeader* h, int nn_bytes)
SrsRtcSession::SrsRtcSession(SrsRtcServer* s)
{
req = NULL;
cid = "";
is_publisher_ = false;
encrypt = true;
@ -1860,12 +1859,12 @@ void SrsRtcSession::switch_to_context()
_srs_context->set_id(cid);
}
std::string SrsRtcSession::context_id()
SrsContextId SrsRtcSession::context_id()
{
return cid;
}
srs_error_t SrsRtcSession::initialize(SrsRtcSource* source, SrsRequest* r, bool is_publisher, string username, std::string context_id)
srs_error_t SrsRtcSession::initialize(SrsRtcSource* source, SrsRequest* r, bool is_publisher, string username, SrsContextId context_id)
{
srs_error_t err = srs_success;