mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-28 05:29:24 +08:00
复用忽略协议查找流的相关代码
This commit is contained in:
@@ -79,16 +79,8 @@ std::shared_ptr<MediaSinkInterface> Recorder::createRecorder(type type, const st
|
||||
}
|
||||
}
|
||||
|
||||
static MediaSource::Ptr 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);
|
||||
}
|
||||
|
||||
bool Recorder::isRecording(type type, const string &vhost, const string &app, const string &stream_id){
|
||||
auto src = getMediaSource(vhost, app, stream_id);
|
||||
auto src = MediaSource::find(vhost, app, stream_id);
|
||||
if(!src){
|
||||
return false;
|
||||
}
|
||||
@@ -96,7 +88,7 @@ bool Recorder::isRecording(type type, const string &vhost, const string &app, co
|
||||
}
|
||||
|
||||
bool Recorder::startRecord(type type, const string &vhost, const string &app, const string &stream_id,const string &customized_path){
|
||||
auto src = getMediaSource(vhost, app, stream_id);
|
||||
auto src = MediaSource::find(vhost, app, stream_id);
|
||||
if (!src) {
|
||||
WarnL << "未找到相关的MediaSource,startRecord失败:" << vhost << "/" << app << "/" << stream_id;
|
||||
return false;
|
||||
@@ -105,7 +97,7 @@ bool Recorder::startRecord(type type, const string &vhost, const string &app, co
|
||||
}
|
||||
|
||||
bool Recorder::stopRecord(type type, const string &vhost, const string &app, const string &stream_id){
|
||||
auto src = getMediaSource(vhost, app, stream_id);
|
||||
auto src = MediaSource::find(vhost, app, stream_id);
|
||||
if(!src){
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user