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-01-17 13:23:30 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
04aa6f82962706f8d435703e8adb7abaf406a33f
04aa6f82
1 parent
cc22ca48
drop script data except the onMetaData packet.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
37 行增加
和
0 行删除
trunk/research/librtmp/srs_rtmp_dump.c
trunk/src/libs/srs_librtmp.cpp
trunk/src/libs/srs_librtmp.hpp
trunk/research/librtmp/srs_rtmp_dump.c
查看文件 @
04aa6f8
...
...
@@ -275,6 +275,13 @@ int main(int argc, char** argv)
// we only write some types of messages to flv file.
int
is_flv_msg
=
type
==
SRS_RTMP_TYPE_AUDIO
||
type
==
SRS_RTMP_TYPE_VIDEO
||
type
==
SRS_RTMP_TYPE_SCRIPT
;
// for script data, ignore except onMetaData
if
(
type
==
SRS_RTMP_TYPE_SCRIPT
)
{
if
(
!
srs_rtmp_is_onMetaData
(
type
,
data
,
size
))
{
is_flv_msg
=
0
;
}
}
if
(
flv
)
{
if
(
is_flv_msg
)
{
...
...
trunk/src/libs/srs_librtmp.cpp
查看文件 @
04aa6f8
...
...
@@ -1064,6 +1064,31 @@ int srs_rtmp_write_packet(srs_rtmp_t rtmp, char type, u_int32_t timestamp, char*
return
ret
;
}
srs_bool
srs_rtmp_is_onMetaData
(
char
type
,
char
*
data
,
int
size
)
{
int
ret
=
ERROR_SUCCESS
;
if
(
type
!=
SRS_RTMP_TYPE_SCRIPT
)
{
return
false
;
}
SrsStream
stream
;
if
((
ret
=
stream
.
initialize
(
data
,
size
))
!=
ERROR_SUCCESS
)
{
return
false
;
}
std
::
string
name
;
if
((
ret
=
srs_amf0_read_string
(
&
stream
,
name
))
!=
ERROR_SUCCESS
)
{
return
false
;
}
if
(
name
!=
"onMetaData"
)
{
return
false
;
}
return
true
;
}
/**
* directly write a audio frame.
*/
...
...
trunk/src/libs/srs_librtmp.hpp
查看文件 @
04aa6f8
...
...
@@ -264,6 +264,11 @@ extern int srs_rtmp_write_packet(srs_rtmp_t rtmp,
char
type
,
u_int32_t
timestamp
,
char
*
data
,
int
size
);
/**
* whether type is script data and the data is onMetaData.
*/
extern
srs_bool
srs_rtmp_is_onMetaData
(
char
type
,
char
*
data
,
int
size
);
/*************************************************************
**************************************************************
* audio raw codec
...
...
请
注册
或
登录
后发表评论