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
2015-12-26 12:17:51 +0800
Browse Files
Options
Browse Files
Download
Plain Diff
Commit
7ae2c6bf508f293bf89808b269b7c2cdb85c15f8
7ae2c6bf
2 parents
11e11005
eca46c03
merge from srs2.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
13 行增加
和
9 行删除
trunk/src/app/srs_app_http_stream.cpp
trunk/src/app/srs_app_rtmp_conn.cpp
trunk/src/app/srs_app_source.cpp
trunk/src/app/srs_app_source.hpp
trunk/src/app/srs_app_http_stream.cpp
查看文件 @
7ae2c6b
...
...
@@ -117,7 +117,7 @@ int SrsBufferCache::cycle()
// the stream cache will create consumer to cache stream,
// which will trigger to fetch stream from origin for edge.
SrsConsumer
*
consumer
=
NULL
;
if
((
ret
=
source
->
create_consumer
(
consumer
,
false
,
false
,
true
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
source
->
create_consumer
(
NULL
,
consumer
,
false
,
false
,
true
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"http: create consumer failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
@@ -484,7 +484,7 @@ int SrsLiveStream::serve_http(ISrsHttpResponseWriter* w, ISrsHttpMessage* r)
// create consumer of souce, ignore gop cache, use the audio gop cache.
SrsConsumer
*
consumer
=
NULL
;
if
((
ret
=
source
->
create_consumer
(
consumer
,
true
,
true
,
!
enc
->
has_cache
()))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
source
->
create_consumer
(
NULL
,
consumer
,
true
,
true
,
!
enc
->
has_cache
()))
!=
ERROR_SUCCESS
)
{
srs_error
(
"http: create consumer failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/app/srs_app_rtmp_conn.cpp
查看文件 @
7ae2c6b
...
...
@@ -832,7 +832,7 @@ int SrsRtmpConn::playing(SrsSource* source)
// create consumer of souce.
SrsConsumer
*
consumer
=
NULL
;
if
((
ret
=
source
->
create_consumer
(
consumer
))
!=
ERROR_SUCCESS
)
{
if
((
ret
=
source
->
create_consumer
(
this
,
consumer
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"create consumer failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/app/srs_app_source.cpp
查看文件 @
7ae2c6b
...
...
@@ -419,9 +419,10 @@ ISrsWakable::~ISrsWakable()
{
}
SrsConsumer
::
SrsConsumer
(
SrsSource
*
_source
)
SrsConsumer
::
SrsConsumer
(
SrsSource
*
s
,
SrsConnection
*
c
)
{
source
=
_source
;
source
=
s
;
conn
=
c
;
paused
=
false
;
jitter
=
new
SrsRtmpJitter
();
queue
=
new
SrsMessageQueue
();
...
...
@@ -2157,11 +2158,11 @@ void SrsSource::on_unpublish()
handler
->
on_unpublish
(
this
,
req
);
}
int
SrsSource
::
create_consumer
(
SrsConsumer
*&
consumer
,
bool
ds
,
bool
dm
,
bool
dg
)
int
SrsSource
::
create_consumer
(
SrsCon
nection
*
conn
,
SrsCon
sumer
*&
consumer
,
bool
ds
,
bool
dm
,
bool
dg
)
{
int
ret
=
ERROR_SUCCESS
;
consumer
=
new
SrsConsumer
(
this
);
consumer
=
new
SrsConsumer
(
this
,
conn
);
consumers
.
push_back
(
consumer
);
double
queue_size
=
_srs_config
->
get_queue_length
(
req
->
vhost
);
...
...
trunk/src/app/srs_app_source.hpp
查看文件 @
7ae2c6b
...
...
@@ -52,6 +52,7 @@ class SrsRtmpServer;
class
SrsEdgeProxyContext
;
class
SrsMessageArray
;
class
SrsNgExec
;
class
SrsConnection
;
#ifdef SRS_AUTO_HLS
class
SrsHls
;
#endif
...
...
@@ -225,6 +226,8 @@ private:
SrsRtmpJitter
*
jitter
;
SrsSource
*
source
;
SrsMessageQueue
*
queue
;
// the owner connection for debug, maybe NULL.
SrsConnection
*
conn
;
bool
paused
;
// when source id changed, notice all consumers
bool
should_update_source_id
;
...
...
@@ -237,7 +240,7 @@ private:
int
mw_duration
;
#endif
public
:
SrsConsumer
(
SrsSource
*
_source
);
SrsConsumer
(
SrsSource
*
s
,
SrsConnection
*
c
);
virtual
~
SrsConsumer
();
public
:
/**
...
...
@@ -575,7 +578,7 @@ public:
* @param dg, whether dumps the gop cache.
*/
virtual
int
create_consumer
(
SrsCon
sumer
*&
consumer
,
SrsCon
nection
*
conn
,
SrsConsumer
*&
consumer
,
bool
ds
=
true
,
bool
dm
=
true
,
bool
dg
=
true
);
virtual
void
on_consumer_destroy
(
SrsConsumer
*
consumer
);
...
...
请
注册
或
登录
后发表评论