mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
use system utility for string finds
This commit is contained in:
parent
ca73534d7e
commit
d9f991ed2f
16 changed files with 111 additions and 112 deletions
|
@ -44,7 +44,7 @@ using namespace std;
|
|||
void srs_discovery_tc_url(
|
||||
string tcUrl,
|
||||
string& schema, string& host, string& vhost,
|
||||
string& app, int& port, std::string& param
|
||||
string& app, int& port, string& param
|
||||
) {
|
||||
size_t pos = std::string::npos;
|
||||
std::string url = tcUrl;
|
||||
|
@ -229,7 +229,7 @@ int srs_rtmp_create_msg(char type, u_int32_t timestamp, char* data, int size, in
|
|||
return ret;
|
||||
}
|
||||
|
||||
std::string srs_generate_stream_url(std::string vhost, std::string app, std::string stream)
|
||||
string srs_generate_stream_url(string vhost, string app, string stream)
|
||||
{
|
||||
std::string url = "";
|
||||
|
||||
|
@ -244,6 +244,18 @@ std::string srs_generate_stream_url(std::string vhost, std::string app, std::str
|
|||
return url;
|
||||
}
|
||||
|
||||
void srs_parse_rtmp_url(string url, string& tcUrl, string& stream)
|
||||
{
|
||||
size_t pos;
|
||||
|
||||
if ((pos = url.rfind("/")) != string::npos) {
|
||||
stream = url.substr(pos + 1);
|
||||
tcUrl = url.substr(0, pos);
|
||||
} else {
|
||||
tcUrl = url;
|
||||
}
|
||||
}
|
||||
|
||||
string srs_generate_rtmp_url(string server, int port, string vhost, string app, string stream)
|
||||
{
|
||||
std::stringstream ss;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue