From f3b5c8f75b1c9501a9b18fbb063f342414210779 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 20 Jun 2017 11:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=94=AF=E6=8C=81=E6=92=AD?= =?UTF-8?q?=E5=8F=91=E5=99=A8=E7=94=BB=E9=9D=A2=E7=A7=92=E5=BC=80=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Rtmp/RtmpMediaSource.h | 4 ++-- src/Rtsp/RtspMediaSource.h | 6 +++--- src/Rtsp/RtspToRtmpMediaSource.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Rtmp/RtmpMediaSource.h b/src/Rtmp/RtmpMediaSource.h index 5afa2cce..0952158a 100644 --- a/src/Rtmp/RtmpMediaSource.h +++ b/src/Rtmp/RtmpMediaSource.h @@ -41,7 +41,7 @@ public: RtmpMediaSource(const string &strApp, const string &strId) : m_strApp(strApp), m_strId(strId), - m_pRing( new RingBuffer(1)), + m_pRing(new RingBuffer()), m_thPool( MediaSender::sendThread()) { } virtual ~RtmpMediaSource() { @@ -120,7 +120,7 @@ public: } auto _ring = m_pRing; m_thPool.async([_ring,pkt]() { - _ring->write(pkt); + _ring->write(pkt,pkt.isVideoKeyFrame()); }); } bool seekTo(uint32_t ui32Stamp) { diff --git a/src/Rtsp/RtspMediaSource.h b/src/Rtsp/RtspMediaSource.h index a9b5390a..491d1b12 100644 --- a/src/Rtsp/RtspMediaSource.h +++ b/src/Rtsp/RtspMediaSource.h @@ -40,7 +40,7 @@ public: RtspMediaSource(const string &strApp, const string &strId) : m_strApp(strApp), m_strId(strId), - m_pRing(new RingBuffer(1)), + m_pRing(new RingBuffer()), m_thPool(MediaSender::sendThread()) { } virtual ~RtspMediaSource() { @@ -114,7 +114,7 @@ public: //派生类设置该媒体源媒体描述信息 this->m_strSdp = sdp; } - virtual void onGetRTP(const RtpPacket::Ptr &rtppt, bool keyPos = true) { + virtual void onGetRTP(const RtpPacket::Ptr &rtppt, bool keyPos) { auto &trackRef = m_mapTracks[rtppt->interleaved / 2]; trackRef.seq = rtppt->sequence; trackRef.timeStamp = rtppt->timeStamp; @@ -122,7 +122,7 @@ public: trackRef.type = rtppt->type; auto _outRing = m_pRing; m_thPool.async([_outRing,rtppt,keyPos]() { - _outRing->write(rtppt); + _outRing->write(rtppt,keyPos); }); } bool seekTo(uint32_t ui32Stamp) { diff --git a/src/Rtsp/RtspToRtmpMediaSource.h b/src/Rtsp/RtspToRtmpMediaSource.h index 2f2e0df5..0ad7bfb7 100644 --- a/src/Rtsp/RtspToRtmpMediaSource.h +++ b/src/Rtsp/RtspToRtmpMediaSource.h @@ -40,7 +40,7 @@ public: } RtspMediaSource::onGetSDP(strSdp); } - virtual void onGetRTP(const RtpPacket::Ptr &pRtppkt, bool bKeyPos = true) override{ + virtual void onGetRTP(const RtpPacket::Ptr &pRtppkt, bool bKeyPos) override{ if (m_pParser) { bKeyPos = m_pParser->inputRtp(*pRtppkt); }