mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
Refine code
This commit is contained in:
parent
697f7d5251
commit
60c759919f
2 changed files with 13 additions and 13 deletions
|
@ -290,14 +290,14 @@ ISrsRtcPLIWorkerHandler::~ISrsRtcPLIWorkerHandler()
|
|||
{
|
||||
}
|
||||
|
||||
ISrsRtcPLIWorker::ISrsRtcPLIWorker(ISrsRtcPLIWorkerHandler* h)
|
||||
SrsRtcPLIWorker::SrsRtcPLIWorker(ISrsRtcPLIWorkerHandler* h)
|
||||
{
|
||||
handler_ = h;
|
||||
wait_ = srs_cond_new();
|
||||
trd_ = new SrsSTCoroutine("pli", this, _srs_context->get_id());
|
||||
}
|
||||
|
||||
ISrsRtcPLIWorker::~ISrsRtcPLIWorker()
|
||||
SrsRtcPLIWorker::~SrsRtcPLIWorker()
|
||||
{
|
||||
srs_cond_signal(wait_);
|
||||
trd_->stop();
|
||||
|
@ -306,7 +306,7 @@ ISrsRtcPLIWorker::~ISrsRtcPLIWorker()
|
|||
srs_cond_destroy(wait_);
|
||||
}
|
||||
|
||||
srs_error_t ISrsRtcPLIWorker::start()
|
||||
srs_error_t SrsRtcPLIWorker::start()
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -317,13 +317,13 @@ srs_error_t ISrsRtcPLIWorker::start()
|
|||
return err;
|
||||
}
|
||||
|
||||
void ISrsRtcPLIWorker::request_keyframe(uint32_t ssrc, SrsContextId cid)
|
||||
void SrsRtcPLIWorker::request_keyframe(uint32_t ssrc, SrsContextId cid)
|
||||
{
|
||||
plis_.insert(make_pair(ssrc, cid));
|
||||
srs_cond_signal(wait_);
|
||||
}
|
||||
|
||||
srs_error_t ISrsRtcPLIWorker::cycle()
|
||||
srs_error_t SrsRtcPLIWorker::cycle()
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
|
@ -383,7 +383,7 @@ SrsRtcPlayStream::SrsRtcPlayStream(SrsRtcConnection* s, const SrsContextId& cid)
|
|||
_srs_config->subscribe(this);
|
||||
timer_ = new SrsHourGlass(this, 1000 * SRS_UTIME_MILLISECONDS);
|
||||
nack_epp = new SrsErrorPithyPrint();
|
||||
pli_worker_ = new ISrsRtcPLIWorker(this);
|
||||
pli_worker_ = new SrsRtcPLIWorker(this);
|
||||
}
|
||||
|
||||
SrsRtcPlayStream::~SrsRtcPlayStream()
|
||||
|
@ -909,8 +909,8 @@ SrsRtcPublishStream::SrsRtcPublishStream(SrsRtcConnection* session, const SrsCon
|
|||
nn_audio_frames = 0;
|
||||
twcc_id_ = 0;
|
||||
twcc_fb_count_ = 0;
|
||||
|
||||
pli_worker_ = new ISrsRtcPLIWorker(this);
|
||||
|
||||
pli_worker_ = new SrsRtcPLIWorker(this);
|
||||
}
|
||||
|
||||
SrsRtcPublishStream::~SrsRtcPublishStream()
|
||||
|
|
|
@ -186,7 +186,7 @@ public:
|
|||
};
|
||||
|
||||
// A worker coroutine to request the PLI.
|
||||
class ISrsRtcPLIWorker : virtual public ISrsCoroutineHandler
|
||||
class SrsRtcPLIWorker : virtual public ISrsCoroutineHandler
|
||||
{
|
||||
private:
|
||||
SrsCoroutine* trd_;
|
||||
|
@ -196,8 +196,8 @@ private:
|
|||
// Key is SSRC, value is the CID of subscriber which requests PLI.
|
||||
std::map<uint32_t, SrsContextId> plis_;
|
||||
public:
|
||||
ISrsRtcPLIWorker(ISrsRtcPLIWorkerHandler* h);
|
||||
virtual ~ISrsRtcPLIWorker();
|
||||
SrsRtcPLIWorker(ISrsRtcPLIWorkerHandler* h);
|
||||
virtual ~SrsRtcPLIWorker();
|
||||
public:
|
||||
virtual srs_error_t start();
|
||||
virtual void request_keyframe(uint32_t ssrc, SrsContextId cid);
|
||||
|
@ -246,7 +246,7 @@ private:
|
|||
SrsContextId cid_;
|
||||
SrsCoroutine* trd;
|
||||
SrsRtcConnection* session_;
|
||||
ISrsRtcPLIWorker* pli_worker_;
|
||||
SrsRtcPLIWorker* pli_worker_;
|
||||
private:
|
||||
SrsRequest* req_;
|
||||
SrsRtcStream* source_;
|
||||
|
@ -312,7 +312,7 @@ private:
|
|||
SrsContextId cid_;
|
||||
SrsHourGlass* timer_;
|
||||
uint64_t nn_audio_frames;
|
||||
ISrsRtcPLIWorker* pli_worker_;
|
||||
SrsRtcPLIWorker* pli_worker_;
|
||||
private:
|
||||
SrsRtcConnection* session_;
|
||||
uint16_t pt_to_drop_;
|
||||
|
|
Loading…
Reference in a new issue