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-08-27 23:55:59 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
555a3fbf5fc0dc7b4fec16c82343e8cfa2600c5d
555a3fbf
1 parent
8e635d97
for #319, support render HTTP RAW API in console.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
15 行增加
和
0 行删除
trunk/src/app/srs_app_config.cpp
trunk/src/app/srs_app_statistic.cpp
trunk/src/app/srs_app_statistic.hpp
trunk/src/app/srs_app_config.cpp
查看文件 @
555a3fb
...
...
@@ -48,6 +48,7 @@ using namespace std;
#include <srs_core_performance.hpp>
#include <srs_kernel_file.hpp>
#include <srs_rtmp_amf0.hpp>
#include <srs_app_statistic.hpp>
using
namespace
_srs_internal
;
...
...
@@ -1688,6 +1689,7 @@ int SrsConfig::global_to_json(SrsAmf0Object* obj)
SrsAmf0Object
*
sobjs
=
SrsAmf0Any
::
object
();
int
nb_vhosts
=
0
;
SrsStatistic
*
stat
=
SrsStatistic
::
instance
();
for
(
int
i
=
0
;
i
<
(
int
)
root
->
directives
.
size
();
i
++
)
{
SrsConfDirective
*
dir
=
root
->
directives
.
at
(
i
);
if
(
!
dir
->
is_vhost
())
{
...
...
@@ -1698,6 +1700,9 @@ int SrsConfig::global_to_json(SrsAmf0Object* obj)
SrsAmf0Object
*
sobj
=
SrsAmf0Any
::
object
();
sobjs
->
set
(
dir
->
arg0
(),
sobj
);
SrsStatisticVhost
*
svhost
=
stat
->
find_vhost
(
dir
->
arg0
());
sobj
->
set
(
"id"
,
SrsAmf0Any
::
number
(
svhost
?
(
double
)
svhost
->
id
:
0
));
sobj
->
set
(
"enabled"
,
SrsAmf0Any
::
boolean
(
get_vhost_enabled
(
dir
->
name
)));
sobj
->
set
(
"dvr"
,
SrsAmf0Any
::
boolean
(
get_dvr_enabled
(
dir
->
name
)));
sobj
->
set
(
"http_static"
,
SrsAmf0Any
::
boolean
(
get_vhost_http_enabled
(
dir
->
name
)));
...
...
trunk/src/app/srs_app_statistic.cpp
查看文件 @
555a3fb
...
...
@@ -275,6 +275,15 @@ SrsStatisticVhost* SrsStatistic::find_vhost(int vid)
return
NULL
;
}
SrsStatisticVhost
*
SrsStatistic
::
find_vhost
(
string
name
)
{
std
::
map
<
string
,
SrsStatisticVhost
*>::
iterator
it
;
if
((
it
=
rvhosts
.
find
(
name
))
!=
rvhosts
.
end
())
{
return
it
->
second
;
}
return
NULL
;
}
SrsStatisticStream
*
SrsStatistic
::
find_stream
(
int
sid
)
{
std
::
map
<
int64_t
,
SrsStatisticStream
*>::
iterator
it
;
...
...
trunk/src/app/srs_app_statistic.hpp
查看文件 @
555a3fb
...
...
@@ -156,6 +156,7 @@ public:
static
SrsStatistic
*
instance
();
public
:
virtual
SrsStatisticVhost
*
find_vhost
(
int
vid
);
virtual
SrsStatisticVhost
*
find_vhost
(
std
::
string
name
);
virtual
SrsStatisticStream
*
find_stream
(
int
sid
);
virtual
SrsStatisticClient
*
find_client
(
int
cid
);
public
:
...
...
请
注册
或
登录
后发表评论