@@ -685,6 +685,7 @@ void addStreamPusherProxy(const string &schema,
685685 int retry_count,
686686 int rtp_type,
687687 float timeout_sec,
688+ const mINI &args,
688689 const function<void (const SockException &ex, const string &key)> &cb) {
689690 auto key = getPusherKey (schema, vhost, app, stream, url);
690691 auto src = MediaSource::find (schema, vhost, app, stream);
@@ -703,14 +704,20 @@ void addStreamPusherProxy(const string &schema,
703704 // Add push stream proxy
704705 auto pusher = s_pusher_proxy.make (key, src, retry_count);
705706
707+ // 先透传拷贝参数 [AUTO-TRANSLATED:22b5605e]
708+ // First pass-through copy parameters
709+ for (auto &pr : args) {
710+ (*pusher)[pr.first ] = pr.second ;
711+ }
712+
706713 // 指定RTP over TCP(播放rtsp时有效) [AUTO-TRANSLATED:1a062656]
707714 // Specify RTP over TCP (effective when playing RTSP)
708- pusher-> emplace ( Client::kRtpType , rtp_type) ;
715+ (*pusher)[ Client::kRtpType ] = rtp_type;
709716
710717 if (timeout_sec > 0 .1f ) {
711718 // 推流握手超时时间 [AUTO-TRANSLATED:00762fc1]
712719 // Push stream handshake timeout
713- pusher-> emplace ( Client::kTimeoutMS , timeout_sec * 1000 ) ;
720+ (*pusher)[ Client::kTimeoutMS ] = timeout_sec * 1000 ;
714721 }
715722
716723 // 开始推流,如果推流失败或者推流中止,将会自动重试若干次,默认一直重试 [AUTO-TRANSLATED:c8b95088]
@@ -1174,6 +1181,12 @@ void installWebApi() {
11741181 api_regist (" /index/api/addStreamPusherProxy" , [](API_ARGS_MAP_ASYNC) {
11751182 CHECK_SECRET ();
11761183 CHECK_ARGS (" schema" , " vhost" , " app" , " stream" , " dst_url" );
1184+
1185+ mINI args;
1186+ for (auto &pr : allArgs.args ) {
1187+ args.emplace (pr.first , pr.second );
1188+ }
1189+
11771190 auto dst_url = allArgs[" dst_url" ];
11781191 auto retry_count = allArgs[" retry_count" ].empty () ? -1 : allArgs[" retry_count" ].as <int >();
11791192 addStreamPusherProxy (allArgs[" schema" ],
@@ -1184,6 +1197,7 @@ void installWebApi() {
11841197 retry_count,
11851198 allArgs[" rtp_type" ],
11861199 allArgs[" timeout_sec" ],
1200+ args,
11871201 [invoker, val, headerOut, dst_url](const SockException &ex, const string &key) mutable {
11881202 if (ex) {
11891203 val[" code" ] = API::OtherFailed;
0 commit comments