Commit 009e8cc4 by xiongziliang

完成rtsp 265的支持

parent 5f511eb2
...@@ -252,7 +252,7 @@ public: ...@@ -252,7 +252,7 @@ public:
_vpsFrame = insertFrame; _vpsFrame = insertFrame;
} }
_vpsFrame->timeStamp = frame->stamp(); _vpsFrame->timeStamp = frame->stamp();
// VideoTrack::inputFrame(_vpsFrame); VideoTrack::inputFrame(_vpsFrame);
} }
if (!_sps.empty()) { if (!_sps.empty()) {
if (!_spsFrame) { if (!_spsFrame) {
...@@ -265,7 +265,7 @@ public: ...@@ -265,7 +265,7 @@ public:
_spsFrame = insertFrame; _spsFrame = insertFrame;
} }
_spsFrame->timeStamp = frame->stamp(); _spsFrame->timeStamp = frame->stamp();
// VideoTrack::inputFrame(_spsFrame); VideoTrack::inputFrame(_spsFrame);
} }
if (!_pps.empty()) { if (!_pps.empty()) {
...@@ -279,7 +279,7 @@ public: ...@@ -279,7 +279,7 @@ public:
_ppsFrame = insertFrame; _ppsFrame = insertFrame;
} }
_ppsFrame->timeStamp = frame->stamp(); _ppsFrame->timeStamp = frame->stamp();
//VideoTrack::inputFrame(_ppsFrame); VideoTrack::inputFrame(_ppsFrame);
} }
VideoTrack::inputFrame(frame); VideoTrack::inputFrame(frame);
return; return;
......
...@@ -146,7 +146,6 @@ bool H265RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) { ...@@ -146,7 +146,6 @@ bool H265RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtppack) {
void H265RtpDecoder::onGetH265(const H265Frame::Ptr &frame) { void H265RtpDecoder::onGetH265(const H265Frame::Ptr &frame) {
//写入环形缓存 //写入环形缓存
auto lastSeq = _h265frame->sequence; auto lastSeq = _h265frame->sequence;
DebugL << (int)frame->type;
RtpCodec::inputFrame(frame); RtpCodec::inputFrame(frame);
_h265frame = obtainFrame(); _h265frame = obtainFrame();
_h265frame->sequence = lastSeq; _h265frame->sequence = lastSeq;
...@@ -177,7 +176,6 @@ void H265RtpEncoder::inputFrame(const Frame::Ptr &frame) { ...@@ -177,7 +176,6 @@ void H265RtpEncoder::inputFrame(const Frame::Ptr &frame) {
unsigned char naluType = H265_TYPE(pcData[0]); //获取NALU的5bit 帧类型 unsigned char naluType = H265_TYPE(pcData[0]); //获取NALU的5bit 帧类型
uiStamp %= cycleMS; uiStamp %= cycleMS;
WarnL << (int)naluType;
int maxSize = _ui32MtuSize - 3; int maxSize = _ui32MtuSize - 3;
if (iLen > maxSize) { //超过MTU if (iLen > maxSize) { //超过MTU
//获取帧头数据,1byte //获取帧头数据,1byte
...@@ -189,10 +187,10 @@ void H265RtpEncoder::inputFrame(const Frame::Ptr &frame) { ...@@ -189,10 +187,10 @@ void H265RtpEncoder::inputFrame(const Frame::Ptr &frame) {
if (iLen < nOffset + maxSize) { //是否拆分结束 if (iLen < nOffset + maxSize) { //是否拆分结束
maxSize = iLen - nOffset; maxSize = iLen - nOffset;
mark = true; mark = true;
s_e_type = 1 << 7 | naluType; s_e_type = 1 << 6 | naluType;
} else { } else {
if (bFirst == true) { if (bFirst == true) {
s_e_type = 1 << 6 | naluType; s_e_type = 1 << 7 | naluType;
bFirst = false; bFirst = false;
} else { } else {
s_e_type = naluType; s_e_type = naluType;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论