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-03-02 13:54:40 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8aedc51a2fa475d3e409daf08aba4ddc1344eb58
8aedc51a
1 parent
4f91cae3
refine code, rename SrsRtmp to SrsRtmpServer.
隐藏空白字符变更
内嵌
并排对比
正在显示
7 个修改的文件
包含
58 行增加
和
42 行删除
trunk/src/app/srs_core_bandwidth.cpp
trunk/src/app/srs_core_bandwidth.hpp
trunk/src/app/srs_core_client.cpp
trunk/src/app/srs_core_client.hpp
trunk/src/libs/srs_librtmp.cpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/src/rtmp/srs_protocol_rtmp.hpp
trunk/src/app/srs_core_bandwidth.cpp
查看文件 @
8aedc51
...
...
@@ -43,7 +43,7 @@ SrsBandwidth::~SrsBandwidth()
{
}
int
SrsBandwidth
::
bandwidth_test
(
SrsRequest
*
_req
,
st_netfd_t
stfd
,
SrsRtmp
*
_rtmp
)
int
SrsBandwidth
::
bandwidth_test
(
SrsRequest
*
_req
,
st_netfd_t
stfd
,
SrsRtmp
Server
*
_rtmp
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_core_bandwidth.hpp
查看文件 @
8aedc51
...
...
@@ -32,7 +32,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_st.hpp>
class
SrsRequest
;
class
SrsRtmp
;
class
SrsRtmp
Server
;
/**
* bandwidth test agent which provides the interfaces for bandwidth check.
...
...
@@ -74,7 +74,7 @@ class SrsBandwidth
{
private
:
SrsRequest
*
req
;
SrsRtmp
*
rtmp
;
SrsRtmp
Server
*
rtmp
;
public
:
SrsBandwidth
();
virtual
~
SrsBandwidth
();
...
...
@@ -82,7 +82,7 @@ public:
/**
* do the bandwidth test.
*/
virtual
int
bandwidth_test
(
SrsRequest
*
_req
,
st_netfd_t
stfd
,
SrsRtmp
*
_rtmp
);
virtual
int
bandwidth_test
(
SrsRequest
*
_req
,
st_netfd_t
stfd
,
SrsRtmp
Server
*
_rtmp
);
private
:
virtual
int
get_local_ip
(
st_netfd_t
stfd
,
char
*&
local_ip
);
/**
...
...
trunk/src/app/srs_core_client.cpp
查看文件 @
8aedc51
...
...
@@ -50,7 +50,7 @@ SrsClient::SrsClient(SrsServer* srs_server, st_netfd_t client_stfd)
req
=
new
SrsRequest
();
res
=
new
SrsResponse
();
skt
=
new
SrsSocket
(
client_stfd
);
rtmp
=
new
SrsRtmp
(
skt
);
rtmp
=
new
SrsRtmp
Server
(
skt
);
refer
=
new
SrsRefer
();
#ifdef SRS_HTTP
http_hooks
=
new
SrsHttpHooks
();
...
...
trunk/src/app/srs_core_client.hpp
查看文件 @
8aedc51
...
...
@@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_core_conn.hpp>
#include <srs_core_reload.hpp>
class
SrsRtmp
;
class
SrsRtmp
Server
;
class
SrsRequest
;
class
SrsResponse
;
class
SrsSource
;
...
...
@@ -57,7 +57,7 @@ private:
SrsRequest
*
req
;
SrsResponse
*
res
;
SrsSocket
*
skt
;
SrsRtmp
*
rtmp
;
SrsRtmp
Server
*
rtmp
;
SrsRefer
*
refer
;
#ifdef SRS_HTTP
SrsHttpHooks
*
http_hooks
;
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
8aedc51
...
...
@@ -206,7 +206,23 @@ int srs_complex_handshake(srs_rtmp_t rtmp)
int
srs_connect_app
(
srs_rtmp_t
rtmp
)
{
return
ERROR_SUCCESS
;
int
ret
=
ERROR_SUCCESS
;
srs_assert
(
rtmp
!=
NULL
);
Context
*
context
=
(
Context
*
)
rtmp
;
string
tcUrl
=
"rtmp://"
;
tcUrl
+=
context
->
vhost
;
tcUrl
+=
":"
;
tcUrl
+=
context
->
port
;
tcUrl
+=
"/"
;
tcUrl
+=
context
->
app
;
if
((
ret
=
context
->
rtmp
->
connect_app
(
context
->
app
,
tcUrl
))
!=
ERROR_SUCCESS
)
{
return
ret
;
}
return
ret
;
}
int
srs_play_stream
(
srs_rtmp_t
rtmp
)
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
8aedc51
...
...
@@ -441,73 +441,73 @@ int SrsRtmpClient::publish(string stream, int stream_id)
return
ret
;
}
SrsRtmp
::
SrsRtmp
(
ISrsProtocolReaderWriter
*
skt
)
SrsRtmp
Server
::
SrsRtmpServer
(
ISrsProtocolReaderWriter
*
skt
)
{
io
=
skt
;
protocol
=
new
SrsProtocol
(
skt
);
}
SrsRtmp
::~
SrsRtmp
()
SrsRtmp
Server
::~
SrsRtmpServer
()
{
srs_freep
(
protocol
);
}
SrsProtocol
*
SrsRtmp
::
get_protocol
()
SrsProtocol
*
SrsRtmp
Server
::
get_protocol
()
{
return
protocol
;
}
void
SrsRtmp
::
set_recv_timeout
(
int64_t
timeout_us
)
void
SrsRtmp
Server
::
set_recv_timeout
(
int64_t
timeout_us
)
{
protocol
->
set_recv_timeout
(
timeout_us
);
}
int64_t
SrsRtmp
::
get_recv_timeout
()
int64_t
SrsRtmp
Server
::
get_recv_timeout
()
{
return
protocol
->
get_recv_timeout
();
}
void
SrsRtmp
::
set_send_timeout
(
int64_t
timeout_us
)
void
SrsRtmp
Server
::
set_send_timeout
(
int64_t
timeout_us
)
{
protocol
->
set_send_timeout
(
timeout_us
);
}
int64_t
SrsRtmp
::
get_send_timeout
()
int64_t
SrsRtmp
Server
::
get_send_timeout
()
{
return
protocol
->
get_send_timeout
();
}
int64_t
SrsRtmp
::
get_recv_bytes
()
int64_t
SrsRtmp
Server
::
get_recv_bytes
()
{
return
protocol
->
get_recv_bytes
();
}
int64_t
SrsRtmp
::
get_send_bytes
()
int64_t
SrsRtmp
Server
::
get_send_bytes
()
{
return
protocol
->
get_send_bytes
();
}
int
SrsRtmp
::
get_recv_kbps
()
int
SrsRtmp
Server
::
get_recv_kbps
()
{
return
protocol
->
get_recv_kbps
();
}
int
SrsRtmp
::
get_send_kbps
()
int
SrsRtmp
Server
::
get_send_kbps
()
{
return
protocol
->
get_send_kbps
();
}
int
SrsRtmp
::
recv_message
(
SrsCommonMessage
**
pmsg
)
int
SrsRtmp
Server
::
recv_message
(
SrsCommonMessage
**
pmsg
)
{
return
protocol
->
recv_message
(
pmsg
);
}
int
SrsRtmp
::
send_message
(
ISrsMessage
*
msg
)
int
SrsRtmp
Server
::
send_message
(
ISrsMessage
*
msg
)
{
return
protocol
->
send_message
(
msg
);
}
int
SrsRtmp
::
handshake
()
int
SrsRtmp
Server
::
handshake
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -520,7 +520,7 @@ int SrsRtmp::handshake()
return
ret
;
}
int
SrsRtmp
::
connect_app
(
SrsRequest
*
req
)
int
SrsRtmp
Server
::
connect_app
(
SrsRequest
*
req
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -559,7 +559,7 @@ int SrsRtmp::connect_app(SrsRequest* req)
return
req
->
discovery_app
();
}
int
SrsRtmp
::
set_window_ack_size
(
int
ack_size
)
int
SrsRtmp
Server
::
set_window_ack_size
(
int
ack_size
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -578,7 +578,7 @@ int SrsRtmp::set_window_ack_size(int ack_size)
return
ret
;
}
int
SrsRtmp
::
set_peer_bandwidth
(
int
bandwidth
,
int
type
)
int
SrsRtmp
Server
::
set_peer_bandwidth
(
int
bandwidth
,
int
type
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -599,7 +599,7 @@ int SrsRtmp::set_peer_bandwidth(int bandwidth, int type)
return
ret
;
}
int
SrsRtmp
::
response_connect_app
(
SrsRequest
*
req
,
const
char
*
server_ip
)
int
SrsRtmp
Server
::
response_connect_app
(
SrsRequest
*
req
,
const
char
*
server_ip
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -644,7 +644,7 @@ int SrsRtmp::response_connect_app(SrsRequest *req, const char* server_ip)
return
ret
;
}
void
SrsRtmp
::
response_connect_reject
(
SrsRequest
*
req
,
const
char
*
desc
)
void
SrsRtmp
Server
::
response_connect_reject
(
SrsRequest
*
req
,
const
char
*
desc
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -665,7 +665,7 @@ void SrsRtmp::response_connect_reject(SrsRequest *req, const char* desc)
return
;
}
int
SrsRtmp
::
on_bw_done
()
int
SrsRtmp
Server
::
on_bw_done
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -683,7 +683,7 @@ int SrsRtmp::on_bw_done()
return
ret
;
}
int
SrsRtmp
::
identify_client
(
int
stream_id
,
SrsClientType
&
type
,
string
&
stream_name
)
int
SrsRtmp
Server
::
identify_client
(
int
stream_id
,
SrsClientType
&
type
,
string
&
stream_name
)
{
type
=
SrsClientUnknown
;
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -728,7 +728,7 @@ int SrsRtmp::identify_client(int stream_id, SrsClientType& type, string& stream_
return
ret
;
}
int
SrsRtmp
::
set_chunk_size
(
int
chunk_size
)
int
SrsRtmp
Server
::
set_chunk_size
(
int
chunk_size
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -747,7 +747,7 @@ int SrsRtmp::set_chunk_size(int chunk_size)
return
ret
;
}
int
SrsRtmp
::
start_play
(
int
stream_id
)
int
SrsRtmp
Server
::
start_play
(
int
stream_id
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -842,7 +842,7 @@ int SrsRtmp::start_play(int stream_id)
return
ret
;
}
int
SrsRtmp
::
on_play_client_pause
(
int
stream_id
,
bool
is_pause
)
int
SrsRtmp
Server
::
on_play_client_pause
(
int
stream_id
,
bool
is_pause
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -917,7 +917,7 @@ int SrsRtmp::on_play_client_pause(int stream_id, bool is_pause)
return
ret
;
}
int
SrsRtmp
::
start_fmle_publish
(
int
stream_id
)
int
SrsRtmp
Server
::
start_fmle_publish
(
int
stream_id
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1030,7 +1030,7 @@ int SrsRtmp::start_fmle_publish(int stream_id)
return
ret
;
}
int
SrsRtmp
::
fmle_unpublish
(
int
stream_id
,
double
unpublish_tid
)
int
SrsRtmp
Server
::
fmle_unpublish
(
int
stream_id
,
double
unpublish_tid
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1088,7 +1088,7 @@ int SrsRtmp::fmle_unpublish(int stream_id, double unpublish_tid)
return
ret
;
}
int
SrsRtmp
::
start_flash_publish
(
int
stream_id
)
int
SrsRtmp
Server
::
start_flash_publish
(
int
stream_id
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1116,7 +1116,7 @@ int SrsRtmp::start_flash_publish(int stream_id)
return
ret
;
}
int
SrsRtmp
::
identify_create_stream_client
(
SrsCreateStreamPacket
*
req
,
int
stream_id
,
SrsClientType
&
type
,
string
&
stream_name
)
int
SrsRtmp
Server
::
identify_create_stream_client
(
SrsCreateStreamPacket
*
req
,
int
stream_id
,
SrsClientType
&
type
,
string
&
stream_name
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1169,7 +1169,7 @@ int SrsRtmp::identify_create_stream_client(SrsCreateStreamPacket* req, int strea
return
ret
;
}
int
SrsRtmp
::
identify_fmle_publish_client
(
SrsFMLEStartPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
int
SrsRtmp
Server
::
identify_fmle_publish_client
(
SrsFMLEStartPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1193,7 +1193,7 @@ int SrsRtmp::identify_fmle_publish_client(SrsFMLEStartPacket* req, SrsClientType
return
ret
;
}
int
SrsRtmp
::
identify_flash_publish_client
(
SrsPublishPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
int
SrsRtmp
Server
::
identify_flash_publish_client
(
SrsPublishPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -1203,7 +1203,7 @@ int SrsRtmp::identify_flash_publish_client(SrsPublishPacket* req, SrsClientType&
return
ret
;
}
int
SrsRtmp
::
identify_play_client
(
SrsPlayPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
int
SrsRtmp
Server
::
identify_play_client
(
SrsPlayPacket
*
req
,
SrsClientType
&
type
,
string
&
stream_name
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/rtmp/srs_protocol_rtmp.hpp
查看文件 @
8aedc51
...
...
@@ -146,14 +146,14 @@ public:
* such as connect to vhost/app, play stream, get audio/video data.
*/
// TODO: FIXME: rename to SrsRtmpServer
class
SrsRtmp
class
SrsRtmp
Server
{
private
:
SrsProtocol
*
protocol
;
ISrsProtocolReaderWriter
*
io
;
public
:
SrsRtmp
(
ISrsProtocolReaderWriter
*
skt
);
virtual
~
SrsRtmp
();
SrsRtmpServer
(
ISrsProtocolReaderWriter
*
skt
);
virtual
~
SrsRtmpServer
();
public
:
virtual
SrsProtocol
*
get_protocol
();
virtual
void
set_recv_timeout
(
int64_t
timeout_us
);
...
...
请
注册
或
登录
后发表评论