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-05-17 17:53:27 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2c059d3a8041fb776774104c62c416eae9dabd9c
2c059d3a
1 parent
952abbee
fix bug #72, also need stream_id for send_and_free_message. 0.9.101
显示空白字符变更
内嵌
并排对比
正在显示
10 个修改的文件
包含
19 行增加
和
15 行删除
trunk/etc/init.d/srs
trunk/src/app/srs_app_edge.cpp
trunk/src/app/srs_app_forward.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/core/srs_core.hpp
trunk/src/libs/srs_librtmp.cpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/src/rtmp/srs_protocol_rtmp.hpp
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
trunk/etc/init.d/srs
查看文件 @
2c059d3
...
...
@@ -76,9 +76,9 @@ start() {
# TODO: FIXME: set limit by, for instance, "ulimit -HSn 10000"
if
[[
-z
$log_file
]]
;
then
(
cd
${
ROOT
}
;
${
APP
}
-c
${
CONFIG
}
>/dev/null 2>&1
)
(
ulimit
-c unlimited
&&
cd
${
ROOT
}
;
${
APP
}
-c
${
CONFIG
}
>/dev/null 2>&1
)
else
(
cd
${
ROOT
}
;
${
APP
}
-c
${
CONFIG
}
>>
$log_file
2>&1
)
(
ulimit
-c unlimited
&&
cd
${
ROOT
}
;
${
APP
}
-c
${
CONFIG
}
>>
$log_file
2>&1
)
fi
# check again after start server
...
...
trunk/src/app/srs_app_edge.cpp
查看文件 @
2c059d3
...
...
@@ -491,7 +491,7 @@ int SrsEdgeForwarder::cycle()
srs_assert
(
msg
);
msgs
[
i
]
=
NULL
;
if
((
ret
=
client
->
send_and_free_message
(
msg
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
client
->
send_and_free_message
(
msg
,
stream_id
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"edge publish forwarder send message to server failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/app/srs_app_forward.cpp
查看文件 @
2c059d3
...
...
@@ -370,7 +370,7 @@ int SrsForwarder::forward()
srs_assert
(
msg
);
msgs
[
i
]
=
NULL
;
if
((
ret
=
client
->
send_and_free_message
(
msg
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
client
->
send_and_free_message
(
msg
,
stream_id
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"forwarder send message to server failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
2c059d3
...
...
@@ -538,7 +538,7 @@ int SrsRtmpConn::playing(SrsSource* source)
duration
+=
msg
->
header
.
timestamp
-
starttime
;
starttime
=
msg
->
header
.
timestamp
;
if
((
ret
=
rtmp
->
send_and_free_message
(
msg
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
rtmp
->
send_and_free_message
(
msg
,
res
->
stream_id
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"send message to client failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/core/srs_core.hpp
查看文件 @
2c059d3
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "10
0
"
#define VERSION_REVISION "10
1
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
2c059d3
...
...
@@ -365,7 +365,7 @@ int srs_write_packet(srs_rtmp_t rtmp, int type, u_int32_t timestamp, char* data,
if
(
msg
)
{
// send out encoded msg.
if
((
ret
=
context
->
rtmp
->
send_and_free_message
(
msg
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
context
->
rtmp
->
send_and_free_message
(
msg
,
context
->
stream_id
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
}
else
{
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
2c059d3
...
...
@@ -385,9 +385,9 @@ int SrsRtmpClient::decode_message(SrsMessage* msg, SrsPacket** ppacket)
return
protocol
->
decode_message
(
msg
,
ppacket
);
}
int
SrsRtmpClient
::
send_and_free_message
(
SrsMessage
*
msg
)
int
SrsRtmpClient
::
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
)
{
return
protocol
->
send_and_free_message
(
msg
);
return
protocol
->
send_and_free_message
(
msg
,
stream_id
);
}
int
SrsRtmpClient
::
send_and_free_packet
(
SrsPacket
*
packet
,
int
stream_id
)
...
...
@@ -730,9 +730,9 @@ int SrsRtmpServer::decode_message(SrsMessage* msg, SrsPacket** ppacket)
return
protocol
->
decode_message
(
msg
,
ppacket
);
}
int
SrsRtmpServer
::
send_and_free_message
(
SrsMessage
*
msg
)
int
SrsRtmpServer
::
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
)
{
return
protocol
->
send_and_free_message
(
msg
);
return
protocol
->
send_and_free_message
(
msg
,
stream_id
);
}
int
SrsRtmpServer
::
send_and_free_packet
(
SrsPacket
*
packet
,
int
stream_id
)
...
...
trunk/src/rtmp/srs_protocol_rtmp.hpp
查看文件 @
2c059d3
...
...
@@ -164,7 +164,7 @@ public:
virtual
int64_t
get_send_bytes
();
virtual
int
recv_message
(
SrsMessage
**
pmsg
);
virtual
int
decode_message
(
SrsMessage
*
msg
,
SrsPacket
**
ppacket
);
virtual
int
send_and_free_message
(
SrsMessage
*
msg
);
virtual
int
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
);
virtual
int
send_and_free_packet
(
SrsPacket
*
packet
,
int
stream_id
);
public
:
// try complex, then simple handshake.
...
...
@@ -209,7 +209,7 @@ public:
virtual
int64_t
get_send_bytes
();
virtual
int
recv_message
(
SrsMessage
**
pmsg
);
virtual
int
decode_message
(
SrsMessage
*
msg
,
SrsPacket
**
ppacket
);
virtual
int
send_and_free_message
(
SrsMessage
*
msg
);
virtual
int
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
);
virtual
int
send_and_free_packet
(
SrsPacket
*
packet
,
int
stream_id
);
public
:
virtual
int
handshake
();
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.cpp
查看文件 @
2c059d3
...
...
@@ -725,8 +725,11 @@ int SrsProtocol::do_decode_message(SrsMessageHeader& header, SrsStream* stream,
return
ret
;
}
int
SrsProtocol
::
send_and_free_message
(
SrsMessage
*
msg
)
int
SrsProtocol
::
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
)
{
if
(
msg
)
{
msg
->
header
.
stream_id
=
stream_id
;
}
return
do_send_and_free_message
(
msg
,
NULL
);
}
...
...
trunk/src/rtmp/srs_protocol_rtmp_stack.hpp
查看文件 @
2c059d3
...
...
@@ -161,8 +161,9 @@ public:
* user must never free or use the msg after this method,
* for it will always free the msg.
* @param msg, the msg to send out, never be NULL.
* @param stream_id, the stream id of packet to send over, 0 for control message.
*/
virtual
int
send_and_free_message
(
SrsMessage
*
msg
);
virtual
int
send_and_free_message
(
SrsMessage
*
msg
,
int
stream_id
);
/**
* send the RTMP packet and always free it.
* user must never free or use the packet after this method,
...
...
请
注册
或
登录
后发表评论