大幅提升接收推流性能以及降低内存占用

This commit is contained in:
xiongziliang
2020-11-01 03:41:35 +08:00
parent 5c7a08eb7c
commit 700a16c759
38 changed files with 173 additions and 193 deletions

View File

@@ -101,7 +101,8 @@ void MP4MuxerInterface::inputFrame(const Frame::Ptr &frame) {
if (_frameCached.size() != 1) {
//缓存中有多帧需要按照mp4格式合并一起
string merged;
BufferLikeString merged;
merged.reserve(back->size() + 1024);
_frameCached.for_each([&](const Frame::Ptr &frame) {
uint32_t nalu_size = frame->size() - frame->prefixSize();
nalu_size = htonl(nalu_size);