From 23f9a42f729de368dcde4909b44259d526a2de85 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Sat, 1 Apr 2023 23:54:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=B8=8E=E7=B2=BE?= =?UTF-8?q?=E7=AE=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 12 ++++++------ server/WebHook.cpp | 2 +- server/main.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 2ea229c0..20ce4a88 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -537,7 +537,7 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream return; } //添加拉流代理 - auto player = std::make_shared(vhost, app, stream, option, retry_count >=0 ? retry_count : -1); + auto player = std::make_shared(vhost, app, stream, option, retry_count); s_proxyMap[key] = player; //指定RTP over TCP(播放rtsp时有效) @@ -952,7 +952,7 @@ void installWebApi() { } //添加推流代理 - PusherProxy::Ptr pusher(new PusherProxy(src, retry_count>=0 ? retry_count : -1)); + auto pusher = std::make_shared(src, retry_count); s_proxyPusherMap[key] = pusher; //指定RTP over TCP(播放rtsp时有效) @@ -988,7 +988,7 @@ void installWebApi() { CHECK_SECRET(); CHECK_ARGS("schema", "vhost", "app", "stream", "dst_url"); auto dst_url = allArgs["dst_url"]; - auto retry_count = allArgs["retry_count"].empty()? -1: allArgs["retry_count"].as(); + auto retry_count = allArgs["retry_count"].empty() ? -1 : allArgs["retry_count"].as(); addStreamPusherProxy(allArgs["schema"], allArgs["vhost"], allArgs["app"], @@ -1327,7 +1327,7 @@ void installWebApi() { invoker(200, headerOut, val.toStyledString()); }); }); - + //设置录像流播放速度 api_regist("/index/api/setRecordSpeed", [](API_ARGS_MAP_ASYNC) { CHECK_SECRET(); @@ -1407,7 +1407,7 @@ void installWebApi() { invoker(200, headerOut, val.toStyledString()); }); }); - + // 删除录像文件夹 // http://127.0.0.1/index/api/deleteRecordDirectroy?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01-01 api_regist("/index/api/deleteRecordDirectory", [](API_ARGS_MAP) { @@ -1424,7 +1424,7 @@ void installWebApi() { val["path"] = record_path; val["code"] = result; }); - + //获取录像文件夹列表或mp4文件列表 //http://127.0.0.1/index/api/getMp4RecordFile?vhost=__defaultVhost__&app=live&stream=ss&period=2020-01 api_regist("/index/api/getMp4RecordFile", [](API_ARGS_MAP){ diff --git a/server/WebHook.cpp b/server/WebHook.cpp index b66707f5..3e038c2d 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -161,7 +161,7 @@ void do_http_hook(const string &url, const ArgsType &body, const function(body)["mediaServerId"] = mediaServerId; - HttpRequester::Ptr requester(new HttpRequester); + auto requester = std::make_shared(); requester->setMethod("POST"); auto bodyStr = to_string(body); requester->setBody(bodyStr); diff --git a/server/main.cpp b/server/main.cpp index 8d3b0353..27f0b422 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -108,7 +108,7 @@ onceToken token1([](){ class CMD_main : public CMD { public: CMD_main() { - _parser.reset(new OptionParser(nullptr)); + _parser = std::make_shared(nullptr); #if !defined(_WIN32) (*_parser) << Option('d',/*该选项简称,如果是\x00则说明无简称*/