新增支持播发器画面秒开功能

This commit is contained in:
xiongziliang 2017-06-20 11:46:17 +08:00
parent 24bbdb48cb
commit f3b5c8f75b
3 changed files with 6 additions and 6 deletions

View File

@ -41,7 +41,7 @@ public:
RtmpMediaSource(const string &strApp, const string &strId) : RtmpMediaSource(const string &strApp, const string &strId) :
m_strApp(strApp), m_strApp(strApp),
m_strId(strId), m_strId(strId),
m_pRing( new RingBuffer<RtmpPacket>(1)), m_pRing(new RingBuffer<RtmpPacket>()),
m_thPool( MediaSender::sendThread()) { m_thPool( MediaSender::sendThread()) {
} }
virtual ~RtmpMediaSource() { virtual ~RtmpMediaSource() {
@ -120,7 +120,7 @@ public:
} }
auto _ring = m_pRing; auto _ring = m_pRing;
m_thPool.async([_ring,pkt]() { m_thPool.async([_ring,pkt]() {
_ring->write(pkt); _ring->write(pkt,pkt.isVideoKeyFrame());
}); });
} }
bool seekTo(uint32_t ui32Stamp) { bool seekTo(uint32_t ui32Stamp) {

View File

@ -40,7 +40,7 @@ public:
RtspMediaSource(const string &strApp, const string &strId) : RtspMediaSource(const string &strApp, const string &strId) :
m_strApp(strApp), m_strApp(strApp),
m_strId(strId), m_strId(strId),
m_pRing(new RingBuffer<RtpPacket::Ptr>(1)), m_pRing(new RingBuffer<RtpPacket::Ptr>()),
m_thPool(MediaSender::sendThread()) { m_thPool(MediaSender::sendThread()) {
} }
virtual ~RtspMediaSource() { virtual ~RtspMediaSource() {
@ -114,7 +114,7 @@ public:
//派生类设置该媒体源媒体描述信息 //派生类设置该媒体源媒体描述信息
this->m_strSdp = sdp; 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]; auto &trackRef = m_mapTracks[rtppt->interleaved / 2];
trackRef.seq = rtppt->sequence; trackRef.seq = rtppt->sequence;
trackRef.timeStamp = rtppt->timeStamp; trackRef.timeStamp = rtppt->timeStamp;
@ -122,7 +122,7 @@ public:
trackRef.type = rtppt->type; trackRef.type = rtppt->type;
auto _outRing = m_pRing; auto _outRing = m_pRing;
m_thPool.async([_outRing,rtppt,keyPos]() { m_thPool.async([_outRing,rtppt,keyPos]() {
_outRing->write(rtppt); _outRing->write(rtppt,keyPos);
}); });
} }
bool seekTo(uint32_t ui32Stamp) { bool seekTo(uint32_t ui32Stamp) {

View File

@ -40,7 +40,7 @@ public:
} }
RtspMediaSource::onGetSDP(strSdp); 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) { if (m_pParser) {
bKeyPos = m_pParser->inputRtp(*pRtppkt); bKeyPos = m_pParser->inputRtp(*pRtppkt);
} }