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-06-11 14:16:44 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
55b99c90c7a4ac7d6c3e001ef68fa3b3b33aa90a
55b99c90
1 parent
17cb8c45
refine detect tool, support atc stream.
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
20 行增加
和
9 行删除
trunk/research/librtmp/srs_detect_rtmp.c
trunk/src/app/srs_app_config.hpp
trunk/src/libs/srs_librtmp.cpp
trunk/src/rtmp/srs_protocol_utility.hpp
trunk/research/librtmp/srs_detect_rtmp.c
查看文件 @
55b99c9
...
...
@@ -50,6 +50,7 @@ int main(int argc, char** argv)
// packet data
int
type
,
size
;
u_int32_t
basetime
=
0
;
u_int32_t
timestamp
=
0
;
char
*
data
;
...
...
@@ -131,8 +132,13 @@ int main(int argc, char** argv)
}
printf
(
"got packet: type=%s, time=%d, size=%d
\n
"
,
srs_type2string
(
type
),
timestamp
,
size
);
if
(
time_first_packet
<=
0
)
{
time_first_packet
=
srs_get_time_ms
();
if
(
SRS_RTMP_TYPE_VIDEO
==
type
||
SRS_RTMP_TYPE_AUDIO
==
type
)
{
if
(
time_first_packet
<=
0
)
{
time_first_packet
=
srs_get_time_ms
();
}
if
(
basetime
<=
0
)
{
basetime
=
timestamp
;
}
}
free
(
data
);
...
...
@@ -142,7 +148,7 @@ int main(int argc, char** argv)
goto
rtmp_destroy
;
}
if
(
timestamp
>
duration
*
1000
)
{
if
(
(
timestamp
-
basetime
)
>
duration
*
1000
)
{
printf
(
"duration exceed, terminate.
\n
"
);
goto
rtmp_destroy
;
}
...
...
@@ -178,11 +184,11 @@ rtmp_destroy:
"start_play"
,
(
int
)(
time_play_stream
-
time_socket_connect
),
//#4
"first_packet"
,
(
int
)(
time_first_packet
-
time_play_stream
),
//#5
"last_packet"
,
(
int
)(
time_cleanup
-
time_first_packet
),
//#6
"stream"
,
(
int
)(
timestamp
),
//#7
"stream"
,
(
int
)(
timestamp
-
basetime
),
//#7
// expect = time_cleanup - time_first_packet
// actual = stream
// delay = actual - expect
"delay"
,
(
int
)(
timestamp
-
(
time_cleanup
-
time_first_packet
)),
//#8
"delay"
,
(
int
)(
timestamp
-
basetime
-
(
time_cleanup
-
time_first_packet
)),
//#8
"publish_kbps"
,
(
int
)((
time_duration
<=
0
)
?
0
:
(
bytes_nsend
*
8
/
time_duration
)),
//#9
"play_kbps"
,
(
int
)((
time_duration
<=
0
)
?
0
:
(
bytes_nrecv
*
8
/
time_duration
)),
//#10
// unit in ms.
...
...
trunk/src/app/srs_app_config.hpp
查看文件 @
55b99c9
...
...
@@ -34,9 +34,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <srs_app_reload.hpp>
// default vhost for rtmp
#define RTMP_VHOST_DEFAULT "__defaultVhost__"
#define SRS_LOCALHOST "127.0.0.1"
#define SRS_CONF_DEFAULT_PID_FILE "./objs/srs.pid"
#define SRS_DEFAULT_CONF "conf/srs.conf"
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
55b99c9
...
...
@@ -263,7 +263,12 @@ int srs_connect_app(srs_rtmp_t rtmp)
Context
*
context
=
(
Context
*
)
rtmp
;
string
tcUrl
=
"rtmp://"
;
tcUrl
+=
context
->
vhost
;
// TODO: FIXME: extrace shared method
if
(
context
->
vhost
==
RTMP_VHOST_DEFAULT
)
{
tcUrl
+=
context
->
ip
;
}
else
{
tcUrl
+=
context
->
vhost
;
}
tcUrl
+=
":"
;
tcUrl
+=
context
->
port
;
tcUrl
+=
"/"
;
...
...
trunk/src/rtmp/srs_protocol_utility.hpp
查看文件 @
55b99c9
...
...
@@ -31,6 +31,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <string>
// default vhost for rtmp
#define RTMP_VHOST_DEFAULT "__defaultVhost__"
#define RTMP_DEFAULT_PORT "1935"
// the default chunk size for system.
...
...
请
注册
或
登录
后发表评论