mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-15 20:45:57 +08:00
优化rtmp性能
This commit is contained in:
@@ -182,8 +182,7 @@ void H265RtmpEncoder::inputFrame(const Frame::Ptr &frame) {
|
||||
bool is_config = false;
|
||||
flags |= (((frame->configFrame() || frame->keyFrame()) ? FLV_KEY_FRAME : FLV_INTER_FRAME) << 4);
|
||||
|
||||
_lastPacket = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
_lastPacket->buffer.clear();
|
||||
_lastPacket = RtmpPacket::create();
|
||||
_lastPacket->buffer.push_back(flags);
|
||||
_lastPacket->buffer.push_back(!is_config);
|
||||
auto cts = frame->pts() - frame->dts();
|
||||
@@ -208,9 +207,7 @@ void H265RtmpEncoder::makeVideoConfigPkt() {
|
||||
flags |= (FLV_KEY_FRAME << 4);
|
||||
bool is_config = true;
|
||||
|
||||
RtmpPacket::Ptr rtmpPkt = ResourcePoolHelper<RtmpPacket>::obtainObj();
|
||||
rtmpPkt->buffer.clear();
|
||||
|
||||
auto rtmpPkt = RtmpPacket::create();
|
||||
//header
|
||||
rtmpPkt->buffer.push_back(flags);
|
||||
rtmpPkt->buffer.push_back(!is_config);
|
||||
|
||||
Reference in New Issue
Block a user