Remove most of reload, only keep framework.
This commit is contained in:
parent
5d69569f07
commit
084bb6f7fc
|
|
@ -221,20 +221,6 @@ srs_error_t SrsDvrSegmenter::on_update_duration(SrsSharedPtrMessage *msg)
|
|||
return srs_success;
|
||||
}
|
||||
|
||||
srs_error_t SrsDvrSegmenter::on_reload_vhost_dvr(std::string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if (req->vhost != vhost) {
|
||||
return err;
|
||||
}
|
||||
|
||||
jitter_algorithm = (SrsRtmpJitterAlgorithm)_srs_config->get_dvr_time_jitter(req->vhost);
|
||||
wait_keyframe = _srs_config->get_dvr_wait_keyframe(req->vhost);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
SrsDvrFlvSegmenter::SrsDvrFlvSegmenter()
|
||||
{
|
||||
enc = new SrsFlvTransmuxer();
|
||||
|
|
@ -917,21 +903,6 @@ srs_error_t SrsDvrSegmentPlan::update_duration(SrsSharedPtrMessage *msg)
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsDvrSegmentPlan::on_reload_vhost_dvr(string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if (req->vhost != vhost) {
|
||||
return err;
|
||||
}
|
||||
|
||||
wait_keyframe = _srs_config->get_dvr_wait_keyframe(req->vhost);
|
||||
|
||||
cduration = _srs_config->get_dvr_duration(req->vhost);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
SrsDvr::SrsDvr()
|
||||
{
|
||||
hub = NULL;
|
||||
|
|
|
|||
|
|
@ -92,9 +92,6 @@ private:
|
|||
virtual std::string generate_path();
|
||||
// When update the duration of segment by rtmp msg.
|
||||
virtual srs_error_t on_update_duration(SrsSharedPtrMessage *msg);
|
||||
// Interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_dvr(std::string vhost);
|
||||
};
|
||||
|
||||
// The FLV segmenter to use FLV encoder to write file.
|
||||
|
|
@ -234,9 +231,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual srs_error_t update_duration(SrsSharedPtrMessage *msg);
|
||||
// Interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_dvr(std::string vhost);
|
||||
};
|
||||
|
||||
// DVR(Digital Video Recorder) to record RTMP stream to flv/mp4 file.
|
||||
|
|
|
|||
|
|
@ -962,16 +962,6 @@ srs_error_t SrsGoApiRaw::serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsGoApiRaw::on_reload_http_api_raw_api()
|
||||
{
|
||||
raw_api = _srs_config->get_raw_api();
|
||||
allow_reload = _srs_config->get_raw_api_allow_reload();
|
||||
allow_query = _srs_config->get_raw_api_allow_query();
|
||||
allow_update = _srs_config->get_raw_api_allow_update();
|
||||
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
SrsGoApiClusters::SrsGoApiClusters()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,9 +200,6 @@ public:
|
|||
|
||||
public:
|
||||
virtual srs_error_t serve_http(ISrsHttpResponseWriter *w, ISrsHttpMessage *r);
|
||||
// Interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_http_api_raw_api();
|
||||
};
|
||||
|
||||
class SrsGoApiClusters : public ISrsHttpHandler
|
||||
|
|
|
|||
|
|
@ -687,15 +687,3 @@ srs_error_t SrsHttpStaticServer::mount_vhost(string vhost, string &pmount)
|
|||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsHttpStaticServer::on_reload_vhost_added(string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
string pmount;
|
||||
if ((err = mount_vhost(vhost, pmount)) != srs_success) {
|
||||
return srs_error_wrap(err, "mount vhost");
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,9 +104,6 @@ public:
|
|||
|
||||
private:
|
||||
virtual srs_error_t mount_vhost(std::string vhost, std::string &pmount);
|
||||
// Interface ISrsReloadHandler.
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_added(std::string vhost);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -483,106 +483,3 @@ void SrsIngester::show_ingest_log_message()
|
|||
srsu2msi(pprint_->age()), (int)ingesters.size(), index, srsu2msi(ingester->alive()), ingester->uri().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
srs_error_t SrsIngester::on_reload_vhost_removed(string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
std::vector<SrsIngesterFFMPEG *>::iterator it;
|
||||
|
||||
for (it = ingesters.begin(); it != ingesters.end();) {
|
||||
SrsIngesterFFMPEG *ingester = *it;
|
||||
|
||||
if (!ingester->equals(vhost)) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
|
||||
// stop the ffmpeg and free it.
|
||||
ingester->stop();
|
||||
|
||||
srs_trace("reload stop ingester, vhost=%s, id=%s", vhost.c_str(), ingester->uri().c_str());
|
||||
|
||||
srs_freep(ingester);
|
||||
|
||||
// remove the item from ingesters.
|
||||
it = ingesters.erase(it);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsIngester::on_reload_vhost_added(string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
SrsConfDirective *_vhost = _srs_config->get_vhost(vhost);
|
||||
if ((err = parse_ingesters(_vhost)) != srs_success) {
|
||||
return srs_error_wrap(err, "parse ingesters");
|
||||
}
|
||||
|
||||
srs_trace("reload add vhost ingesters, vhost=%s", vhost.c_str());
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsIngester::on_reload_ingest_removed(string vhost, string ingest_id)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
std::vector<SrsIngesterFFMPEG *>::iterator it;
|
||||
|
||||
for (it = ingesters.begin(); it != ingesters.end();) {
|
||||
SrsIngesterFFMPEG *ingester = *it;
|
||||
|
||||
if (!ingester->equals(vhost, ingest_id)) {
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
|
||||
// stop the ffmpeg and free it.
|
||||
ingester->stop();
|
||||
|
||||
srs_trace("reload stop ingester, vhost=%s, id=%s", vhost.c_str(), ingester->uri().c_str());
|
||||
|
||||
srs_freep(ingester);
|
||||
|
||||
// remove the item from ingesters.
|
||||
it = ingesters.erase(it);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsIngester::on_reload_ingest_added(string vhost, string ingest_id)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
SrsConfDirective *_vhost = _srs_config->get_vhost(vhost);
|
||||
SrsConfDirective *_ingester = _srs_config->get_ingest_by_id(vhost, ingest_id);
|
||||
|
||||
if ((err = parse_engines(_vhost, _ingester)) != srs_success) {
|
||||
return srs_error_wrap(err, "parse engines");
|
||||
}
|
||||
|
||||
srs_trace("reload add ingester, vhost=%s, id=%s", vhost.c_str(), ingest_id.c_str());
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsIngester::on_reload_ingest_updated(string vhost, string ingest_id)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if ((err = on_reload_ingest_removed(vhost, ingest_id)) != srs_success) {
|
||||
return srs_error_wrap(err, "reload ingest removed");
|
||||
}
|
||||
|
||||
if ((err = on_reload_ingest_added(vhost, ingest_id)) != srs_success) {
|
||||
return srs_error_wrap(err, "reload ingest added");
|
||||
}
|
||||
|
||||
srs_trace("reload updated ingester, vhost=%s, id=%s", vhost.c_str(), ingest_id.c_str());
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,13 +96,6 @@ private:
|
|||
virtual srs_error_t parse_engines(SrsConfDirective *vhost, SrsConfDirective *ingest);
|
||||
virtual srs_error_t initialize_ffmpeg(SrsFFMPEG *ffmpeg, SrsConfDirective *vhost, SrsConfDirective *ingest, SrsConfDirective *engine);
|
||||
virtual void show_ingest_log_message();
|
||||
// Interface ISrsReloadHandler.
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_removed(std::string vhost);
|
||||
virtual srs_error_t on_reload_vhost_added(std::string vhost);
|
||||
virtual srs_error_t on_reload_ingest_removed(std::string vhost, std::string ingest_id);
|
||||
virtual srs_error_t on_reload_ingest_added(std::string vhost, std::string ingest_id);
|
||||
virtual srs_error_t on_reload_ingest_updated(std::string vhost, std::string ingest_id);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -54,12 +54,6 @@ bool SrsStageInfo::can_print()
|
|||
return can_print;
|
||||
}
|
||||
|
||||
srs_error_t SrsStageInfo::on_reload_pithy_print()
|
||||
{
|
||||
update_print_time();
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
SrsStageManager::SrsStageManager()
|
||||
{
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,9 +36,6 @@ public:
|
|||
public:
|
||||
virtual void elapse(srs_utime_t diff);
|
||||
virtual bool can_print();
|
||||
|
||||
public:
|
||||
virtual srs_error_t on_reload_pithy_print();
|
||||
};
|
||||
|
||||
// The manager for stages, it's used for a single client stage.
|
||||
|
|
|
|||
|
|
@ -580,25 +580,6 @@ void SrsRtcPlayStream::on_stream_change(SrsRtcSourceDescription *desc)
|
|||
}
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcPlayStream::on_reload_vhost_play(string vhost)
|
||||
{
|
||||
if (req_->vhost != vhost) {
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
realtime = _srs_config->get_realtime_enabled(req_->vhost, true);
|
||||
mw_msgs = _srs_config->get_mw_msgs(req_->vhost, realtime, true);
|
||||
|
||||
srs_trace("Reload play realtime=%d, mw_msgs=%d", realtime, mw_msgs);
|
||||
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcPlayStream::on_reload_vhost_realtime(string vhost)
|
||||
{
|
||||
return on_reload_vhost_play(vhost);
|
||||
}
|
||||
|
||||
const SrsContextId &SrsRtcPlayStream::context_id()
|
||||
{
|
||||
return cid_;
|
||||
|
|
|
|||
|
|
@ -270,10 +270,7 @@ public:
|
|||
// Interface ISrsRtcSourceChangeCallback
|
||||
public:
|
||||
void on_stream_change(SrsRtcSourceDescription *desc);
|
||||
// interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_play(std::string vhost);
|
||||
virtual srs_error_t on_reload_vhost_realtime(std::string vhost);
|
||||
virtual const SrsContextId &context_id();
|
||||
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -348,11 +348,6 @@ srs_error_t SrsRtcServer::initialize()
|
|||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::on_reload_rtc_server()
|
||||
{
|
||||
return srs_success;
|
||||
}
|
||||
|
||||
srs_error_t SrsRtcServer::exec_async_work(ISrsAsyncCallTask *t)
|
||||
{
|
||||
return async->execute(t);
|
||||
|
|
|
|||
|
|
@ -95,9 +95,6 @@ public:
|
|||
|
||||
public:
|
||||
virtual srs_error_t initialize();
|
||||
// interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_rtc_server();
|
||||
|
||||
public:
|
||||
srs_error_t exec_async_work(ISrsAsyncCallTask *t);
|
||||
|
|
|
|||
|
|
@ -1857,90 +1857,6 @@ void SrsLiveSource::set_bridge(ISrsStreamBridge *v)
|
|||
bridge_ = v;
|
||||
}
|
||||
|
||||
srs_error_t SrsLiveSource::on_reload_vhost_play(string vhost)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
||||
if (req->vhost != vhost) {
|
||||
return err;
|
||||
}
|
||||
|
||||
// time_jitter
|
||||
jitter_algorithm = (SrsRtmpJitterAlgorithm)_srs_config->get_time_jitter(req->vhost);
|
||||
|
||||
// mix_correct
|
||||
if (true) {
|
||||
bool v = _srs_config->get_mix_correct(req->vhost);
|
||||
|
||||
// when changed, clear the mix queue.
|
||||
if (v != mix_correct) {
|
||||
mix_queue->clear();
|
||||
}
|
||||
mix_correct = v;
|
||||
}
|
||||
|
||||
// atc changed.
|
||||
if (true) {
|
||||
bool v = _srs_config->get_atc(vhost);
|
||||
|
||||
if (v != atc) {
|
||||
srs_warn("vhost %s atc changed to %d, connected client may corrupt.", vhost.c_str(), v);
|
||||
gop_cache->clear();
|
||||
}
|
||||
atc = v;
|
||||
}
|
||||
|
||||
// gop cache changed.
|
||||
if (true) {
|
||||
bool v = _srs_config->get_gop_cache(vhost);
|
||||
|
||||
if (v != gop_cache->enabled()) {
|
||||
string url = req->get_stream_url();
|
||||
srs_trace("vhost %s gop_cache changed to %d, source url=%s", vhost.c_str(), v, url.c_str());
|
||||
gop_cache->set(v);
|
||||
gop_cache->set_gop_cache_max_frames(_srs_config->get_gop_cache_max_frames(vhost));
|
||||
}
|
||||
}
|
||||
|
||||
// queue length
|
||||
if (true) {
|
||||
srs_utime_t v = _srs_config->get_queue_length(req->vhost);
|
||||
|
||||
if (true) {
|
||||
std::vector<SrsLiveConsumer *>::iterator it;
|
||||
|
||||
for (it = consumers.begin(); it != consumers.end(); ++it) {
|
||||
SrsLiveConsumer *consumer = *it;
|
||||
consumer->set_queue_size(v);
|
||||
}
|
||||
|
||||
srs_trace("consumers reload queue size success.");
|
||||
}
|
||||
|
||||
// TODO: FIXME: https://github.com/ossrs/srs/issues/742#issuecomment-273656897
|
||||
// TODO: FIXME: support queue size.
|
||||
#if 0
|
||||
if (true) {
|
||||
std::vector<SrsForwarder*>::iterator it;
|
||||
|
||||
for (it = forwarders.begin(); it != forwarders.end(); ++it) {
|
||||
SrsForwarder* forwarder = *it;
|
||||
forwarder->set_queue_size(v);
|
||||
}
|
||||
|
||||
srs_trace("forwarders reload queue size success.");
|
||||
}
|
||||
|
||||
if (true) {
|
||||
publish_edge->set_queue_size(v);
|
||||
srs_trace("publish_edge reload queue size success.");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
srs_error_t SrsLiveSource::on_source_id_changed(SrsContextId id)
|
||||
{
|
||||
srs_error_t err = srs_success;
|
||||
|
|
|
|||
|
|
@ -577,9 +577,6 @@ public:
|
|||
virtual srs_error_t initialize(SrsSharedPtr<SrsLiveSource> wrapper, ISrsRequest *r);
|
||||
// Bridge to other source, forward packets to it.
|
||||
void set_bridge(ISrsStreamBridge *v);
|
||||
// Interface ISrsReloadHandler
|
||||
public:
|
||||
virtual srs_error_t on_reload_vhost_play(std::string vhost);
|
||||
|
||||
public:
|
||||
// The source id changed.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user