mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 04:31:37 +08:00
sps pps vps帧不再缓存
This commit is contained in:
parent
a88531354a
commit
35734f9e27
@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
* Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
||||||
@ -313,10 +313,10 @@ private:
|
|||||||
if(!_spsFrame){
|
if(!_spsFrame){
|
||||||
_spsFrame = std::make_shared<H264Frame>();
|
_spsFrame = std::make_shared<H264Frame>();
|
||||||
_spsFrame->type = H264Frame::NAL_SPS;
|
_spsFrame->type = H264Frame::NAL_SPS;
|
||||||
_spsFrame->buffer.assign("\x0\x0\x0\x1",4);
|
|
||||||
_spsFrame->buffer.append(_sps);
|
|
||||||
_spsFrame->iPrefixSize = 4;
|
_spsFrame->iPrefixSize = 4;
|
||||||
}
|
}
|
||||||
|
_spsFrame->buffer.assign("\x0\x0\x0\x1",4);
|
||||||
|
_spsFrame->buffer.append(_sps);
|
||||||
_spsFrame->timeStamp = frame->stamp();
|
_spsFrame->timeStamp = frame->stamp();
|
||||||
VideoTrack::inputFrame(_spsFrame);
|
VideoTrack::inputFrame(_spsFrame);
|
||||||
}
|
}
|
||||||
@ -325,10 +325,10 @@ private:
|
|||||||
if(!_ppsFrame) {
|
if(!_ppsFrame) {
|
||||||
_ppsFrame = std::make_shared<H264Frame>();
|
_ppsFrame = std::make_shared<H264Frame>();
|
||||||
_ppsFrame->type = H264Frame::NAL_PPS;
|
_ppsFrame->type = H264Frame::NAL_PPS;
|
||||||
_ppsFrame->buffer.assign("\x0\x0\x0\x1",4);
|
|
||||||
_ppsFrame->buffer.append(_pps);
|
|
||||||
_ppsFrame->iPrefixSize = 4;
|
_ppsFrame->iPrefixSize = 4;
|
||||||
}
|
}
|
||||||
|
_ppsFrame->buffer.assign("\x0\x0\x0\x1",4);
|
||||||
|
_ppsFrame->buffer.append(_pps);
|
||||||
_ppsFrame->timeStamp = frame->stamp();
|
_ppsFrame->timeStamp = frame->stamp();
|
||||||
VideoTrack::inputFrame(_ppsFrame);
|
VideoTrack::inputFrame(_ppsFrame);
|
||||||
}
|
}
|
||||||
|
@ -263,10 +263,10 @@ private:
|
|||||||
if (!_vpsFrame) {
|
if (!_vpsFrame) {
|
||||||
_vpsFrame = std::make_shared<H265Frame>();
|
_vpsFrame = std::make_shared<H265Frame>();
|
||||||
_vpsFrame->type = H265Frame::NAL_VPS;
|
_vpsFrame->type = H265Frame::NAL_VPS;
|
||||||
_vpsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
|
||||||
_vpsFrame->buffer.append(_vps);
|
|
||||||
_vpsFrame->iPrefixSize = 4;
|
_vpsFrame->iPrefixSize = 4;
|
||||||
}
|
}
|
||||||
|
_vpsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
||||||
|
_vpsFrame->buffer.append(_vps);
|
||||||
_vpsFrame->timeStamp = frame->stamp();
|
_vpsFrame->timeStamp = frame->stamp();
|
||||||
VideoTrack::inputFrame(_vpsFrame);
|
VideoTrack::inputFrame(_vpsFrame);
|
||||||
}
|
}
|
||||||
@ -274,10 +274,10 @@ private:
|
|||||||
if (!_spsFrame) {
|
if (!_spsFrame) {
|
||||||
_spsFrame = std::make_shared<H265Frame>();
|
_spsFrame = std::make_shared<H265Frame>();
|
||||||
_spsFrame->type = H265Frame::NAL_SPS;
|
_spsFrame->type = H265Frame::NAL_SPS;
|
||||||
_spsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
|
||||||
_spsFrame->buffer.append(_sps);
|
|
||||||
_spsFrame->iPrefixSize = 4;
|
_spsFrame->iPrefixSize = 4;
|
||||||
}
|
}
|
||||||
|
_spsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
||||||
|
_spsFrame->buffer.append(_sps);
|
||||||
_spsFrame->timeStamp = frame->stamp();
|
_spsFrame->timeStamp = frame->stamp();
|
||||||
VideoTrack::inputFrame(_spsFrame);
|
VideoTrack::inputFrame(_spsFrame);
|
||||||
}
|
}
|
||||||
@ -286,10 +286,10 @@ private:
|
|||||||
if (!_ppsFrame) {
|
if (!_ppsFrame) {
|
||||||
_ppsFrame = std::make_shared<H265Frame>();
|
_ppsFrame = std::make_shared<H265Frame>();
|
||||||
_ppsFrame->type = H265Frame::NAL_PPS;
|
_ppsFrame->type = H265Frame::NAL_PPS;
|
||||||
_ppsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
|
||||||
_ppsFrame->buffer.append(_pps);
|
|
||||||
_ppsFrame->iPrefixSize = 4;
|
_ppsFrame->iPrefixSize = 4;
|
||||||
}
|
}
|
||||||
|
_ppsFrame->buffer.assign("\x0\x0\x0\x1", 4);
|
||||||
|
_ppsFrame->buffer.append(_pps);
|
||||||
_ppsFrame->timeStamp = frame->stamp();
|
_ppsFrame->timeStamp = frame->stamp();
|
||||||
VideoTrack::inputFrame(_ppsFrame);
|
VideoTrack::inputFrame(_ppsFrame);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user