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-05-08 07:04:31 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ac13817aae23af86ddb6ebb1207cc1cba9b0f3fe
ac13817a
1 parent
0fd23c85
update donation
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
27 行增加
和
13 行删除
DONATIONS.txt
trunk/research/librtmp/srs_rtmp_dump.c
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.hpp
DONATIONS.txt
查看文件 @
ac13817
...
...
@@ -15,6 +15,7 @@ RMB 500-999
* [2015-04-11 12:48] 丁一
RMB 100-499
* [2015-05-07 23:56] 余世兵
* [2015-05-07 11:34] 王隆萼
* [2015-05-06 22:04] 姜庆东
* [2015-04-10 19:52] 阳成飞
...
...
trunk/research/librtmp/srs_rtmp_dump.c
查看文件 @
ac13817
...
...
@@ -256,6 +256,7 @@ int main(int argc, char** argv)
}
}
u_int32_t
pre_timestamp
=
0
;
for
(;;)
{
int
size
;
char
type
;
...
...
@@ -267,10 +268,11 @@ int main(int argc, char** argv)
goto
rtmp_destroy
;
}
if
(
srs_human_print_rtmp_packet
(
type
,
timestamp
,
data
,
size
)
!=
0
)
{
if
(
srs_human_print_rtmp_packet
2
(
type
,
timestamp
,
data
,
size
,
pre_timestamp
)
!=
0
)
{
srs_human_trace
(
"print rtmp packet failed."
);
goto
rtmp_destroy
;
}
pre_timestamp
=
timestamp
;
// we only write some types of messages to flv file.
int
is_flv_msg
=
type
==
SRS_RTMP_TYPE_AUDIO
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
ac13817
...
...
@@ -2313,29 +2313,39 @@ const char* srs_human_flv_audio_aac_packet_type2string(char aac_packet_type)
return
unknown
;
}
int
srs_human_print_rtmp_packet
(
char
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
)
{
return
srs_human_print_rtmp_packet2
(
type
,
timestamp
,
data
,
size
,
0
);
}
int
srs_human_print_rtmp_packet2
(
char
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
,
u_int32_t
pre_timestamp
)
{
int
ret
=
ERROR_SUCCESS
;
int
diff
=
0
;
if
(
pre_timestamp
>
0
)
{
diff
=
(
int
)
timestamp
-
(
int
)
pre_timestamp
;
}
u_int32_t
pts
;
if
(
srs_utils_parse_timestamp
(
timestamp
,
type
,
data
,
size
,
&
pts
)
!=
0
)
{
srs_human_trace
(
"Rtmp packet type=%s, dts=%d, size=%d, DecodeError"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
size
srs_human_trace
(
"Rtmp packet type=%s, dts=%d, diff=%d, size=%d, DecodeError"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
diff
,
size
);
return
ret
;
}
if
(
type
==
SRS_RTMP_TYPE_VIDEO
)
{
srs_human_trace
(
"Video packet type=%s, dts=%d, pts=%d, size=%d, %s(%s,%s)"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
pts
,
size
,
srs_human_trace
(
"Video packet type=%s, dts=%d, pts=%d, diff=%d, size=%d, %s(%s,%s)"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
pts
,
diff
,
size
,
srs_human_flv_video_codec_id2string
(
srs_utils_flv_video_codec_id
(
data
,
size
)),
srs_human_flv_video_avc_packet_type2string
(
srs_utils_flv_video_avc_packet_type
(
data
,
size
)),
srs_human_flv_video_frame_type2string
(
srs_utils_flv_video_frame_type
(
data
,
size
))
);
}
else
if
(
type
==
SRS_RTMP_TYPE_AUDIO
)
{
srs_human_trace
(
"Audio packet type=%s, dts=%d, pts=%d, size=%d, %s(%s,%s,%s,%s)"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
pts
,
size
,
srs_human_trace
(
"Audio packet type=%s, dts=%d, pts=%d, diff=%d, size=%d, %s(%s,%s,%s,%s)"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
pts
,
diff
,
size
,
srs_human_flv_audio_sound_format2string
(
srs_utils_flv_audio_sound_format
(
data
,
size
)),
srs_human_flv_audio_sound_rate2string
(
srs_utils_flv_audio_sound_rate
(
data
,
size
)),
srs_human_flv_audio_sound_size2string
(
srs_utils_flv_audio_sound_size
(
data
,
size
)),
...
...
@@ -2343,8 +2353,8 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
srs_human_flv_audio_aac_packet_type2string
(
srs_utils_flv_audio_aac_packet_type
(
data
,
size
))
);
}
else
if
(
type
==
SRS_RTMP_TYPE_SCRIPT
)
{
srs_human_verbose
(
"Data packet type=%s, time=%d, size=%d"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
size
);
srs_human_verbose
(
"Data packet type=%s, time=%d, diff=%d, size=%d"
,
srs_human_flv_tag_type2string
(
type
),
timestamp
,
diff
,
size
);
int
nparsed
=
0
;
while
(
nparsed
<
size
)
{
int
nb_parsed_this
=
0
;
...
...
@@ -2360,8 +2370,8 @@ int srs_human_print_rtmp_packet(char type, u_int32_t timestamp, char* data, int
srs_freep
(
amf0_str
);
}
}
else
{
srs_human_trace
(
"Rtmp packet type=%#x, dts=%d, pts=%d, size=%d"
,
type
,
timestamp
,
pts
,
size
);
srs_human_trace
(
"Rtmp packet type=%#x, dts=%d, pts=%d, diff=%d, size=%d"
,
type
,
timestamp
,
pts
,
diff
,
size
);
}
return
ret
;
...
...
trunk/src/libs/srs_librtmp.hpp
查看文件 @
ac13817
...
...
@@ -901,8 +901,9 @@ extern const char* srs_human_flv_audio_aac_packet_type2string(char aac_packet_ty
* print the rtmp packet, use srs_human_trace/srs_human_verbose for packet,
* and use srs_human_raw for script data body.
* @return an error code for parse the timetstamp to dts and pts.
*/
*/
extern
int
srs_human_print_rtmp_packet
(
char
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
);
extern
int
srs_human_print_rtmp_packet2
(
char
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
,
u_int32_t
pre_timestamp
);
// log to console, for use srs-librtmp application.
extern
const
char
*
srs_human_format_time
();
...
...
请
注册
或
登录
后发表评论