优化函数命名风格

FindField改名为findSubString
This commit is contained in:
xia-chu
2023-06-10 12:28:49 +08:00
committed by 夏楚
parent 31944a92ad
commit 64b8079ac1
17 changed files with 51 additions and 50 deletions

View File

@@ -124,7 +124,7 @@ int main(int argc, char *argv[]) {
auto delay_ms = cmd_main["delay"].as<int>();
auto pusher_count = cmd_main["count"].as<int>();
auto merge_ms = cmd_main["merge"].as<int>();
auto schema = FindField(out_url.data(), nullptr, "://");
auto schema = findSubString(out_url.data(), nullptr, "://");
if (schema != RTSP_SCHEMA && schema != RTMP_SCHEMA) {
cout << "推流协议只支持rtsp或rtmp" << endl;
return -1;

View File

@@ -114,7 +114,7 @@ int domain(const string &filePath, const string &pushUrl) {
auto poller = EventPollerPool::Instance().getPoller();
//vhost/app/stream可以随便自己填现在不限制app应用名了
createPusher(poller, FindField(pushUrl.data(), nullptr, "://").substr(0, 4), DEFAULT_VHOST, "live", "stream", filePath, pushUrl);
createPusher(poller, findSubString(pushUrl.data(), nullptr, "://").substr(0, 4), DEFAULT_VHOST, "live", "stream", filePath, pushUrl);
//设置退出信号处理函数
static semaphore sem;
signal(SIGINT, [](int) { sem.post(); });// 设置退出信号