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-07-06 20:43:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
59dff7d26853da6da77b92c99e29d24ae08cf52a
59dff7d2
1 parent
2516e3c5
add comments for RTMP protocol stack
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
29 行增加
和
18 行删除
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
查看文件 @
59dff7d
...
...
@@ -321,15 +321,6 @@ SrsProtocol::~SrsProtocol()
srs_freep
(
buffer
);
}
string
SrsProtocol
::
get_request_name
(
double
transcationId
)
{
if
(
requests
.
find
(
transcationId
)
==
requests
.
end
())
{
return
""
;
}
return
requests
[
transcationId
];
}
void
SrsProtocol
::
set_recv_timeout
(
int64_t
timeout_us
)
{
return
skt
->
set_recv_timeout
(
timeout_us
);
...
...
@@ -605,12 +596,14 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsStream* stream,
stream
->
skip
(
1
);
}
std
::
string
request_name
=
get_request_name
(
transactionId
);
if
(
request_name
.
empty
())
{
// find the call name
if
(
requests
.
find
(
transactionId
)
==
requests
.
end
())
{
ret
=
ERROR_RTMP_NO_REQUEST
;
srs_error
(
"decode AMF0/AMF3 request failed. ret=%d"
,
ret
);
return
ret
;
}
std
::
string
request_name
=
requests
[
transactionId
];
srs_verbose
(
"AMF0/AMF3 request parsed. request_name=%s"
,
request_name
.
c_str
());
if
(
request_name
==
RTMP_AMF0_COMMAND_CONNECT
)
{
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
查看文件 @
59dff7d
...
...
@@ -124,16 +124,21 @@ public:
SrsProtocol
(
ISrsProtocolReaderWriter
*
io
);
virtual
~
SrsProtocol
();
public
:
// TODO: FIXME: to private.
std
::
string
get_request_name
(
double
transcationId
);
/**
* set
the
timeout in us.
* set
/get the recv
timeout in us.
* if timeout, recv/send message return ERROR_SOCKET_TIMEOUT.
*/
virtual
void
set_recv_timeout
(
int64_t
timeout_us
);
virtual
int64_t
get_recv_timeout
();
/**
* set/get the send timeout in us.
* if timeout, recv/send message return ERROR_SOCKET_TIMEOUT.
*/
virtual
void
set_send_timeout
(
int64_t
timeout_us
);
virtual
int64_t
get_send_timeout
();
/**
* get recv/send bytes.
*/
virtual
int64_t
get_recv_bytes
();
virtual
int64_t
get_send_bytes
();
public
:
...
...
@@ -213,7 +218,13 @@ private:
*/
virtual
int
on_send_message
(
SrsMessage
*
msg
,
SrsPacket
*
packet
);
private
:
/**
* auto response the ack message.
*/
virtual
int
response_acknowledgement_message
();
/**
* auto response the ping message.
*/
virtual
int
response_ping_message
(
int32_t
timestamp
);
};
...
...
@@ -252,7 +263,6 @@ public:
* @remark, we use 64bits for large time for jitter detect and hls.
*/
int64_t
timestamp
;
public
:
/**
* get the perfered cid(chunk stream id) which sendout over.
...
...
@@ -260,11 +270,10 @@ public:
* for example, dispatch to all connections.
*/
int
perfer_cid
;
public
:
SrsMessageHeader
();
virtual
~
SrsMessageHeader
();
public
:
bool
is_audio
();
bool
is_video
();
bool
is_amf0_command
();
...
...
@@ -277,9 +286,18 @@ public:
bool
is_user_control_message
();
bool
is_set_peer_bandwidth
();
bool
is_aggregate
();
public
:
/**
* create a amf0 script header, set the size and stream_id.
*/
void
initialize_amf0_script
(
int
size
,
int
stream
);
/**
* create a audio header, set the size, timestamp and stream_id.
*/
void
initialize_audio
(
int
size
,
u_int32_t
time
,
int
stream
);
/**
* create a video header, set the size, timestamp and stream_id.
*/
void
initialize_video
(
int
size
,
u_int32_t
time
,
int
stream
);
};
...
...
请
注册
或
登录
后发表评论