From 86029d08afbb744c6098ace2fd43d32bb1c35ac3 Mon Sep 17 00:00:00 2001 From: alexliyu7352 Date: Fri, 1 Dec 2023 14:33:07 +0800 Subject: [PATCH] =?UTF-8?q?addStreamProxy=E6=94=AF=E6=8C=81=E9=80=8F?= =?UTF-8?q?=E4=BC=A0=E5=8F=82=E6=95=B0=E5=B9=B6=E8=AE=BE=E7=BD=AEMediaPlay?= =?UTF-8?q?er=20(#3063)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 通过addStreamProxy接口可以直接配置MediaPlayer相关设置参数,比如说http代理url等 --- server/WebApi.cpp | 10 +- server/WebApi.h | 2 +- server/WebHook.cpp | 2 +- src/Http/HttpClient.cpp | 15 +- www/swagger/openapi.json | 306 +++++++++++++++++++++++++++------------ 5 files changed, 234 insertions(+), 101 deletions(-) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index 8bd2f416..58bf5627 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -540,7 +540,7 @@ void getStatisticJson(const function &cb) { } void addStreamProxy(const string &vhost, const string &app, const string &stream, const string &url, int retry_count, - const ProtocolOption &option, int rtp_type, float timeout_sec, + const ProtocolOption &option, int rtp_type, float timeout_sec, const mINI &args, const function &cb) { auto key = getProxyKey(vhost, app, stream); lock_guard lck(s_proxyMapMtx); @@ -575,6 +575,7 @@ void addStreamProxy(const string &vhost, const string &app, const string &stream lock_guard lck(s_proxyMapMtx); s_proxyMap.erase(key); }); + player->mINI::operator=(args); player->play(url); }; @@ -1058,6 +1059,11 @@ void installWebApi() { CHECK_SECRET(); CHECK_ARGS("vhost","app","stream","url"); + mINI args; + for (auto &pr : allArgs.getArgs()) { + args.emplace(pr.first, pr.second); + } + ProtocolOption option(allArgs); auto retry_count = allArgs["retry_count"].empty()? -1: allArgs["retry_count"].as(); addStreamProxy(allArgs["vhost"], @@ -1068,6 +1074,7 @@ void installWebApi() { option, allArgs["rtp_type"], allArgs["timeout_sec"], + args, [invoker,val,headerOut](const SockException &ex,const string &key) mutable{ if (ex) { val["code"] = API::OtherFailed; @@ -1891,6 +1898,7 @@ void installWebApi() { option, 0,//rtp over tcp方式拉流 10,//10秒超时 + mINI{}, [invoker,val,headerOut](const SockException &ex,const string &key) mutable{ if(ex){ val["code"] = API::OtherFailed; diff --git a/server/WebApi.h b/server/WebApi.h index f7ec0cb3..ea6caa81 100755 --- a/server/WebApi.h +++ b/server/WebApi.h @@ -247,6 +247,6 @@ bool closeRtpServer(const std::string &stream_id); Json::Value makeMediaSourceJson(mediakit::MediaSource &media); void getStatisticJson(const std::function &cb); void addStreamProxy(const std::string &vhost, const std::string &app, const std::string &stream, const std::string &url, int retry_count, - const mediakit::ProtocolOption &option, int rtp_type, float timeout_sec, + const mediakit::ProtocolOption &option, int rtp_type, float timeout_sec, const toolkit::mINI &args, const std::function &cb); #endif //ZLMEDIAKIT_WEBAPI_H diff --git a/server/WebHook.cpp b/server/WebHook.cpp index 409d11f4..f0e68972 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -301,7 +301,7 @@ static void pullStreamFromOrigin(const vector &urls, size_t index, size_ option.enable_hls = option.enable_hls || (args.schema == HLS_SCHEMA); option.enable_mp4 = false; - addStreamProxy(args.vhost, args.app, args.stream, url, retry_count, option, Rtsp::RTP_TCP, timeout_sec, [=](const SockException &ex, const string &key) mutable { + addStreamProxy(args.vhost, args.app, args.stream, url, retry_count, option, Rtsp::RTP_TCP, timeout_sec, mINI{}, [=](const SockException &ex, const string &key) mutable { if (!ex) { return; } diff --git a/src/Http/HttpClient.cpp b/src/Http/HttpClient.cpp index 793e9ca1..068727a5 100644 --- a/src/Http/HttpClient.cpp +++ b/src/Http/HttpClient.cpp @@ -78,15 +78,16 @@ void HttpClient::sendRequest(const string &url) { printer.pop_back(); _header.emplace("Cookie", printer); } - if (isUsedProxy()) { - startConnect(_proxy_host, _proxy_port, _wait_header_ms / 1000.0f); - } else { - if (!alive() || host_changed) { - startConnect(host, port, _wait_header_ms / 1000.0f); + if (!alive() || host_changed) { + if (isUsedProxy()) { + _proxy_connected = false; + startConnect(_proxy_host, _proxy_port, _wait_header_ms / 1000.0f); } else { - SockException ex; - onConnect_l(ex); + startConnect(host, port, _wait_header_ms / 1000.0f); } + } else { + SockException ex; + onConnect_l(ex); } } diff --git a/www/swagger/openapi.json b/www/swagger/openapi.json index 485cfe9e..1e4a7d17 100644 --- a/www/swagger/openapi.json +++ b/www/swagger/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "ZLMediaKit HTTP API", "description": "You can test the HTTP API provided by ZlMediaKit here. For usage documentation, please refer to [here](https://docs.zlmediakit.com/guide/media_server/restful_api.html)", - "version": "ZLMediaKit(git hash:\"a78ca2e\"/\"2023-11-17T11:12:51+08:00\",branch:\"patch-63\",build time:\"2023-11-23T14:35:02\")", + "version": "ZLMediaKit(git hash:\"644a333\"/\"2023-11-30T17:58:28+08:00\",branch:\"master\",build time:\"2023-11-30T14:05:40\")", "x-logo": { "url": "/logo.png", "backgroundColor": "#FFFFFF", @@ -45,7 +45,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -70,7 +70,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -97,7 +97,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -122,7 +122,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -149,7 +149,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -174,7 +174,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -201,7 +201,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -226,7 +226,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -253,7 +253,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -278,7 +278,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -305,7 +305,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "api.apiDebug", @@ -339,7 +339,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "api.apiDebug", @@ -375,7 +375,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -400,7 +400,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -427,7 +427,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -452,7 +452,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -479,7 +479,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -540,7 +540,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -603,7 +603,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -664,7 +664,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -727,7 +727,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -752,7 +752,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -779,7 +779,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "id", @@ -813,7 +813,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "id", @@ -849,7 +849,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -874,7 +874,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -901,7 +901,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -962,7 +962,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -1025,7 +1025,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1059,7 +1059,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1095,7 +1095,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1165,7 +1165,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1237,7 +1237,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1271,7 +1271,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1307,7 +1307,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "src_url", @@ -1377,7 +1377,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "src_url", @@ -1449,7 +1449,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1482,7 +1482,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -1517,7 +1517,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1578,7 +1578,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1641,7 +1641,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1702,7 +1702,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1765,7 +1765,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1834,7 +1834,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1905,7 +1905,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -1966,7 +1966,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "schema", @@ -2029,7 +2029,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2099,7 +2099,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2171,7 +2171,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2232,7 +2232,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2295,7 +2295,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2356,7 +2356,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2419,7 +2419,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2480,7 +2480,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2543,7 +2543,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2604,7 +2604,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -2667,7 +2667,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2728,7 +2728,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2791,7 +2791,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2852,7 +2852,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "type", @@ -2915,7 +2915,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "url", @@ -2967,7 +2967,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "url", @@ -3021,7 +3021,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3055,7 +3055,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3091,7 +3091,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "port", @@ -3143,7 +3143,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "port", @@ -3197,7 +3197,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "dst_url", @@ -3249,7 +3249,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "dst_url", @@ -3303,7 +3303,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3337,7 +3337,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3373,7 +3373,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3416,7 +3416,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3461,7 +3461,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3495,7 +3495,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3531,7 +3531,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3565,7 +3565,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "stream_id", @@ -3601,7 +3601,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -3626,7 +3626,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -3653,7 +3653,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -3741,7 +3741,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -3831,7 +3831,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -3892,7 +3892,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -3955,7 +3955,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -4007,7 +4007,7 @@ "type": "string" }, "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "vhost", @@ -4060,7 +4060,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -4084,7 +4084,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" } ], "responses": { @@ -4110,7 +4110,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -4142,7 +4142,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -4176,7 +4176,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -4208,7 +4208,7 @@ "schema": { "type": "string" }, - "example": "1oV1R5Z9xlrjH4QN7GXNvS5IUaYtuFgX" + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" }, { "name": "key", @@ -4228,6 +4228,130 @@ } } } + }, + "/index/api/loadMP4File": { + "get": { + "tags": [ + "GET" + ], + "summary": "\u70b9\u64admp4\u6587\u4ef6(loadMP4File)", + "parameters": [ + { + "name": "secret", + "in": "query", + "schema": { + "type": "string" + }, + "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" + }, + { + "name": "vhost", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684\u865a\u62df\u4e3b\u673a\uff0c\u4f8b\u5982__defaultVhost__", + "example": "__defaultVhost__" + }, + { + "name": "app", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684\u5e94\u7528\u540d\uff0c\u4f8b\u5982live", + "example": "live" + }, + { + "name": "stream", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684id\u540d\uff0c\u4f8b\u5982test", + "example": "test" + }, + { + "name": "file_path", + "in": "query", + "schema": { + "type": "string" + }, + "description": "mp4\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84", + "example": "/path/to/mp4/file.mp4" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": {} + } + } + } + }, + "post": { + "tags": [ + "POST" + ], + "summary": "\u70b9\u64admp4\u6587\u4ef6(loadMP4File)", + "parameters": [ + { + "name": "secret", + "in": "query", + "schema": { + "type": "string" + }, + "description": "api\u64cd\u4f5c\u5bc6\u94a5(\u914d\u7f6e\u6587\u4ef6\u914d\u7f6e)", + "example": "OJnXXZ4Eh1uHvDmJz8eud5ykuprr0AWv" + }, + { + "name": "vhost", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684\u865a\u62df\u4e3b\u673a\uff0c\u4f8b\u5982__defaultVhost__", + "example": "__defaultVhost__" + }, + { + "name": "app", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684\u5e94\u7528\u540d\uff0c\u4f8b\u5982live", + "example": "live" + }, + { + "name": "stream", + "in": "query", + "schema": { + "type": "string" + }, + "description": "\u6dfb\u52a0\u7684\u6d41\u7684id\u540d\uff0c\u4f8b\u5982test", + "example": "test" + }, + { + "name": "file_path", + "in": "query", + "schema": { + "type": "string" + }, + "description": "mp4\u6587\u4ef6\u7edd\u5bf9\u8def\u5f84", + "example": "/path/to/mp4/file.mp4" + } + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": {} + } + } + } + } } } } \ No newline at end of file