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:13:17 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eca46c03d29426e79253be88e90da7f5791a6baa
eca46c03
1 parent
d3139c52
refine code for consumer to refer the rtmp connection.
隐藏空白字符变更
内嵌
并排对比
正在显示
5 个修改的文件
包含
14 行增加
和
10 行删除
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/core/srs_core.hpp
trunk/src/app/srs_app_http_stream.cpp
查看文件 @
eca46c0
...
...
@@ -116,7 +116,7 @@ int SrsStreamCache::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
;
}
...
...
@@ -483,7 +483,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
查看文件 @
eca46c0
...
...
@@ -598,7 +598,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
查看文件 @
eca46c0
...
...
@@ -418,9 +418,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
();
...
...
@@ -2143,11 +2144,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
查看文件 @
eca46c0
...
...
@@ -51,6 +51,7 @@ class SrsStSocket;
class
SrsRtmpServer
;
class
SrsEdgeProxyContext
;
class
SrsMessageArray
;
class
SrsConnection
;
#ifdef SRS_AUTO_HLS
class
SrsHls
;
#endif
...
...
@@ -224,6 +225,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
;
...
...
@@ -236,7 +239,7 @@ private:
int
mw_duration
;
#endif
public
:
SrsConsumer
(
SrsSource
*
_source
);
SrsConsumer
(
SrsSource
*
s
,
SrsConnection
*
c
);
virtual
~
SrsConsumer
();
public
:
/**
...
...
@@ -571,7 +574,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
);
...
...
trunk/src/core/srs_core.hpp
查看文件 @
eca46c0
...
...
@@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// current release version
#define VERSION_MAJOR 2
#define VERSION_MINOR 0
#define VERSION_REVISION 20
5
#define VERSION_REVISION 20
6
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
请
注册
或
登录
后发表评论