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-04-04 12:18:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6d32ad1828f27c851106581b7a988405bfdd913f
6d32ad18
1 parent
1117f785
refine log and thread function name
显示空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
19 行增加
和
17 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_encoder.cpp
trunk/src/app/srs_app_encoder.hpp
trunk/src/app/srs_app_server.cpp
trunk/src/app/srs_app_server.hpp
trunk/src/app/srs_app_thread.cpp
trunk/src/app/srs_app_thread.hpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/src/app/srs_app_config.cpp
查看文件 @
6d32ad1
...
...
@@ -686,13 +686,15 @@ int SrsConfig::parse_file(const char* filename)
// check log
std
::
string
log_filename
=
this
->
get_srs_log_file
();
if
(
this
->
get_srs_log_tank_file
()
&&
log_filename
.
empty
())
{
if
(
get_srs_log_tank_file
()
&&
log_filename
.
empty
())
{
ret
=
ERROR_SYSTEM_CONFIG_INVALID
;
srs_error
(
"must specifies the file to write log to. ret=%d"
,
ret
);
return
ret
;
}
if
(
!
log_filename
.
empty
())
{
if
(
get_srs_log_tank_file
())
{
srs_trace
(
"log file is %s"
,
log_filename
.
c_str
());
}
else
{
srs_trace
(
"write log to console"
);
}
return
ret
;
...
...
trunk/src/app/srs_app_encoder.cpp
查看文件 @
6d32ad1
...
...
@@ -569,7 +569,7 @@ int SrsEncoder::cycle()
return
ret
;
}
void
SrsEncoder
::
on_
leave_lo
op
()
void
SrsEncoder
::
on_
thread_st
op
()
{
// kill ffmpeg when finished and it alive
std
::
vector
<
SrsFFMPEG
*>::
iterator
it
;
...
...
trunk/src/app/srs_app_encoder.hpp
查看文件 @
6d32ad1
...
...
@@ -101,7 +101,7 @@ public:
// interface ISrsThreadHandler.
public:
virtual
int
cycle
();
virtual
void
on_
leave_lo
op
();
virtual
void
on_
thread_st
op
();
private
:
virtual
void
clear_engines
();
virtual
SrsFFMPEG
*
at
(
int
index
);
...
...
trunk/src/app/srs_app_server.cpp
查看文件 @
6d32ad1
...
...
@@ -126,7 +126,7 @@ int SrsListener::listen(int _port)
return
ret
;
}
void
SrsListener
::
on_
enter_loop
()
void
SrsListener
::
on_
thread_start
()
{
srs_trace
(
"listen cycle start, port=%d, type=%d, fd=%d"
,
port
,
type
,
fd
);
}
...
...
trunk/src/app/srs_app_server.hpp
查看文件 @
6d32ad1
...
...
@@ -69,7 +69,7 @@ public:
virtual
int
listen
(
int
port
);
// interface ISrsThreadHandler.
public:
virtual
void
on_
enter_loop
();
virtual
void
on_
thread_start
();
virtual
int
cycle
();
};
...
...
trunk/src/app/srs_app_thread.cpp
查看文件 @
6d32ad1
...
...
@@ -34,7 +34,7 @@ ISrsThreadHandler::~ISrsThreadHandler()
{
}
void
ISrsThreadHandler
::
on_
enter_loop
()
void
ISrsThreadHandler
::
on_
thread_start
()
{
}
...
...
@@ -50,7 +50,7 @@ int ISrsThreadHandler::on_end_cycle()
return
ret
;
}
void
ISrsThreadHandler
::
on_
leave_lo
op
()
void
ISrsThreadHandler
::
on_
thread_st
op
()
{
}
...
...
@@ -114,9 +114,9 @@ void SrsThread::thread_cycle()
srs_assert
(
handler
);
_srs_context
->
generate_id
();
srs_
trace
(
"thread cycle start"
);
srs_
info
(
"thread cycle start"
);
handler
->
on_
end_cycle
();
handler
->
on_
thread_start
();
loop
=
true
;
while
(
loop
)
{
...
...
@@ -146,7 +146,7 @@ failed:
st_usleep
(
cycle_interval_us
);
}
handler
->
on_
leave_lo
op
();
handler
->
on_
thread_st
op
();
srs_trace
(
"thread cycle finished"
);
}
...
...
trunk/src/app/srs_app_thread.hpp
查看文件 @
6d32ad1
...
...
@@ -34,14 +34,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/**
* the handler for the thread, callback interface.
* the thread model defines as:
* handler->on_
enter_loop
()
* handler->on_
thread_start
()
* while loop:
* handler->on_before_cycle()
* handler->cycle()
* handler->on_end_cycle()
* if !loop then break for user stop thread.
* sleep(CycleIntervalMilliseconds)
* handler->on_
leave_lo
op()
* handler->on_
thread_st
op()
* when stop, the thread will interrupt the st_thread,
* which will cause the socket to return error and
* terminate the cycle thread.
...
...
@@ -69,11 +69,11 @@ public:
ISrsThreadHandler
();
virtual
~
ISrsThreadHandler
();
public
:
virtual
void
on_
enter_loop
();
virtual
void
on_
thread_start
();
virtual
int
on_before_cycle
();
virtual
int
cycle
()
=
0
;
virtual
int
on_end_cycle
();
virtual
void
on_
leave_lo
op
();
virtual
void
on_
thread_st
op
();
};
/**
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
6d32ad1
...
...
@@ -166,8 +166,8 @@ string srs_client_type_string(SrsRtmpConnType type)
{
switch
(
type
)
{
case
SrsRtmpConnPlay
:
return
"Play"
;
case
SrsRtmpConnFlashPublish
:
return
"FlashPublish"
;
case
SrsRtmpConnFMLEPublish
:
return
"FMLEPublish"
;
case
SrsRtmpConnFlashPublish
:
return
"publish(FlashPublish)"
;
case
SrsRtmpConnFMLEPublish
:
return
"publish(FMLEPublish)"
;
default
:
return
"Unknown"
;
}
return
"Unknown"
;
...
...
请
注册
或
登录
后发表评论