新增更新流代理的功能,支持修改已有拉流代理的URL和参数

This commit is contained in:
xia-chu
2026-03-20 21:59:55 +08:00
parent 0f704cca47
commit 899d9653a4
5 changed files with 61 additions and 25 deletions

View File

@@ -592,6 +592,17 @@ void getStatisticJson(const function<void(Value &val)> &cb) {
#endif
}
void updateStreamProxy(const mediakit::MediaTuple &tuple, const std::string &url, const toolkit::mINI &args) {
auto key = tuple.shortUrl();
auto player = s_player_proxy.find(key);
if (!player) {
throw std::runtime_error("proxy player not found: " + key);
}
player->getPoller()->async([url, args, player]() {
player->update(url, args);
});
}
void addStreamProxy(const MediaTuple &tuple, const string &url, int retry_count, bool force,
const ProtocolOption &option, float timeout_sec, const mINI &args,
const function<void(const SockException &ex, const string &key)> &cb) {