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-27 15:10:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a363e3d293f4bc7f5297b2cd622c5b8af180d693
a363e3d2
1 parent
bc764872
support basic edge(play/publish) RTMP server. 0.9.78
显示空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
54 行增加
和
3 行删除
README.md
trunk/src/app/srs_app_edge.cpp
trunk/src/app/srs_app_edge.hpp
trunk/src/core/srs_core.hpp
README.md
查看文件 @
a363e3d
...
...
@@ -192,6 +192,7 @@ Supported operating systems and hardware:
*
2013-10-17, Created.
<br/>
## History
*
v1.0, 2014-04-27, support basic edge(play/publish) RTMP server. 0.9.78
*
v1.0, 2014-04-25, add donation page. 0.9.76
*
v1.0, 2014-04-24, support live flashP2P(integrated by chnvideo VDN). 0.9.75
*
v1.0, 2014-04-21, support android app to start srs for internal edge. 0.9.72
...
...
trunk/src/app/srs_app_edge.cpp
查看文件 @
a363e3d
...
...
@@ -49,6 +49,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// when edge timeout, retry next.
#define SRS_EDGE_INGESTER_TIMEOUT_US (int64_t)(3*1000*1000LL)
// when error, edge ingester sleep for a while and retry.
#define SRS_EDGE_FORWARDER_SLEEP_US (int64_t)(1*1000*1000LL)
// when edge timeout, retry next.
#define SRS_EDGE_FORWARDER_TIMEOUT_US (int64_t)(3*1000*1000LL)
SrsEdgeIngester
::
SrsEdgeIngester
()
{
io
=
NULL
;
...
...
@@ -316,6 +322,7 @@ SrsEdgeForwarder::SrsEdgeForwarder()
origin_index
=
0
;
stream_id
=
0
;
stfd
=
NULL
;
pthread
=
new
SrsThread
(
this
,
SRS_EDGE_FORWARDER_SLEEP_US
);
}
SrsEdgeForwarder
::~
SrsEdgeForwarder
()
...
...
@@ -367,17 +374,54 @@ int SrsEdgeForwarder::start()
return
ret
;
}
return
ret
;
return
pthread
->
start
()
;
}
void
SrsEdgeForwarder
::
stop
()
{
pthread
->
stop
();
close_underlayer_socket
();
srs_freep
(
client
);
srs_freep
(
io
);
}
int
SrsEdgeForwarder
::
cycle
()
{
int
ret
=
ERROR_SUCCESS
;
client
->
set_recv_timeout
(
SRS_EDGE_FORWARDER_TIMEOUT_US
);
SrsPithyPrint
pithy_print
(
SRS_STAGE_EDGE
);
while
(
pthread
->
can_loop
())
{
// switch to other st-threads.
st_usleep
(
0
);
pithy_print
.
elapse
();
// pithy print
if
(
pithy_print
.
can_print
())
{
srs_trace
(
"-> time=%"
PRId64
", obytes=%"
PRId64
", ibytes=%"
PRId64
", okbps=%d, ikbps=%d"
,
pithy_print
.
age
(),
client
->
get_send_bytes
(),
client
->
get_recv_bytes
(),
client
->
get_send_kbps
(),
client
->
get_recv_kbps
());
}
// read from client.
SrsCommonMessage
*
msg
=
NULL
;
if
((
ret
=
client
->
recv_message
(
&
msg
))
!=
ERROR_SUCCESS
)
{
srs_info
(
"ignore forwarder recv origin server message failed. ret=%d"
,
ret
);
continue
;
}
srs_verbose
(
"edge loop recv message. ret=%d"
,
ret
);
srs_assert
(
msg
);
SrsAutoFree
(
SrsCommonMessage
,
msg
,
false
);
}
return
ret
;
}
int
SrsEdgeForwarder
::
proxy
(
SrsCommonMessage
*
msg
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
trunk/src/app/srs_app_edge.hpp
查看文件 @
a363e3d
...
...
@@ -104,7 +104,7 @@ private:
/**
* edge used to forward stream to origin.
*/
class
SrsEdgeForwarder
class
SrsEdgeForwarder
:
public
ISrsThreadHandler
{
private
:
int
stream_id
;
...
...
@@ -112,6 +112,7 @@ private:
SrsSource
*
_source
;
SrsPublishEdge
*
_edge
;
SrsRequest
*
_req
;
SrsThread
*
pthread
;
st_netfd_t
stfd
;
ISrsProtocolReaderWriter
*
io
;
SrsRtmpClient
*
client
;
...
...
@@ -123,6 +124,9 @@ public:
virtual
int
initialize
(
SrsSource
*
source
,
SrsPublishEdge
*
edge
,
SrsRequest
*
req
);
virtual
int
start
();
virtual
void
stop
();
// interface ISrsThreadHandler
public:
virtual
int
cycle
();
public
:
virtual
int
proxy
(
SrsCommonMessage
*
msg
);
private
:
...
...
@@ -134,6 +138,7 @@ private:
* play edge control service.
* downloading edge speed-up.
*/
// TODO: FIXME: support reload
class
SrsPlayEdge
{
private
:
...
...
@@ -164,6 +169,7 @@ public:
* publish edge control service.
* uploading edge speed-up.
*/
// TODO: FIXME: support reload
class
SrsPublishEdge
{
private
:
...
...
trunk/src/core/srs_core.hpp
查看文件 @
a363e3d
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR "0"
#define VERSION_MINOR "9"
#define VERSION_REVISION "7
7
"
#define VERSION_REVISION "7
8
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "srs"
...
...
请
注册
或
登录
后发表评论