Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-12-04 18:35:50 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
f1192a830243a3f5ce1618b347a945429644ffe4
f1192a83
1 parent
5589b13d
fix bug for bug #241, default to 32k for socket buffer.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
11 行增加
和
9 行删除
trunk/src/app/srs_app_config.hpp
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/core/srs_core_performance.hpp
trunk/src/rtmp/srs_protocol_buffer.cpp
trunk/src/app/srs_app_config.hpp
查看文件 @
f1192a8
...
...
@@ -539,6 +539,7 @@ public:
* get the mr sleep time in ms for vhost.
* @param vhost, the vhost to get the mr sleep time.
*/
// TODO: FIXME: add utest for mr config.
virtual
int
get_mr_sleep_ms
(
std
::
string
vhost
);
private
:
/**
...
...
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
f1192a8
...
...
@@ -33,6 +33,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
using
namespace
std
;
// the max small bytes to group
#define SRS_MR_SMALL_BYTES 4096
ISrsMessageHandler
::
ISrsMessageHandler
()
{
}
...
...
@@ -390,8 +393,8 @@ void SrsPublishRecvThread::update_buffer(bool mr_enabled, int sleep_ms)
// TODO: FIXME: refine it.
#ifdef SRS_PERF_MERGED_READ
// previous enabled mr, update the buffer.
if
(
mr
&&
mr_sleep
!=
sleep_ms
)
{
// update the buffer.
if
(
true
)
{
// the underlayer api will set to SRS_MR_SOCKET_BUFFER bytes.
// 4KB=4096, 8KB=8192, 16KB=16384, 32KB=32768, 64KB=65536,
// 128KB=131072, 256KB=262144, 512KB=524288
...
...
trunk/src/core/srs_core_performance.hpp
查看文件 @
f1192a8
...
...
@@ -56,9 +56,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* That is, the latency is 120ms(the sleep time).
*/
// to enable merged read.
#undef SRS_PERF_MERGED_READ
// the max sleep time in ms
#define SRS_MR_MAX_SLEEP_MS 800
#define SRS_PERF_MERGED_READ
/**
* the send cache time in ms.
...
...
trunk/src/rtmp/srs_protocol_buffer.cpp
查看文件 @
f1192a8
...
...
@@ -28,10 +28,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_kernel_utility.hpp>
#include <srs_core_performance.hpp>
// the max small bytes to group
#define SRS_MR_SMALL_BYTES 4096
// the default recv buffer size
#define SRS_DEFAULT_RECV_BUFFER_SIZE
8192
#define SRS_DEFAULT_RECV_BUFFER_SIZE
32768
// the max header size,
// @see SrsProtocol::read_message_header().
...
...
@@ -111,7 +109,9 @@ void SrsFastBuffer::set_buffer(int buffer_size)
int
cap
=
end
-
p
;
char
*
buf
=
new
char
[
buffer_size
];
memcpy
(
buf
,
buffer
,
nb_buffer
);
if
(
cap
>
0
)
{
memcpy
(
buf
,
buffer
,
nb_buffer
);
}
srs_freep
(
buffer
);
buffer
=
buf
;
...
...
请
注册
或
登录
后发表评论