Commit 722097be by Johnny

调整 RtspSession::_push_src类型,统一为 RtspMediaSource::Ptr _push_src;

parent efa839c6
......@@ -187,9 +187,9 @@ bool MultiMediaSourceMuxer::setupRecord(MediaSource &sender, Recorder::type type
bool MultiMediaSourceMuxer::isRecording(MediaSource &sender, Recorder::type type) {
switch (type){
case Recorder::type_hls :
return _hls ? true : false;
return !!_hls;
case Recorder::type_mp4 :
return _mp4 ? true : false;
return !!_mp4;
default:
return false;
}
......
......@@ -259,10 +259,11 @@ void RtspSession::handleReq_ANNOUNCE(const Parser &parser) {
for (auto &track : _sdp_track) {
_rtcp_context.emplace_back(std::make_shared<RtcpContextForRecv>());
}
_push_src = std::make_shared<RtspMediaSourceImp>(_media_info._vhost, _media_info._app, _media_info._streamid);
_push_src->setListener(dynamic_pointer_cast<MediaSourceEvent>(shared_from_this()));
_push_src->setProtocolTranslation(enableHls, enableMP4);
_push_src->setSdp(parser.Content());
auto push_src = std::make_shared<RtspMediaSourceImp>(_media_info._vhost, _media_info._app, _media_info._streamid);
push_src->setListener(dynamic_pointer_cast<MediaSourceEvent>(shared_from_this()));
push_src->setProtocolTranslation(enableHls, enableMP4);
push_src->setSdp(parser.Content());
_push_src = std::move(push_src);
sendRtspResponse("200 OK");
};
......
......@@ -185,7 +185,7 @@ private:
//url解析后保存的相关信息
MediaInfo _media_info;
//rtsp推流相关绑定的源
RtspMediaSourceImp::Ptr _push_src;
RtspMediaSource::Ptr _push_src;
//rtsp播放器绑定的直播源
std::weak_ptr<RtspMediaSource> _play_src;
//直播源读取器
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论