mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
复用忽略协议查找流的相关代码
This commit is contained in:
@@ -810,19 +810,11 @@ void installWebApi() {
|
||||
}
|
||||
});
|
||||
|
||||
static auto getMediaSource = [](const string &vhost, const string &app, const string &stream_id){
|
||||
auto src = MediaSource::find(RTMP_SCHEMA, vhost, app, stream_id);
|
||||
if(src){
|
||||
return src;
|
||||
}
|
||||
return MediaSource::find(RTSP_SCHEMA, vhost, app, stream_id);
|
||||
};
|
||||
|
||||
api_regist2("/index/api/startSendRtp",[](API_ARGS2){
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("vhost", "app", "stream", "ssrc", "dst_url", "dst_port", "is_udp");
|
||||
|
||||
auto src = getMediaSource(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||
auto src = MediaSource::find(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||
if (!src) {
|
||||
throw ApiRetException("该媒体流不存在", API::OtherFailed);
|
||||
}
|
||||
@@ -840,7 +832,7 @@ void installWebApi() {
|
||||
CHECK_SECRET();
|
||||
CHECK_ARGS("vhost", "app", "stream");
|
||||
|
||||
auto src = getMediaSource(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||
auto src = MediaSource::find(allArgs["vhost"], allArgs["app"], allArgs["stream"]);
|
||||
if (!src) {
|
||||
throw ApiRetException("该媒体流不存在", API::OtherFailed);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user