mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Kickoff publisher when stream is idle, which means no players. v6.0.31, v5.0.144 (#3105)
For some use scenario, the publisher is invited when player want to view the stream: 1. Publisher connect to system, but does not publish any stream to SRS yet. 2. Player connect to system and start to request the stream. 3. System notifies publisher to publish stream to SRS. 4. Player play the stream from SRS. Please notice that `system` means your business system, not SRS. This is what we called `on-demand-live-streaming`, so when the last player stop to view the stream, what happends? 1. System needs to notify publisher to stop publish. 2. Or, SRS disconnect the publisher when idle(the last player stops playing). This PR is for the solution 2, so that the cleanup is very simple, your system does not need to notify publisher to stop publish, because SRS has already disconnected the publihser. --------- Co-authored-by: winlin <winlin@vip.126.com> Co-authored-by: chundonglinlin <chundonglinlin@163.com>
This commit is contained in:
parent
dc7be76bb1
commit
8fde0366fb
14 changed files with 125 additions and 19 deletions
|
@ -1341,6 +1341,12 @@ vhost publish.srs.com {
|
||||||
# Overwrite by env SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST for all vhosts.
|
# Overwrite by env SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST for all vhosts.
|
||||||
# default: on
|
# default: on
|
||||||
try_annexb_first on;
|
try_annexb_first on;
|
||||||
|
# The timeout in seconds to disconnect publisher when idle, which means no players.
|
||||||
|
# Note that 0 means no timeout or this feature is disabled.
|
||||||
|
# Note that this feature conflicts with forward, because it disconnect the publisher stream.
|
||||||
|
# Overwrite by env SRS_VHOST_PUBLISH_KICKOFF_FOR_IDLE for all vhosts.
|
||||||
|
# default: 0
|
||||||
|
kickoff_for_idle 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
13
trunk/conf/rtmp.kickoff.conf
Normal file
13
trunk/conf/rtmp.kickoff.conf
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
# the config for srs to delivery RTMP with kicking off publish as no one watching.
|
||||||
|
# @see https://github.com/ossrs/srs/wiki/v1_CN_SampleRTMP
|
||||||
|
# @see full.conf for detail config.
|
||||||
|
|
||||||
|
listen 1935;
|
||||||
|
max_connections 1000;
|
||||||
|
daemon off;
|
||||||
|
srs_log_tank console;
|
||||||
|
vhost __defaultVhost__ {
|
||||||
|
publish {
|
||||||
|
kickoff_for_idle 60000;
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,6 +8,7 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 6.0 Changelog
|
## SRS 6.0 Changelog
|
||||||
|
|
||||||
|
* v6.0, 2023-03-04, Merge [#3105](https://github.com/ossrs/srs/pull/3105): Kickoff publisher when stream is idle, which means no players. v6.0.31 (#3105)
|
||||||
* v6.0, 2023-02-25, Merge [#3438](https://github.com/ossrs/srs/pull/3438): Forward add question mark to the end. v6.0.30 (#3438)
|
* v6.0, 2023-02-25, Merge [#3438](https://github.com/ossrs/srs/pull/3438): Forward add question mark to the end. v6.0.30 (#3438)
|
||||||
* v6.0, 2023-02-25, Merge [#3416](https://github.com/ossrs/srs/pull/3416): GB: Support HEVC for regression test and load tool for GB. v6.0.29 (#3416)
|
* v6.0, 2023-02-25, Merge [#3416](https://github.com/ossrs/srs/pull/3416): GB: Support HEVC for regression test and load tool for GB. v6.0.29 (#3416)
|
||||||
* v6.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v6.0.28 (#3424)
|
* v6.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v6.0.28 (#3424)
|
||||||
|
@ -44,7 +45,8 @@ The changelog for SRS.
|
||||||
|
|
||||||
## SRS 5.0 Changelog
|
## SRS 5.0 Changelog
|
||||||
|
|
||||||
* v5.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v5.0.142 (#3424)
|
* v5.0, 2023-03-04, Merge [#3105](https://github.com/ossrs/srs/pull/3105): Kickoff publisher when stream is idle, which means no players. v5.0.144 (#3105)
|
||||||
|
* v5.0, 2023-02-25, Merge [#3424](https://github.com/ossrs/srs/pull/3424): API: Add service_id for http_hooks, which identify the process. v5.0.143 (#3424)
|
||||||
* v5.0, 2023-02-22, Compatible with legacy RTMP URL. v5.0.142
|
* v5.0, 2023-02-22, Compatible with legacy RTMP URL. v5.0.142
|
||||||
* v5.0, 2023-02-12, Merge [#3409](https://github.com/ossrs/srs/pull/3409): SRT: Reduce latency to 200ms of srt2rtc.conf. v5.0.141 (#3409)
|
* v5.0, 2023-02-12, Merge [#3409](https://github.com/ossrs/srs/pull/3409): SRT: Reduce latency to 200ms of srt2rtc.conf. v5.0.141 (#3409)
|
||||||
* v5.0, 2023-02-08, Merge [#3391](https://github.com/ossrs/srs/pull/3391): Config: Error when both HLS and HTTP-TS enabled. v5.0.140 (#3391)
|
* v5.0, 2023-02-08, Merge [#3391](https://github.com/ossrs/srs/pull/3391): Config: Error when both HLS and HTTP-TS enabled. v5.0.140 (#3391)
|
||||||
|
|
|
@ -47,6 +47,7 @@ The features of SRS.
|
||||||
- [x] Live: Support origin cluster, please read [#464](https://github.com/ossrs/srs/issues/464), [RTMP 302](https://github.com/ossrs/srs/issues/92). v3.0.0+
|
- [x] Live: Support origin cluster, please read [#464](https://github.com/ossrs/srs/issues/464), [RTMP 302](https://github.com/ossrs/srs/issues/92). v3.0.0+
|
||||||
- [x] Live: Support NGINX HLS Cluster, see [CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster) or [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster). v5.0.28+
|
- [x] Live: Support NGINX HLS Cluster, see [CN](https://ossrs.net/lts/zh-cn/docs/v4/doc/sample-hls-cluster) or [EN](https://ossrs.io/lts/en-us/docs/v4/doc/sample-hls-cluster). v5.0.28+
|
||||||
- [x] Live: SRT: Support PUSH SRT by IP and optional port, see [#3198](https://github.com/ossrs/srs/issues/3198). v5.0.76+
|
- [x] Live: SRT: Support PUSH SRT by IP and optional port, see [#3198](https://github.com/ossrs/srs/issues/3198). v5.0.76+
|
||||||
|
- [x] Live: Kickoff publisher when stream is idle, which means no players. v5.0.144+
|
||||||
- [x] Live: [Experimental] Support SRT server, read [#1147](https://github.com/ossrs/srs/issues/1147). v4.0.143+
|
- [x] Live: [Experimental] Support SRT server, read [#1147](https://github.com/ossrs/srs/issues/1147). v4.0.143+
|
||||||
- [x] Live: [Experimental] Support Coroutine Native SRT over ST, [#3010](https://github.com/ossrs/srs/pull/3010). v5.0.30+
|
- [x] Live: [Experimental] Support Coroutine Native SRT over ST, [#3010](https://github.com/ossrs/srs/pull/3010). v5.0.30+
|
||||||
- [x] Live: [Experimental] Support MPEG-DASH, Dynamic Adaptive Streaming over HTTP, read [#299](https://github.com/ossrs/srs/issues/299). v5.0.96+
|
- [x] Live: [Experimental] Support MPEG-DASH, Dynamic Adaptive Streaming over HTTP, read [#299](https://github.com/ossrs/srs/issues/299). v5.0.96+
|
||||||
|
|
|
@ -2559,7 +2559,7 @@ srs_error_t SrsConfig::check_normal_config()
|
||||||
for (int j = 0; j < (int)conf->directives.size(); j++) {
|
for (int j = 0; j < (int)conf->directives.size(); j++) {
|
||||||
string m = conf->at(j)->name;
|
string m = conf->at(j)->name;
|
||||||
if (m != "mr" && m != "mr_latency" && m != "firstpkt_timeout" && m != "normal_timeout"
|
if (m != "mr" && m != "mr_latency" && m != "firstpkt_timeout" && m != "normal_timeout"
|
||||||
&& m != "parse_sps" && m != "try_annexb_first") {
|
&& m != "parse_sps" && m != "try_annexb_first" && m != "kickoff_for_idle") {
|
||||||
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.publish.%s of %s", m.c_str(), vhost->arg0().c_str());
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal vhost.publish.%s of %s", m.c_str(), vhost->arg0().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2727,6 +2727,14 @@ srs_error_t SrsConfig::check_normal_config()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check forward dnd kickoff for publsher idle.
|
||||||
|
for (int n = 0; n < (int)vhosts.size(); n++) {
|
||||||
|
SrsConfDirective* vhost = vhosts[n];
|
||||||
|
if (get_forward_enabled(vhost) && get_publish_kickoff_for_idle(vhost)) {
|
||||||
|
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "vhost.forward conflicts with vhost.publish.kickoff_for_idle");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check ingest id unique.
|
// check ingest id unique.
|
||||||
for (int i = 0; i < (int)vhosts.size(); i++) {
|
for (int i = 0; i < (int)vhosts.size(); i++) {
|
||||||
SrsConfDirective* vhost = vhosts[i];
|
SrsConfDirective* vhost = vhosts[i];
|
||||||
|
@ -5340,6 +5348,35 @@ srs_utime_t SrsConfig::get_publish_normal_timeout(string vhost)
|
||||||
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
|
return (srs_utime_t)(::atoi(conf->arg0().c_str()) * SRS_UTIME_MILLISECONDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
srs_utime_t SrsConfig::get_publish_kickoff_for_idle(std::string vhost)
|
||||||
|
{
|
||||||
|
return get_publish_kickoff_for_idle(get_vhost(vhost));
|
||||||
|
}
|
||||||
|
|
||||||
|
srs_utime_t SrsConfig::get_publish_kickoff_for_idle(SrsConfDirective* vhost)
|
||||||
|
{
|
||||||
|
SRS_OVERWRITE_BY_ENV_FLOAT_SECONDS("srs.vhost.publish.kickoff_for_idle"); // SRS_VHOST_PUBLISH_KICKOFF_FOR_IDLE
|
||||||
|
|
||||||
|
static srs_utime_t DEFAULT = 0 * SRS_UTIME_SECONDS;
|
||||||
|
|
||||||
|
SrsConfDirective* conf = vhost;
|
||||||
|
if (!conf) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf = conf->get("publish");
|
||||||
|
if (!conf) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
conf = conf->get("kickoff_for_idle");
|
||||||
|
if (!conf || conf->arg0().empty()) {
|
||||||
|
return DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (srs_utime_t)(::atof(conf->arg0().c_str()) * SRS_UTIME_SECONDS);
|
||||||
|
}
|
||||||
|
|
||||||
int SrsConfig::get_global_chunk_size()
|
int SrsConfig::get_global_chunk_size()
|
||||||
{
|
{
|
||||||
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.chunk_size"); // SRS_VHOST_CHUNK_SIZE
|
SRS_OVERWRITE_BY_ENV_INT("srs.vhost.chunk_size"); // SRS_VHOST_CHUNK_SIZE
|
||||||
|
|
|
@ -636,6 +636,9 @@ public:
|
||||||
virtual srs_utime_t get_publish_1stpkt_timeout(std::string vhost);
|
virtual srs_utime_t get_publish_1stpkt_timeout(std::string vhost);
|
||||||
// The normal packet timeout in srs_utime_t for encoder.
|
// The normal packet timeout in srs_utime_t for encoder.
|
||||||
virtual srs_utime_t get_publish_normal_timeout(std::string vhost);
|
virtual srs_utime_t get_publish_normal_timeout(std::string vhost);
|
||||||
|
// The kickoff timeout in srs_utime_t for publisher.
|
||||||
|
virtual srs_utime_t get_publish_kickoff_for_idle(std::string vhost);
|
||||||
|
virtual srs_utime_t get_publish_kickoff_for_idle(SrsConfDirective* vhost);
|
||||||
private:
|
private:
|
||||||
// Get the global chunk size.
|
// Get the global chunk size.
|
||||||
virtual int get_global_chunk_size();
|
virtual int get_global_chunk_size();
|
||||||
|
|
|
@ -985,6 +985,7 @@ srs_error_t SrsRtmpConn::do_publishing(SrsLiveSource* source, SrsPublishRecvThre
|
||||||
// initialize the publish timeout.
|
// initialize the publish timeout.
|
||||||
publish_1stpkt_timeout = _srs_config->get_publish_1stpkt_timeout(req->vhost);
|
publish_1stpkt_timeout = _srs_config->get_publish_1stpkt_timeout(req->vhost);
|
||||||
publish_normal_timeout = _srs_config->get_publish_normal_timeout(req->vhost);
|
publish_normal_timeout = _srs_config->get_publish_normal_timeout(req->vhost);
|
||||||
|
srs_utime_t publish_kickoff_for_idle = _srs_config->get_publish_kickoff_for_idle(req->vhost);
|
||||||
|
|
||||||
// set the sock options.
|
// set the sock options.
|
||||||
set_sock_options();
|
set_sock_options();
|
||||||
|
@ -1008,6 +1009,11 @@ srs_error_t SrsRtmpConn::do_publishing(SrsLiveSource* source, SrsPublishRecvThre
|
||||||
return srs_error_wrap(err, "rtmp: thread quit");
|
return srs_error_wrap(err, "rtmp: thread quit");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kick off the publisher when idle for a period of timeout.
|
||||||
|
if (source->publisher_is_idle_for(publish_kickoff_for_idle)) {
|
||||||
|
return srs_error_new(ERROR_KICKOFF_FOR_IDLE, "kicked for idle, url=%s, timeout=%ds", req->tcUrl.c_str(), srsu2si(publish_kickoff_for_idle));
|
||||||
|
}
|
||||||
|
|
||||||
pprint->elapse();
|
pprint->elapse();
|
||||||
|
|
||||||
// cond wait for timeout.
|
// cond wait for timeout.
|
||||||
|
|
|
@ -1877,7 +1877,7 @@ srs_error_t SrsLiveSourceManager::notify(int event, srs_utime_t interval, srs_ut
|
||||||
// @see https://github.com/ossrs/srs/issues/714
|
// @see https://github.com/ossrs/srs/issues/714
|
||||||
#if 0
|
#if 0
|
||||||
// When source expired, remove it.
|
// When source expired, remove it.
|
||||||
if (source->expired()) {
|
if (source->stream_is_dead()) {
|
||||||
int cid = source->source_id();
|
int cid = source->source_id();
|
||||||
if (cid == -1 && source->pre_source_id() > 0) {
|
if (cid == -1 && source->pre_source_id() > 0) {
|
||||||
cid = source->pre_source_id();
|
cid = source->pre_source_id();
|
||||||
|
@ -1926,7 +1926,8 @@ SrsLiveSource::SrsLiveSource()
|
||||||
mix_queue = new SrsMixQueue();
|
mix_queue = new SrsMixQueue();
|
||||||
|
|
||||||
_can_publish = true;
|
_can_publish = true;
|
||||||
die_at = 0;
|
stream_die_at_ = 0;
|
||||||
|
publisher_idle_at_ = 0;
|
||||||
|
|
||||||
handler = NULL;
|
handler = NULL;
|
||||||
bridge_ = NULL;
|
bridge_ = NULL;
|
||||||
|
@ -1983,10 +1984,10 @@ srs_error_t SrsLiveSource::cycle()
|
||||||
return srs_success;
|
return srs_success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SrsLiveSource::expired()
|
bool SrsLiveSource::stream_is_dead()
|
||||||
{
|
{
|
||||||
// unknown state?
|
// unknown state?
|
||||||
if (die_at == 0) {
|
if (stream_die_at_ == 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2001,13 +2002,26 @@ bool SrsLiveSource::expired()
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_utime_t now = srs_get_system_time();
|
srs_utime_t now = srs_get_system_time();
|
||||||
if (now > die_at + SRS_SOURCE_CLEANUP) {
|
if (now > stream_die_at_ + SRS_SOURCE_CLEANUP) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool SrsLiveSource::publisher_is_idle_for(srs_utime_t timeout)
|
||||||
|
{
|
||||||
|
if (!publisher_idle_at_ || !timeout) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
srs_utime_t now = srs_get_system_time();
|
||||||
|
if (now > publisher_idle_at_ + timeout) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
srs_error_t SrsLiveSource::initialize(SrsRequest* r, ISrsLiveSourceHandler* h)
|
srs_error_t SrsLiveSource::initialize(SrsRequest* r, ISrsLiveSourceHandler* h)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
@ -2635,6 +2649,11 @@ srs_error_t SrsLiveSource::on_publish()
|
||||||
SrsStatistic* stat = SrsStatistic::instance();
|
SrsStatistic* stat = SrsStatistic::instance();
|
||||||
stat->on_stream_publish(req, _source_id.c_str());
|
stat->on_stream_publish(req, _source_id.c_str());
|
||||||
|
|
||||||
|
// When no players, the publisher is idle now.
|
||||||
|
if (consumers.empty()) {
|
||||||
|
publisher_idle_at_ = srs_get_system_time();
|
||||||
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2680,7 +2699,7 @@ void SrsLiveSource::on_unpublish()
|
||||||
|
|
||||||
// no consumer, stream is die.
|
// no consumer, stream is die.
|
||||||
if (consumers.empty()) {
|
if (consumers.empty()) {
|
||||||
die_at = srs_get_system_time();
|
stream_die_at_ = srs_get_system_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2691,6 +2710,10 @@ srs_error_t SrsLiveSource::create_consumer(SrsLiveConsumer*& consumer)
|
||||||
consumer = new SrsLiveConsumer(this);
|
consumer = new SrsLiveConsumer(this);
|
||||||
consumers.push_back(consumer);
|
consumers.push_back(consumer);
|
||||||
|
|
||||||
|
// There should be one consumer, so reset the timeout.
|
||||||
|
stream_die_at_ = 0;
|
||||||
|
publisher_idle_at_ = 0;
|
||||||
|
|
||||||
// for edge, when play edge stream, check the state
|
// for edge, when play edge stream, check the state
|
||||||
if (_srs_config->get_vhost_is_edge(req->vhost)) {
|
if (_srs_config->get_vhost_is_edge(req->vhost)) {
|
||||||
// notice edge to start for the first client.
|
// notice edge to start for the first client.
|
||||||
|
@ -2755,7 +2778,15 @@ void SrsLiveSource::on_consumer_destroy(SrsLiveConsumer* consumer)
|
||||||
|
|
||||||
if (consumers.empty()) {
|
if (consumers.empty()) {
|
||||||
play_edge->on_all_client_stop();
|
play_edge->on_all_client_stop();
|
||||||
die_at = srs_get_system_time();
|
|
||||||
|
// For edge server, the stream die when the last player quit, because the edge stream is created by player
|
||||||
|
// activities, so it should die when all players quit.
|
||||||
|
if (_srs_config->get_vhost_is_edge(req->vhost)) {
|
||||||
|
stream_die_at_ = srs_get_system_time();
|
||||||
|
}
|
||||||
|
|
||||||
|
// When no players, the publisher is idle now.
|
||||||
|
publisher_idle_at_ = srs_get_system_time();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -533,17 +533,20 @@ private:
|
||||||
private:
|
private:
|
||||||
// Whether source is avaiable for publishing.
|
// Whether source is avaiable for publishing.
|
||||||
bool _can_publish;
|
bool _can_publish;
|
||||||
// The last die time, when all consumers quit and no publisher,
|
// The last die time, while die means neither publishers nor players.
|
||||||
// We will remove the source when source die.
|
srs_utime_t stream_die_at_;
|
||||||
srs_utime_t die_at;
|
// The last idle time, while idle means no players.
|
||||||
|
srs_utime_t publisher_idle_at_;
|
||||||
public:
|
public:
|
||||||
SrsLiveSource();
|
SrsLiveSource();
|
||||||
virtual ~SrsLiveSource();
|
virtual ~SrsLiveSource();
|
||||||
public:
|
public:
|
||||||
virtual void dispose();
|
virtual void dispose();
|
||||||
virtual srs_error_t cycle();
|
virtual srs_error_t cycle();
|
||||||
// Remove source when expired.
|
// Whether stream is dead, which is no publisher or player.
|
||||||
virtual bool expired();
|
virtual bool stream_is_dead();
|
||||||
|
// Whether publisher is idle for a period of timeout.
|
||||||
|
bool publisher_is_idle_for(srs_utime_t timeout);
|
||||||
public:
|
public:
|
||||||
// Initialize the hls with handlers.
|
// Initialize the hls with handlers.
|
||||||
virtual srs_error_t initialize(SrsRequest* r, ISrsLiveSourceHandler* h);
|
virtual srs_error_t initialize(SrsRequest* r, ISrsLiveSourceHandler* h);
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 5
|
#define VERSION_MAJOR 5
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 143
|
#define VERSION_REVISION 144
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
#define VERSION_MAJOR 6
|
#define VERSION_MAJOR 6
|
||||||
#define VERSION_MINOR 0
|
#define VERSION_MINOR 0
|
||||||
#define VERSION_REVISION 30
|
#define VERSION_REVISION 31
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -167,6 +167,7 @@
|
||||||
XX(ERROR_RTMP_MESSAGE_CREATE , 2053, "MessageCreate", "Failed to create shared pointer message") \
|
XX(ERROR_RTMP_MESSAGE_CREATE , 2053, "MessageCreate", "Failed to create shared pointer message") \
|
||||||
XX(ERROR_RTMP_PROXY_EXCEED , 2054, "RtmpProxy", "Failed to decode message of RTMP proxy") \
|
XX(ERROR_RTMP_PROXY_EXCEED , 2054, "RtmpProxy", "Failed to decode message of RTMP proxy") \
|
||||||
XX(ERROR_RTMP_CREATE_STREAM_DEPTH , 2055, "RtmpIdentify", "Failed to identify RTMP client") \
|
XX(ERROR_RTMP_CREATE_STREAM_DEPTH , 2055, "RtmpIdentify", "Failed to identify RTMP client") \
|
||||||
|
XX(ERROR_KICKOFF_FOR_IDLE , 2056, "KickoffForIdle", "Kickoff for publisher is idle") \
|
||||||
XX(ERROR_CONTROL_REDIRECT , 2997, "RtmpRedirect", "RTMP 302 redirection") \
|
XX(ERROR_CONTROL_REDIRECT , 2997, "RtmpRedirect", "RTMP 302 redirection") \
|
||||||
XX(ERROR_CONTROL_RTMP_CLOSE , 2998, "RtmpClose", "RTMP connection is closed") \
|
XX(ERROR_CONTROL_RTMP_CLOSE , 2998, "RtmpClose", "RTMP connection is closed") \
|
||||||
XX(ERROR_CONTROL_REPUBLISH , 2999, "RtmpRepublish", "RTMP stream is republished")
|
XX(ERROR_CONTROL_REPUBLISH , 2999, "RtmpRepublish", "RTMP stream is republished")
|
||||||
|
|
|
@ -4461,6 +4461,9 @@ VOID TEST(ConfigEnvTest, CheckEnvValuesVhostPublish)
|
||||||
|
|
||||||
SrsSetEnvConfig(try_annexb_first, "SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST", "off");
|
SrsSetEnvConfig(try_annexb_first, "SRS_VHOST_PUBLISH_TRY_ANNEXB_FIRST", "off");
|
||||||
EXPECT_FALSE(conf.try_annexb_first("__defaultVhost__"));
|
EXPECT_FALSE(conf.try_annexb_first("__defaultVhost__"));
|
||||||
|
|
||||||
|
SrsSetEnvConfig(kickoff_for_idle, "SRS_VHOST_PUBLISH_KICKOFF_FOR_IDLE", "30");
|
||||||
|
EXPECT_EQ(30 * SRS_UTIME_SECONDS, conf.get_publish_kickoff_for_idle("__defaultVhost__"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue