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
2017-01-06 14:32:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
aa2b7afb444444f9d2d237398417c1b1a204a772
aa2b7afb
1 parent
c67036d5
refine code, print protocol level info.
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
29 行增加
和
3 行删除
trunk/src/protocol/srs_rtmp_stack.cpp
trunk/src/protocol/srs_rtmp_stack.hpp
trunk/src/protocol/srs_rtmp_stack.cpp
查看文件 @
aa2b7af
...
...
@@ -229,6 +229,8 @@ SrsProtocol::SrsProtocol(ISrsProtocolReaderWriter* io)
warned_c0c3_cache_dry
=
false
;
auto_response_when_recv
=
true
;
show_debug_info
=
true
;
in_buffer_length
=
0
;
cs_cache
=
NULL
;
if
(
SRS_PERF_CHUNK_STREAM_CACHE
>
0
)
{
...
...
@@ -896,6 +898,8 @@ int SrsProtocol::send_and_free_messages(SrsSharedPtrMessage** msgs, int nb_msgs,
return
ret
;
}
print_debug_info
();
return
ret
;
}
...
...
@@ -1473,6 +1477,9 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
}
srs_verbose
(
"decode packet from message payload success."
);
break
;
case
RTMP_MSG_VideoMessage
:
case
RTMP_MSG_AudioMessage
:
print_debug_info
();
default
:
return
ret
;
}
...
...
@@ -1508,8 +1515,7 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
if
(
pkt
->
chunk_size
<
SRS_CONSTS_RTMP_MIN_CHUNK_SIZE
||
pkt
->
chunk_size
>
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE
)
{
srs_warn
(
"accept chunk size %d, but should in [%d, %d], "
"@see: https://github.com/ossrs/srs/issues/160"
,
srs_warn
(
"accept chunk=%d, should in [%d, %d], please see #160"
,
pkt
->
chunk_size
,
SRS_CONSTS_RTMP_MIN_CHUNK_SIZE
,
SRS_CONSTS_RTMP_MAX_CHUNK_SIZE
);
}
...
...
@@ -1531,7 +1537,8 @@ int SrsProtocol::on_recv_message(SrsCommonMessage* msg)
srs_assert
(
pkt
!=
NULL
);
if
(
pkt
->
event_type
==
SrcPCUCSetBufferLength
)
{
srs_trace
(
"buffer=%d, in.ack=%d, out.ack=%d, in.chunk=%d, out.chunk=%d"
,
pkt
->
extra_data
,
in_buffer_length
=
pkt
->
extra_data
;
srs_info
(
"buffer=%d, in.ack=%d, out.ack=%d, in.chunk=%d, out.chunk=%d"
,
pkt
->
extra_data
,
in_ack_size
.
window
,
out_ack_size
.
window
,
in_chunk_size
,
out_chunk_size
);
}
if
(
pkt
->
event_type
==
SrcPCUCPingRequest
)
{
...
...
@@ -1594,6 +1601,9 @@ int SrsProtocol::on_send_packet(SrsMessageHeader* mh, SrsPacket* packet)
}
break
;
}
case
RTMP_MSG_VideoMessage
:
case
RTMP_MSG_AudioMessage
:
print_debug_info
();
default
:
break
;
}
...
...
@@ -1670,6 +1680,15 @@ int SrsProtocol::response_ping_message(int32_t timestamp)
return
ret
;
}
void
SrsProtocol
::
print_debug_info
()
{
if
(
show_debug_info
)
{
show_debug_info
=
false
;
srs_trace
(
"protocol in.buffer=%d, in.ack=%d, out.ack=%d, in.chunk=%d, out.chunk=%d"
,
in_buffer_length
,
in_ack_size
.
window
,
out_ack_size
.
window
,
in_chunk_size
,
out_chunk_size
);
}
}
SrsChunkStream
::
SrsChunkStream
(
int
_cid
)
{
fmt
=
0
;
...
...
trunk/src/protocol/srs_rtmp_stack.hpp
查看文件 @
aa2b7af
...
...
@@ -235,6 +235,11 @@ private:
AckWindowSize
in_ack_size
;
// The output ack window, to require peer to response the ack.
AckWindowSize
out_ack_size
;
// The buffer length set by peer.
int32_t
in_buffer_length
;
// Whether print the protocol level debug info.
// Generally we print the debug info when got or send first A/V packet.
bool
show_debug_info
;
/**
* whether auto response when recv messages.
* default to true for it's very easy to use the protocol stack.
...
...
@@ -490,6 +495,8 @@ private:
* auto response the ping message.
*/
virtual
int
response_ping_message
(
int32_t
timestamp
);
private
:
virtual
void
print_debug_info
();
};
/**
...
...
请
注册
或
登录
后发表评论