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-05-27 16:11:25 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e39eed6519ddd673c24cdd94c8ade6f51d5c2a5b
e39eed65
1 parent
5ff1ce7c
add SrsPid and SrsId to client response, add pid to log
隐藏空白字符变更
内嵌
并排对比
正在显示
8 个修改的文件
包含
57 行增加
和
9 行删除
trunk/research/players/srs_bwt/release/srs_bwt.swf
trunk/research/players/srs_bwt/src/srs_bwt.as
trunk/research/players/srs_player/release/srs_player.swf
trunk/research/players/srs_player/src/srs_player.as
trunk/research/players/srs_publisher/release/srs_publisher.swf
trunk/research/players/srs_publisher/src/srs_publisher.as
trunk/src/app/srs_app_log.cpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/research/players/srs_bwt/release/srs_bwt.swf
查看文件 @
e39eed6
不能预览此文件类型
trunk/research/players/srs_bwt/src/srs_bwt.as
查看文件 @
e39eed6
...
...
@@ -137,6 +137,7 @@ package
private
var
srs_server
:
String
=
null
;
private
var
srs_primary_authors
:
String
=
null
;
private
var
srs_id
:
String
=
null
;
private
var
srs_pid
:
String
=
null
;
private
function
update_context_items
()
:
void
{
// for context menu
var
customItems
:
Array
=
[
new
ContextMenuItem
(
"SrsPlayer"
)]
;
...
...
@@ -146,6 +147,9 @@ package
if
(
srs_primary_authors
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"PrimaryAuthors: "
+
srs_primary_authors
))
;
}
if
(
srs_pid
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsPid: "
+
srs_pid
))
;
}
if
(
srs_id
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsId: "
+
srs_id
))
;
}
...
...
@@ -166,6 +170,9 @@ package
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_id"
))
{
srs_id
=
evt
.
info
.
data
.
srs_id
;
}
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_pid"
))
{
srs_pid
=
evt
.
info
.
data
.
srs_pid
;
}
update_context_items
()
;
}
...
...
trunk/research/players/srs_player/release/srs_player.swf
查看文件 @
e39eed6
不能预览此文件类型
trunk/research/players/srs_player/src/srs_player.as
查看文件 @
e39eed6
...
...
@@ -269,6 +269,7 @@ package
private
var
srs_server
:
String
=
null
;
private
var
srs_primary_authors
:
String
=
null
;
private
var
srs_id
:
String
=
null
;
private
var
srs_pid
:
String
=
null
;
private
function
update_context_items
()
:
void
{
// for context menu
var
customItems
:
Array
=
[
new
ContextMenuItem
(
"SrsPlayer"
)]
;
...
...
@@ -278,6 +279,9 @@ package
if
(
srs_primary_authors
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"PrimaryAuthors: "
+
srs_primary_authors
))
;
}
if
(
srs_pid
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsPid: "
+
srs_pid
))
;
}
if
(
srs_id
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsId: "
+
srs_id
))
;
}
...
...
@@ -316,6 +320,9 @@ package
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_id"
))
{
srs_id
=
evt
.
info
.
data
.
srs_id
;
}
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_pid"
))
{
srs_pid
=
evt
.
info
.
data
.
srs_pid
;
}
update_context_items
()
;
}
...
...
trunk/research/players/srs_publisher/release/srs_publisher.swf
查看文件 @
e39eed6
不能预览此文件类型
trunk/research/players/srs_publisher/src/srs_publisher.as
查看文件 @
e39eed6
...
...
@@ -138,6 +138,7 @@ package
private
var
srs_server
:
String
=
null
;
private
var
srs_primary_authors
:
String
=
null
;
private
var
srs_id
:
String
=
null
;
private
var
srs_pid
:
String
=
null
;
private
function
update_context_items
()
:
void
{
// for context menu
var
customItems
:
Array
=
[
new
ContextMenuItem
(
"SrsPlayer"
)]
;
...
...
@@ -147,6 +148,9 @@ package
if
(
srs_primary_authors
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"PrimaryAuthors: "
+
srs_primary_authors
))
;
}
if
(
srs_pid
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsPid: "
+
srs_pid
))
;
}
if
(
srs_id
!=
null
)
{
customItems
.
push
(
new
ContextMenuItem
(
"SrsId: "
+
srs_id
))
;
}
...
...
@@ -215,6 +219,9 @@ package
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_id"
))
{
srs_id
=
evt
.
info
.
data
.
srs_id
;
}
if
(
evt
.
info
.
data
.
hasOwnProperty
(
"srs_pid"
))
{
srs_pid
=
evt
.
info
.
data
.
srs_pid
;
}
update_context_items
()
;
}
...
...
trunk/src/app/srs_app_log.cpp
查看文件 @
e39eed6
...
...
@@ -265,26 +265,26 @@ bool SrsFastLog::generate_header(bool error, const char* tag, int context_id, co
if
(
error
)
{
if
(
tag
)
{
log_header_size
=
snprintf
(
log_data
,
LOG_MAX_SIZE
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d][%d] "
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d][%d]
[%d]
"
,
1900
+
tm
->
tm_year
,
1
+
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
,
(
int
)(
tv
.
tv_usec
/
1000
),
level_name
,
tag
,
context_id
,
errno
);
level_name
,
tag
,
getpid
(),
context_id
,
errno
);
}
else
{
log_header_size
=
snprintf
(
log_data
,
LOG_MAX_SIZE
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d][%d] "
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d][%d]
[%d]
"
,
1900
+
tm
->
tm_year
,
1
+
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
,
(
int
)(
tv
.
tv_usec
/
1000
),
level_name
,
context_id
,
errno
);
level_name
,
getpid
(),
context_id
,
errno
);
}
}
else
{
if
(
tag
)
{
log_header_size
=
snprintf
(
log_data
,
LOG_MAX_SIZE
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d] "
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%s][%d]
[%d]
"
,
1900
+
tm
->
tm_year
,
1
+
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
,
(
int
)(
tv
.
tv_usec
/
1000
),
level_name
,
tag
,
context_id
);
level_name
,
tag
,
getpid
(),
context_id
);
}
else
{
log_header_size
=
snprintf
(
log_data
,
LOG_MAX_SIZE
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d] "
,
"[%d-%02d-%02d %02d:%02d:%02d.%03d][%s][%d]
[%d]
"
,
1900
+
tm
->
tm_year
,
1
+
tm
->
tm_mon
,
tm
->
tm_mday
,
tm
->
tm_hour
,
tm
->
tm_min
,
tm
->
tm_sec
,
(
int
)(
tv
.
tv_usec
/
1000
),
level_name
,
context_id
);
level_name
,
getpid
(),
context_id
);
}
}
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
e39eed6
...
...
@@ -492,7 +492,33 @@ int SrsRtmpClient::connect_app(string app, string tc_url)
}
SrsAutoFree
(
SrsMessage
,
msg
);
SrsAutoFree
(
SrsConnectAppResPacket
,
pkt
);
srs_info
(
"get connect app response message"
);
// server info
std
::
string
srs_version
;
std
::
string
srs_server_ip
;
int
srs_id
=
0
;
int
srs_pid
=
0
;
SrsAmf0Any
*
data
=
pkt
->
info
->
get_property
(
"data"
);
if
(
data
&&
data
->
is_ecma_array
())
{
SrsAmf0EcmaArray
*
arr
=
data
->
to_ecma_array
();
SrsAmf0Any
*
prop
=
NULL
;
if
((
prop
=
arr
->
ensure_property_string
(
"srs_version"
))
!=
NULL
)
{
srs_version
=
prop
->
to_str
();
}
if
((
prop
=
arr
->
ensure_property_string
(
"srs_server_ip"
))
!=
NULL
)
{
srs_server_ip
=
prop
->
to_str
();
}
if
((
prop
=
arr
->
ensure_property_number
(
"srs_id"
))
!=
NULL
)
{
srs_id
=
(
int
)
prop
->
to_number
();
}
if
((
prop
=
arr
->
ensure_property_number
(
"srs_pid"
))
!=
NULL
)
{
srs_pid
=
(
int
)
prop
->
to_number
();
}
}
srs_trace
(
"connected, version=%s, ip=%s, identity=[%d][%d]"
,
srs_version
.
c_str
(),
srs_server_ip
.
c_str
(),
srs_pid
,
srs_id
);
return
ret
;
}
...
...
@@ -867,6 +893,7 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip)
data
->
set
(
"srs_server_ip"
,
SrsAmf0Any
::
str
(
server_ip
));
}
// for edge to directly get the id of client.
data
->
set
(
"srs_pid"
,
SrsAmf0Any
::
number
(
getpid
()));
data
->
set
(
"srs_id"
,
SrsAmf0Any
::
number
(
_srs_context
->
get_id
()));
if
((
ret
=
protocol
->
send_and_free_packet
(
pkt
,
0
))
!=
ERROR_SUCCESS
)
{
...
...
请
注册
或
登录
后发表评论