Skip to content

Commit

Permalink
For #1615, support default app(live) for vmix SRT. 4.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed Feb 25, 2020
1 parent 771f07e commit 90afd06
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ For previous versions, please read:

## V4 changes

* v4.0, 2020-02-25, For [#1615][bug #1615], support default app(live) for vmix SRT. 4.0.9
* v4.0, 2020-02-21, For [#1598][bug #1598], support SLB health checking by TCP. 4.0.8
* v4.0, 2020-02-19, For [#1579][bug #1579], support rolling update of k8s. 4.0.7
* v4.0, 2020-02-18, For [#1579][bug #1579], support start/final wait for gracefully quit. 4.0.6
Expand Down Expand Up @@ -1685,6 +1686,7 @@ Winlin
[bug #1601]: https://github.com/ossrs/srs/issues/1601
[bug #1579]: https://github.com/ossrs/srs/issues/1579
[bug #1598]: https://github.com/ossrs/srs/issues/1598
[bug #1615]: https://github.com/ossrs/srs/issues/1615
[bug #xxxxxxxxxxxxx]: https://github.com/ossrs/srs/issues/xxxxxxxxxxxxx

[exo #828]: https://github.com/google/ExoPlayer/pull/828
Expand Down
3 changes: 3 additions & 0 deletions trunk/conf/full.conf
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ srt_server {
connect_timeout 4000;
peerlatency 300;
recvlatency 300;
# Default app for vmix, see https://github.com/ossrs/srs/pull/1615
# default: live
default_app live;
}

#############################################################################################
Expand Down
17 changes: 16 additions & 1 deletion trunk/src/app/srs_app_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,8 @@ srs_error_t SrsConfig::check_normal_config()
if (n != "enabled" && n != "listen" && n != "maxbw"
&& n != "mss" && n != "latency" && n != "recvlatency"
&& n != "peerlatency" && n != "tlpkdrop" && n != "connect_timeout"
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize") {
&& n != "sendbuf" && n != "recvbuf" && n != "payloadsize"
&& n != "default_app") {
return srs_error_new(ERROR_SYSTEM_CONFIG_INVALID, "illegal srt_stream.%s", n.c_str());
}
}
Expand Down Expand Up @@ -6893,6 +6894,20 @@ int SrsConfig::get_srto_payloadsize() {
return atoi(conf->arg0().c_str());
}

string SrsConfig::get_default_app_name() {
static string DEFAULT = "live";
SrsConfDirective* conf = root->get("srt_server");
if (!conf) {
return DEFAULT;
}

conf = conf->get("default_app");
if (!conf || conf->arg0().empty()) {
return DEFAULT;
}
return conf->arg0();
}

bool SrsConfig::get_http_stream_enabled()
{
SrsConfDirective* conf = root->get("http_server");
Expand Down
2 changes: 2 additions & 0 deletions trunk/src/app/srs_app_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,8 @@ class SrsConfig
virtual int get_srto_recvbuf();
// SRTO_PAYLOADSIZE
virtual int get_srto_payloadsize();
// Get the default app.
virtual std::string get_default_app_name();

// http_hooks section
private:
Expand Down
2 changes: 1 addition & 1 deletion trunk/src/core/srs_core_version4.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
#ifndef SRS_CORE_VERSION4_HPP
#define SRS_CORE_VERSION4_HPP

#define SRS_VERSION4_REVISION 8
#define SRS_VERSION4_REVISION 9

#endif
4 changes: 3 additions & 1 deletion trunk/src/srt/srt_conn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include "stringex.hpp"
#include <vector>

#include <srs_app_config.hpp>

bool is_streamid_valid(const std::string& streamid) {
if (streamid.empty()) {
return false;
Expand Down Expand Up @@ -71,7 +73,7 @@ bool get_streamid_info(const std::string& streamid, int& mode, std::string& url_
if (pos != 0) {
pos = streamid.find("/");
if (pos == streamid.npos) {
url_subpath = "live/" + streamid;
url_subpath = _srs_config->get_default_app_name() + "/" + streamid;
return true;
}
url_subpath = streamid;
Expand Down

0 comments on commit 90afd06

Please sign in to comment.