mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
Add the listRtpSender http api
This commit is contained in:
@@ -1347,6 +1347,26 @@ void installWebApi() {
|
||||
});
|
||||
});
|
||||
|
||||
api_regist("/index/api/listRtpSender",[](API_ARGS_MAP_ASYNC){
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("vhost", "app", "stream");
|
||||
|
||||
auto src = MediaSource::find(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||
if (!src) {
|
||||
throw ApiRetException("can not find the source stream", API::NotFound);
|
||||
}
|
||||
|
||||
auto muxer = src->getMuxer();
|
||||
CHECK(muxer, "get muxer from media source failed");
|
||||
|
||||
src->getOwnerPoller()->async([=]() mutable {
|
||||
muxer->forEachRtpSender([&](const std::string &ssrc) mutable {
|
||||
val["data"].append(ssrc);
|
||||
});
|
||||
invoker(200, headerOut, val.toStyledString());
|
||||
});
|
||||
});
|
||||
|
||||
api_regist("/index/api/startSendRtpPassive",[](API_ARGS_MAP_ASYNC){
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("vhost", "app", "stream", "ssrc");
|
||||
|
||||
Reference in New Issue
Block a user