mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add author byteman for h264 to flv.
This commit is contained in:
parent
f3b441ba1f
commit
d6948d613f
5 changed files with 48 additions and 2 deletions
|
@ -1805,6 +1805,22 @@ int SrsConfig::get_bw_check_limit_kbps(const string &vhost)
|
|||
return ::atoi(conf->arg0().c_str());
|
||||
}
|
||||
|
||||
bool SrsConfig::get_vhost_is_edge(std::string vhost)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
||||
if (!conf) {
|
||||
return false;
|
||||
}
|
||||
|
||||
conf = conf->get("mode");
|
||||
if (!conf || conf->arg0() != "remote") {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
SrsConfDirective* SrsConfig::get_transcode(string vhost, string scope)
|
||||
{
|
||||
SrsConfDirective* conf = get_vhost(vhost);
|
||||
|
|
|
@ -163,7 +163,7 @@ public:
|
|||
virtual int get_pithy_print_ingester();
|
||||
virtual int get_pithy_print_hls();
|
||||
virtual int get_pithy_print_play();
|
||||
// vhost section
|
||||
// vhost specified section
|
||||
public:
|
||||
virtual SrsConfDirective* get_vhost(std::string vhost);
|
||||
virtual void get_vhosts(std::vector<SrsConfDirective*>& vhosts);
|
||||
|
@ -190,6 +190,9 @@ public:
|
|||
virtual std::string get_bw_check_key(const std::string& vhost);
|
||||
virtual int get_bw_check_interval_ms(const std::string& vhost);
|
||||
virtual int get_bw_check_limit_kbps(const std::string& vhost);
|
||||
// vhost edge section
|
||||
public:
|
||||
virtual bool get_vhost_is_edge(std::string vhost);
|
||||
// vhost transcode section
|
||||
public:
|
||||
virtual SrsConfDirective* get_transcode(std::string vhost, std::string scope);
|
||||
|
|
|
@ -286,8 +286,10 @@ int SrsRtmpConn::stream_service_cycle()
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool vhost_is_edge = _srs_config->get_vhost_is_edge(req->vhost);
|
||||
bool enabled_cache = _srs_config->get_gop_cache(req->vhost);
|
||||
srs_trace("source found, url=%s, enabled_cache=%d", req->get_stream_url().c_str(), enabled_cache);
|
||||
srs_trace("source found, url=%s, enabled_cache=%d, edge=%d",
|
||||
req->get_stream_url().c_str(), enabled_cache, vhost_is_edge);
|
||||
source->set_cache(enabled_cache);
|
||||
|
||||
switch (type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue