Commit 35734f9e by xiongziliang

sps pps vps帧不再缓存

parent a8853135
/* /*
* 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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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: ...@@ -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);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论