关闭转协议后,将关闭解复用以提供性能

This commit is contained in:
xiongziliang
2020-04-29 11:59:45 +08:00
parent 0270057907
commit 3630839bc9
4 changed files with 44 additions and 4 deletions

View File

@@ -22,17 +22,21 @@ MultiMuxerPrivate::MultiMuxerPrivate(const string &vhost,
bool enable_mp4) {
if (enable_rtmp) {
_rtmp = std::make_shared<RtmpMediaSourceMuxer>(vhost, app, stream, std::make_shared<TitleMeta>(dur_sec));
_enable_rtxp = true;
}
if (enable_rtsp) {
_rtsp = std::make_shared<RtspMediaSourceMuxer>(vhost, app, stream, std::make_shared<TitleSdp>(dur_sec));
_enable_rtxp = true;
}
if (enable_hls) {
_hls = Recorder::createRecorder(Recorder::type_hls, vhost, app, stream);
_enable_record = true;
}
if (enable_mp4) {
_mp4 = Recorder::createRecorder(Recorder::type_mp4, vhost, app, stream);
_enable_record = true;
}
}
@@ -102,6 +106,7 @@ bool MultiMuxerPrivate::setupRecord(MediaSource &sender, Recorder::type type, bo
//停止录制
_hls = nullptr;
}
_enable_record = _hls || _mp4;
return true;
}
case Recorder::type_mp4 : {
@@ -112,10 +117,10 @@ bool MultiMuxerPrivate::setupRecord(MediaSource &sender, Recorder::type type, bo
//停止录制
_mp4 = nullptr;
}
_enable_record = _hls || _mp4;
return true;
}
default:
return false;
default : return false;
}
}
@@ -163,6 +168,10 @@ void MultiMuxerPrivate::onTrackReady(const Track::Ptr &track) {
}
}
bool MultiMuxerPrivate::isEnabled(){
return _enable_rtxp || _enable_record;
}
void MultiMuxerPrivate::onTrackFrame(const Frame::Ptr &frame) {
if (_rtmp) {
_rtmp->inputFrame(frame);
@@ -293,4 +302,9 @@ void MultiMediaSourceMuxer::inputFrame(const Frame::Ptr &frame) {
_muxer->inputFrame(frame);
}
bool MultiMediaSourceMuxer::isEnabled(){
return _muxer->isEnabled();
}
}//namespace mediakit