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-02 17:16:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e9712cc627bb07f88a20b1c3d04fa6098fa47b63
e9712cc6
1 parent
5905e5c0
refine recv thread, donot set auto response for publish recv thread. 2.0.46
显示空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
46 行增加
和
8 行删除
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/app/srs_app_recv_thread.hpp
trunk/src/core/srs_core.hpp
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
e9712cc
...
...
@@ -107,24 +107,21 @@ void SrsRecvThread::on_thread_start()
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
rtmp
->
set_recv_timeout
(
ST_UTIME_NO_TIMEOUT
);
// disable the protocol auto response,
// for the isolate recv thread should never send any messages.
rtmp
->
set_auto_response
(
false
);
handler
->
on_thread_start
();
}
void
SrsRecvThread
::
on_thread_stop
()
{
// enable the protocol auto response,
// for the isolate recv thread terminated.
rtmp
->
set_auto_response
(
true
);
// reset the timeout to pulse mode.
rtmp
->
set_recv_timeout
(
timeout
*
1000
);
handler
->
on_thread_stop
();
}
SrsQueueRecvThread
::
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
)
:
trd
(
this
,
rtmp_sdk
,
timeout_ms
)
{
rtmp
=
rtmp_sdk
;
recv_error_code
=
ERROR_SUCCESS
;
}
...
...
@@ -200,11 +197,26 @@ void SrsQueueRecvThread::on_recv_error(int ret)
recv_error_code
=
ret
;
}
void
SrsQueueRecvThread
::
on_thread_start
()
{
// disable the protocol auto response,
// for the isolate recv thread should never send any messages.
rtmp
->
set_auto_response
(
false
);
}
void
SrsQueueRecvThread
::
on_thread_stop
()
{
// enable the protocol auto response,
// for the isolate recv thread terminated.
rtmp
->
set_auto_response
(
true
);
}
SrsPublishRecvThread
::
SrsPublishRecvThread
(
SrsRtmpServer
*
rtmp_sdk
,
int
timeout_ms
,
SrsRtmpConn
*
conn
,
SrsSource
*
source
,
bool
is_fmle
,
bool
is_edge
)
:
trd
(
this
,
rtmp_sdk
,
timeout_ms
)
{
rtmp
=
rtmp_sdk
;
_conn
=
conn
;
_source
=
source
;
_is_fmle
=
is_fmle
;
...
...
@@ -273,3 +285,15 @@ void SrsPublishRecvThread::on_recv_error(int ret)
{
recv_error_code
=
ret
;
}
void
SrsPublishRecvThread
::
on_thread_start
()
{
// we donot set the auto response to false,
// for the main thread never send message.
}
void
SrsPublishRecvThread
::
on_thread_stop
()
{
// we donot set the auto response to true,
// for we donot set to false yet.
}
...
...
trunk/src/app/srs_app_recv_thread.hpp
查看文件 @
e9712cc
...
...
@@ -63,6 +63,12 @@ public:
* when recv message error.
*/
virtual
void
on_recv_error
(
int
ret
)
=
0
;
/**
* when thread start or stop,
* for example, the message handler can set whether auto response.
*/
virtual
void
on_thread_start
()
=
0
;
virtual
void
on_thread_stop
()
=
0
;
};
/**
...
...
@@ -99,6 +105,7 @@ class SrsQueueRecvThread : public ISrsMessageHandler
private
:
std
::
vector
<
SrsMessage
*>
queue
;
SrsRecvThread
trd
;
SrsRtmpServer
*
rtmp
;
// the recv thread error code.
int
recv_error_code
;
public
:
...
...
@@ -116,6 +123,9 @@ public:
virtual
bool
can_handle
();
virtual
int
handle
(
SrsMessage
*
msg
);
virtual
void
on_recv_error
(
int
ret
);
public
:
virtual
void
on_thread_start
();
virtual
void
on_thread_stop
();
};
/**
...
...
@@ -126,6 +136,7 @@ class SrsPublishRecvThread : public ISrsMessageHandler
{
private
:
SrsRecvThread
trd
;
SrsRtmpServer
*
rtmp
;
// the msgs already got.
int64_t
_nb_msgs
;
// the recv thread error code.
...
...
@@ -148,6 +159,9 @@ public:
virtual
bool
can_handle
();
virtual
int
handle
(
SrsMessage
*
msg
);
virtual
void
on_recv_error
(
int
ret
);
public
:
virtual
void
on_thread_start
();
virtual
void
on_thread_stop
();
};
#endif
...
...
trunk/src/core/srs_core.hpp
查看文件 @
e9712cc
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 4
5
#define VERSION_REVISION 4
6
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
#define RTMP_SIG_SRS_ROLE "origin/edge server"
...
...
请
注册
或
登录
后发表评论