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-01 22:23:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22524f390a46b29fb432535fa818edcf6ee8f53e
22524f39
1 parent
1847c5fe
rename the recv thread to queue recv thread for bug #237.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
17 行增加
和
17 行删除
trunk/src/app/srs_app_recv_thread.cpp
trunk/src/app/srs_app_recv_thread.hpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_rtmp_conn.hpp
trunk/src/app/srs_app_recv_thread.cpp
查看文件 @
22524f3
...
...
@@ -26,13 +26,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_protocol_rtmp.hpp>
#include <srs_protocol_stack.hpp>
Srs
RecvThread
::
Srs
RecvThread
(
SrsRtmpServer
*
rtmp_sdk
)
Srs
QueueRecvThread
::
SrsQueue
RecvThread
(
SrsRtmpServer
*
rtmp_sdk
)
{
rtmp
=
rtmp_sdk
;
trd
=
new
SrsThread
(
this
,
0
,
true
);
}
Srs
RecvThread
::~
Srs
RecvThread
()
Srs
QueueRecvThread
::~
SrsQueue
RecvThread
()
{
// stop recv thread.
stop
();
...
...
@@ -49,17 +49,17 @@ SrsRecvThread::~SrsRecvThread()
queue
.
clear
();
}
bool
SrsRecvThread
::
empty
()
bool
Srs
Queue
RecvThread
::
empty
()
{
return
queue
.
empty
();
}
int
SrsRecvThread
::
size
()
int
Srs
Queue
RecvThread
::
size
()
{
return
(
int
)
queue
.
size
();
}
SrsMessage
*
SrsRecvThread
::
pump
()
SrsMessage
*
Srs
Queue
RecvThread
::
pump
()
{
srs_assert
(
!
queue
.
empty
());
...
...
@@ -70,17 +70,17 @@ SrsMessage* SrsRecvThread::pump()
return
msg
;
}
int
SrsRecvThread
::
start
()
int
Srs
Queue
RecvThread
::
start
()
{
return
trd
->
start
();
}
void
SrsRecvThread
::
stop
()
void
Srs
Queue
RecvThread
::
stop
()
{
trd
->
stop
();
}
int
SrsRecvThread
::
cycle
()
int
Srs
Queue
RecvThread
::
cycle
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -114,7 +114,7 @@ int SrsRecvThread::cycle()
return
ret
;
}
void
SrsRecvThread
::
on_thread_start
()
void
Srs
Queue
RecvThread
::
on_thread_start
()
{
// the multiple messages writev improve performance large,
// but the timeout recv will cause 33% sys call performance,
...
...
@@ -128,7 +128,7 @@ void SrsRecvThread::on_thread_start()
rtmp
->
set_auto_response
(
false
);
}
void
SrsRecvThread
::
on_thread_stop
()
void
Srs
Queue
RecvThread
::
on_thread_stop
()
{
// enable the protocol auto response,
// for the isolate recv thread terminated.
...
...
trunk/src/app/srs_app_recv_thread.hpp
查看文件 @
22524f3
...
...
@@ -43,15 +43,15 @@ class SrsMessage;
* @see: SrsRtmpConn::playing
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
*/
class
SrsRecvThread
:
public
ISrsThreadHandler
class
Srs
Queue
RecvThread
:
public
ISrsThreadHandler
{
private
:
SrsThread
*
trd
;
SrsRtmpServer
*
rtmp
;
std
::
vector
<
SrsMessage
*>
queue
;
public
:
SrsRecvThread
(
SrsRtmpServer
*
rtmp_sdk
);
virtual
~
SrsRecvThread
();
SrsQueueRecvThread
(
SrsRtmpServer
*
rtmp_sdk
);
virtual
~
SrsQueueRecvThread
();
public
:
virtual
bool
empty
();
virtual
int
size
();
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
22524f3
...
...
@@ -500,7 +500,7 @@ int SrsRtmpConn::playing(SrsSource* source)
// use isolate thread to recv,
// @see: https://github.com/winlinvip/simple-rtmp-server/issues/217
SrsRecvThread
trd
(
rtmp
);
Srs
Queue
RecvThread
trd
(
rtmp
);
// start isolate recv thread.
if
((
ret
=
trd
.
start
())
!=
ERROR_SUCCESS
)
{
...
...
@@ -522,7 +522,7 @@ int SrsRtmpConn::playing(SrsSource* source)
return
ret
;
}
int
SrsRtmpConn
::
do_playing
(
SrsSource
*
source
,
SrsRecvThread
*
trd
)
int
SrsRtmpConn
::
do_playing
(
SrsSource
*
source
,
Srs
Queue
RecvThread
*
trd
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_rtmp_conn.hpp
查看文件 @
22524f3
...
...
@@ -49,7 +49,7 @@ class SrsBandwidth;
class
SrsKbps
;
class
SrsRtmpClient
;
class
SrsSharedPtrMessage
;
class
SrsRecvThread
;
class
Srs
Queue
RecvThread
;
/**
* the client provides the main logic control for RTMP clients.
...
...
@@ -89,7 +89,7 @@ private:
virtual
int
stream_service_cycle
();
virtual
int
check_vhost
();
virtual
int
playing
(
SrsSource
*
source
);
virtual
int
do_playing
(
SrsSource
*
source
,
SrsRecvThread
*
trd
);
virtual
int
do_playing
(
SrsSource
*
source
,
Srs
Queue
RecvThread
*
trd
);
virtual
int
fmle_publishing
(
SrsSource
*
source
);
virtual
int
do_fmle_publishing
(
SrsSource
*
source
);
virtual
int
flash_publishing
(
SrsSource
*
source
);
...
...
请
注册
或
登录
后发表评论