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
2013-10-18 16:57:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
973bea1e14e3d383239ffd02f529c56bb081e218
973bea1e
1 parent
d8a64603
extract the rtmp connection
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
94 行增加
和
12 行删除
trunk/configure
trunk/src/core/srs_core_conn.cpp
trunk/src/core/srs_core_conn.hpp
trunk/src/core/srs_core_conn_rtmp.cpp
trunk/src/core/srs_core_conn_rtmp.hpp
trunk/src/core/srs_core_server.cpp
trunk/src/main/srs_main_server.cpp
trunk/src/srs/srs.upp
trunk/configure
查看文件 @
973bea1
...
...
@@ -82,7 +82,7 @@ LibSTfile="${LibSTRoot}/libst.a"
MODULE_ID
=
"CORE"
MODULE_DEPENDS
=()
ModuleLibIncs
=(
${
LibSTRoot
}
)
MODULE_FILES
=(
"srs_core"
"srs_core_log"
"srs_core_server"
"srs_core_error"
"srs_core_conn"
)
MODULE_FILES
=(
"srs_core"
"srs_core_log"
"srs_core_server"
"srs_core_error"
"srs_core_conn"
"srs_core_conn_rtmp"
)
MODULE_DIR
=
"src/core"
. auto/modules.sh
CORE_OBJS
=
"
${
MODULE_OBJS
[@]
}
"
...
...
trunk/src/core/srs_core_conn.cpp
查看文件 @
973bea1
...
...
@@ -51,12 +51,6 @@ int SrsConnection::start()
return
ret
;
}
int
SrsConnection
::
do_cycle
()
{
int
ret
=
ERROR_SUCCESS
;
return
ret
;
}
void
SrsConnection
::
cycle
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/core/srs_core_conn.hpp
查看文件 @
973bea1
...
...
@@ -43,8 +43,9 @@ public:
virtual
~
SrsConnection
();
public
:
virtual
int
start
();
protected
:
virtual
int
do_cycle
()
=
0
;
private
:
virtual
int
do_cycle
();
virtual
void
cycle
();
static
void
*
cycle_thread
(
void
*
arg
);
};
...
...
trunk/src/core/srs_core_conn_rtmp.cpp
0 → 100755
查看文件 @
973bea1
/*
The MIT License (MIT)
Copyright (c) 2013 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <srs_core_conn_rtmp.hpp>
#include <srs_core_error.hpp>
SrsRtmpConnection
::
SrsRtmpConnection
(
SrsServer
*
srs_server
,
st_netfd_t
client_stfd
)
:
SrsConnection
(
srs_server
,
client_stfd
)
{
}
SrsRtmpConnection
::~
SrsRtmpConnection
()
{
}
int
SrsRtmpConnection
::
do_cycle
()
{
int
ret
=
ERROR_SUCCESS
;
return
ret
;
}
...
...
trunk/src/core/srs_core_conn_rtmp.hpp
0 → 100755
查看文件 @
973bea1
/*
The MIT License (MIT)
Copyright (c) 2013 winlin
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef SRS_CORE_CONN_RTMP_HPP
#define SRS_CORE_CONN_RTMP_HPP
/*
#include <srs_core_conn_rtmp.hpp>
*/
#include <srs_core_conn.hpp>
class
SrsRtmpConnection
:
public
SrsConnection
{
public
:
SrsRtmpConnection
(
SrsServer
*
srs_server
,
st_netfd_t
client_stfd
);
virtual
~
SrsRtmpConnection
();
protected
:
virtual
int
do_cycle
();
};
#endif
\ No newline at end of file
...
...
trunk/src/core/srs_core_server.cpp
查看文件 @
973bea1
...
...
@@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_log.hpp>
#include <srs_core_error.hpp>
#include <srs_core_conn.hpp>
#include <srs_core_conn
_rtmp
.hpp>
#define SERVER_LISTEN_BACKLOG 10
...
...
@@ -135,6 +135,7 @@ int SrsServer::start(int port)
int
SrsServer
::
cycle
()
{
int
ret
=
ERROR_SUCCESS
;
// TODO: canbe a api thread.
st_thread_exit
(
NULL
);
return
ret
;
}
...
...
@@ -156,7 +157,7 @@ int SrsServer::accept_client(st_netfd_t client_stfd)
{
int
ret
=
ERROR_SUCCESS
;
SrsConnection
*
conn
=
new
SrsConnection
(
this
,
client_stfd
);
SrsConnection
*
conn
=
new
Srs
Rtmp
Connection
(
this
,
client_stfd
);
// directly enqueue, the cycle thread will remove the client.
conns
.
push_back
(
conn
);
...
...
trunk/src/main/srs_main_server.cpp
查看文件 @
973bea1
...
...
@@ -21,12 +21,12 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include <unistd.h>
#include <srs_core_log.hpp>
#include <srs_core_error.hpp>
#include <srs_core_server.hpp>
#include <unistd.h>
int
main
(
int
/*argc*/
,
char
**
/*argv*/
){
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/srs/srs.upp
查看文件 @
973bea1
...
...
@@ -10,6 +10,8 @@ file
..\core\srs_core_server.cpp,
..\core\srs_core_conn.hpp,
..\core\srs_core_conn.cpp,
..\core\srs_core_conn_rtmp.hpp,
..\core\srs_core_conn_rtmp.cpp,
..\core\srs_core_log.hpp,
..\core\srs_core_log.cpp;
mainconfig
...
...
请
注册
或
登录
后发表评论