From 91747947b91369c4eabb407a5d5de8c289a5093d Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Mon, 22 Jul 2019 18:40:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=8F=98=E9=87=8F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpToRtspMediaSource.h | 14 +++++++------- src/Rtsp/RtspToRtmpMediaSource.h | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Rtmp/RtmpToRtspMediaSource.h b/src/Rtmp/RtmpToRtspMediaSource.h index 8e2721aa..98c059f2 100644 --- a/src/Rtmp/RtmpToRtspMediaSource.h +++ b/src/Rtmp/RtmpToRtspMediaSource.h @@ -57,27 +57,27 @@ public: int ringSize = 0) : RtmpMediaSource(vhost, app, id,ringSize){ _bEnableHls = bEnableHls; _bEnableMp4 = bEnableMp4; - _rtmpDemuxer = std::make_shared(); + _demuxer = std::make_shared(); } virtual ~RtmpToRtspMediaSource(){} void onGetMetaData(const AMFValue &metadata) override { - _rtmpDemuxer = std::make_shared(metadata); + _demuxer = std::make_shared(metadata); RtmpMediaSource::onGetMetaData(metadata); } void onWrite(const RtmpPacket::Ptr &pkt,bool key_pos) override { - _rtmpDemuxer->inputRtmp(pkt); - if(!_muxer && _rtmpDemuxer->isInited(2000)){ + _demuxer->inputRtmp(pkt); + if(!_muxer && _demuxer->isInited(2000)){ _muxer = std::make_shared(getVhost(), getApp(), getId(), - _rtmpDemuxer->getDuration(), + _demuxer->getDuration(), true,//转rtsp false,//不重复生成rtmp _bEnableHls, _bEnableMp4); - for (auto &track : _rtmpDemuxer->getTracks(false)){ + for (auto &track : _demuxer->getTracks(false)){ _muxer->addTrack(track); track->addDelegate(_muxer); } @@ -97,7 +97,7 @@ public: return RtmpMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0); } private: - RtmpDemuxer::Ptr _rtmpDemuxer; + RtmpDemuxer::Ptr _demuxer; MultiMediaSourceMuxer::Ptr _muxer; bool _bEnableHls; bool _bEnableMp4; diff --git a/src/Rtsp/RtspToRtmpMediaSource.h b/src/Rtsp/RtspToRtmpMediaSource.h index 9813bbe9..c5a165e4 100644 --- a/src/Rtsp/RtspToRtmpMediaSource.h +++ b/src/Rtsp/RtspToRtmpMediaSource.h @@ -53,23 +53,23 @@ public: virtual ~RtspToRtmpMediaSource() {} virtual void onGetSDP(const string &strSdp) override { - _rtspDemuxer = std::make_shared(strSdp); + _demuxer = std::make_shared(strSdp); RtspMediaSource::onGetSDP(strSdp); } virtual void onWrite(const RtpPacket::Ptr &rtp, bool bKeyPos) override { - if (_rtspDemuxer) { - bKeyPos = _rtspDemuxer->inputRtp(rtp); - if (!_muxer && _rtspDemuxer->isInited(2000)) { + if (_demuxer) { + bKeyPos = _demuxer->inputRtp(rtp); + if (!_muxer && _demuxer->isInited(2000)) { _muxer = std::make_shared(getVhost(), getApp(), getId(), - _rtspDemuxer->getDuration(), + _demuxer->getDuration(), false,//不重复生成rtsp true,//转rtmp _bEnableHls, _bEnableMp4); - for (auto &track : _rtspDemuxer->getTracks(false)) { + for (auto &track : _demuxer->getTracks(false)) { _muxer->addTrack(track); track->addDelegate(_muxer); } @@ -89,7 +89,7 @@ public: return RtspMediaSource::readerCount() + (_muxer ? _muxer->readerCount() : 0); } private: - RtspDemuxer::Ptr _rtspDemuxer; + RtspDemuxer::Ptr _demuxer; MultiMediaSourceMuxer::Ptr _muxer; bool _bEnableHls; bool _bEnableMp4;