Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
5a592e6d
Commit
5a592e6d
authored
Jan 06, 2022
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化循环池性能
parent
e2636c51
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
3rdpart/ZLToolKit
+1
-1
src/Extension/Frame.h
+1
-1
src/Http/HttpBody.cpp
+1
-1
src/Record/MP4Demuxer.cpp
+1
-1
src/Record/MPEG.cpp
+1
-1
src/Rtmp/FlvMuxer.cpp
+1
-1
src/Rtmp/Rtmp.cpp
+1
-1
src/Rtmp/RtmpProtocol.cpp
+2
-2
src/Rtsp/Rtsp.cpp
+1
-1
webrtc/WebRtcTransport.cpp
+3
-3
没有找到文件。
ZLToolKit
@
769f0191
Subproject commit
d04e9f8a111378ea5935cd9226b23ef9915e1941
Subproject commit
769f01914970bd9021d59f3eba08233886abecb7
src/Extension/Frame.h
查看文件 @
5a592e6d
...
...
@@ -185,7 +185,7 @@ public:
static onceToken token([]() {
packet_pool.setSize(1024);
});
auto ret = packet_pool.obtain();
auto ret = packet_pool.obtain
2
();
ret->_buffer.clear();
ret->_prefix_size = 0;
ret->_dts = 0;
...
...
src/Http/HttpBody.cpp
查看文件 @
5a592e6d
...
...
@@ -129,7 +129,7 @@ Buffer::Ptr HttpFileBody::readData(size_t size) {
if
(
!
_map_addr
){
//fread模式
ssize_t
iRead
;
auto
ret
=
_pool
.
obtain
();
auto
ret
=
_pool
.
obtain
2
();
ret
->
setCapacity
(
size
+
1
);
do
{
iRead
=
fread
(
ret
->
data
(),
1
,
size
,
_fp
.
get
());
...
...
src/Record/MP4Demuxer.cpp
查看文件 @
5a592e6d
...
...
@@ -180,7 +180,7 @@ Frame::Ptr MP4Demuxer::readFrame(bool &keyFrame, bool &eof) {
ctx
->
flags
=
flags
;
ctx
->
track_id
=
track_id
;
ctx
->
buffer
=
ctx
->
thiz
->
_buffer_pool
.
obtain
();
ctx
->
buffer
=
ctx
->
thiz
->
_buffer_pool
.
obtain
2
();
ctx
->
buffer
->
setCapacity
(
bytes
+
DATA_OFFSET
+
1
);
ctx
->
buffer
->
setSize
(
bytes
+
DATA_OFFSET
);
return
ctx
->
buffer
->
data
()
+
DATA_OFFSET
;
...
...
src/Record/MPEG.cpp
查看文件 @
5a592e6d
...
...
@@ -99,7 +99,7 @@ void MpegMuxer::createContext() {
/*alloc*/
[](
void
*
param
,
size_t
bytes
)
{
MpegMuxer
*
thiz
=
(
MpegMuxer
*
)
param
;
thiz
->
_current_buffer
=
thiz
->
_buffer_pool
.
obtain
();
;
thiz
->
_current_buffer
=
thiz
->
_buffer_pool
.
obtain
2
()
;
thiz
->
_current_buffer
->
setCapacity
(
bytes
+
1
);
return
(
void
*
)
thiz
->
_current_buffer
->
data
();
},
...
...
src/Rtmp/FlvMuxer.cpp
查看文件 @
5a592e6d
...
...
@@ -72,7 +72,7 @@ void FlvMuxer::start(const EventPoller::Ptr &poller, const RtmpMediaSource::Ptr
}
BufferRaw
::
Ptr
FlvMuxer
::
obtainBuffer
()
{
return
_packet_pool
.
obtain
();
return
_packet_pool
.
obtain
2
();
}
BufferRaw
::
Ptr
FlvMuxer
::
obtainBuffer
(
const
void
*
data
,
size_t
len
)
{
...
...
src/Rtmp/Rtmp.cpp
查看文件 @
5a592e6d
...
...
@@ -138,7 +138,7 @@ RtmpPacket::Ptr RtmpPacket::create(){
static onceToken token([]() {
packet_pool.setSize(1024);
});
auto ret = packet_pool.obtain();
auto ret = packet_pool.obtain
2
();
ret->clear();
return ret;
#else
...
...
src/Rtmp/RtmpProtocol.cpp
查看文件 @
5a592e6d
...
...
@@ -799,11 +799,11 @@ void RtmpProtocol::handle_chunk(RtmpPacket::Ptr packet) {
}
BufferRaw
::
Ptr
RtmpProtocol
::
obtainBuffer
(
const
void
*
data
,
size_t
len
)
{
auto
buffer
=
_packet_pool
.
obtain
();
auto
buffer
=
_packet_pool
.
obtain
2
();
if
(
data
&&
len
)
{
buffer
->
assign
((
const
char
*
)
data
,
len
);
}
return
std
::
move
(
buffer
)
;
return
buffer
;
}
}
/* namespace mediakit */
src/Rtsp/Rtsp.cpp
查看文件 @
5a592e6d
...
...
@@ -555,7 +555,7 @@ RtpPacket::Ptr RtpPacket::create() {
static onceToken token([]() {
packet_pool.setSize(1024);
});
auto ret = packet_pool.obtain();
auto ret = packet_pool.obtain
2
();
ret->setSize(0);
return ret;
#else
...
...
webrtc/WebRtcTransport.cpp
查看文件 @
5a592e6d
...
...
@@ -136,7 +136,7 @@ void WebRtcTransport::OnDtlsTransportApplicationDataReceived(const RTC::DtlsTran
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void
WebRtcTransport
::
sendSockData
(
const
char
*
buf
,
size_t
len
,
RTC
::
TransportTuple
*
tuple
){
auto
pkt
=
_packet_pool
.
obtain
();
auto
pkt
=
_packet_pool
.
obtain
2
();
pkt
->
assign
(
buf
,
len
);
onSendSockData
(
std
::
move
(
pkt
),
true
,
tuple
?
tuple
:
_ice_server
->
GetSelectedTuple
());
}
...
...
@@ -269,7 +269,7 @@ void WebRtcTransport::inputSockData(char *buf, int len, RTC::TransportTuple *tup
void
WebRtcTransport
::
sendRtpPacket
(
const
char
*
buf
,
int
len
,
bool
flush
,
void
*
ctx
)
{
if
(
_srtp_session_send
)
{
auto
pkt
=
_packet_pool
.
obtain
();
auto
pkt
=
_packet_pool
.
obtain
2
();
//预留rtx加入的两个字节
pkt
->
setCapacity
((
size_t
)
len
+
SRTP_MAX_TRAILER_LEN
+
2
);
pkt
->
assign
(
buf
,
len
);
...
...
@@ -283,7 +283,7 @@ void WebRtcTransport::sendRtpPacket(const char *buf, int len, bool flush, void *
void
WebRtcTransport
::
sendRtcpPacket
(
const
char
*
buf
,
int
len
,
bool
flush
,
void
*
ctx
)
{
if
(
_srtp_session_send
)
{
auto
pkt
=
_packet_pool
.
obtain
();
auto
pkt
=
_packet_pool
.
obtain
2
();
//预留rtx加入的两个字节
pkt
->
setCapacity
((
size_t
)
len
+
SRTP_MAX_TRAILER_LEN
+
2
);
pkt
->
assign
(
buf
,
len
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论