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:
parent
bff7ef085d
commit
6624b8acca
34 changed files with 276 additions and 238 deletions
|
@ -245,7 +245,6 @@ ISrsRtcPublisher::~ISrsRtcPublisher()
|
|||
|
||||
SrsRtcSource::SrsRtcSource()
|
||||
{
|
||||
_source_id = _pre_source_id = "";
|
||||
_can_publish = true;
|
||||
rtc_publisher_ = NULL;
|
||||
|
||||
|
@ -288,17 +287,17 @@ void SrsRtcSource::update_auth(SrsRequest* r)
|
|||
req->update_auth(r);
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcSource::on_source_id_changed(std::string id)
|
||||
srs_error_t SrsRtcSource::on_source_id_changed(SrsContextId id)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if (_source_id == id) {
|
||||
if (_source_id.equals(id)) {
|
||||
return err;
|
||||
}
|
||||
|
||||
if (_pre_source_id == "") {
|
||||
if (_pre_source_id.empty()) {
|
||||
_pre_source_id = id;
|
||||
} else if (_pre_source_id != _source_id) {
|
||||
} else if (!_pre_source_id.equals(_source_id)) {
|
||||
_pre_source_id = _source_id;
|
||||
}
|
||||
|
||||
|
@ -314,12 +313,12 @@ srs_error_t SrsRtcSource::on_source_id_changed(std::string id)
|
|||
return err;
|
||||
}
|
||||
|
||||
std::string SrsRtcSource::source_id()
|
||||
SrsContextId SrsRtcSource::source_id()
|
||||
{
|
||||
return _source_id;
|
||||
}
|
||||
|
||||
std::string SrsRtcSource::pre_source_id()
|
||||
SrsContextId SrsRtcSource::pre_source_id()
|
||||
{
|
||||
return _pre_source_id;
|
||||
}
|
||||
|
@ -395,7 +394,7 @@ void SrsRtcSource::on_unpublish()
|
|||
srs_trace("cleanup when unpublish");
|
||||
|
||||
_can_publish = true;
|
||||
_source_id = -1;
|
||||
_source_id = SrsContextId();
|
||||
|
||||
// TODO: FIXME: Handle by statistic.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue