rtmp解复用支持无内存拷贝

hls生成支持输入无0x 00 00 01的H264/H265数据
This commit is contained in:
xiongziliang
2019-07-25 12:09:36 +08:00
parent d2a889b463
commit 6922d82c65
4 changed files with 31 additions and 6 deletions

View File

@@ -108,6 +108,7 @@ inline void H264RtmpDecoder::onGetH264_l(const char* pcData, int iLen, uint32_t
}
}
inline void H264RtmpDecoder::onGetH264(const char* pcData, int iLen, uint32_t dts,uint32_t pts) {
#if 0
_h264frame->type = H264_TYPE(pcData[0]);
_h264frame->timeStamp = dts;
_h264frame->ptsStamp = pts;
@@ -117,6 +118,11 @@ inline void H264RtmpDecoder::onGetH264(const char* pcData, int iLen, uint32_t dt
//写入环形缓存
RtmpCodec::inputFrame(_h264frame);
_h264frame = obtainFrame();
#else
//防止内存拷贝这样产生的264帧不会有0x00 00 01头
auto frame = std::make_shared<H264FrameNoCacheAble>((char *)pcData,iLen,dts,pts,0);
RtmpCodec::inputFrame(frame);
#endif
}