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
2013-10-19 18:27:52 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a638ebd1c63a428f2092c4c32d1e1c57fd4d9e27
a638ebd1
1 parent
63bf9e11
decode the amf0 command message: connect.
显示空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
16 行增加
和
0 行删除
trunk/src/core/srs_core_amf0.cpp
trunk/src/core/srs_core_stream.hpp
trunk/src/core/srs_core_amf0.cpp
查看文件 @
a638ebd
...
...
@@ -55,22 +55,28 @@ std::string srs_amf0_read_string(SrsStream* stream)
// marker
if
(
!
stream
->
require
(
1
))
{
srs_warn
(
"amf0 read string marker failed"
);
return
str
;
}
char
marker
=
stream
->
read_char
();
if
(
marker
!=
RTMP_AMF0_String
)
{
srs_warn
(
"amf0 check string marker failed. marker=%#x, required=%#x"
,
marker
,
RTMP_AMF0_String
);
return
str
;
}
srs_verbose
(
"amf0 read string marker success"
);
// len
if
(
!
stream
->
require
(
2
))
{
srs_warn
(
"amf0 read string length failed"
);
return
str
;
}
int16_t
len
=
stream
->
read_2bytes
();
srs_verbose
(
"amf0 read string length success. len=%d"
,
len
);
// data
if
(
!
stream
->
require
(
len
))
{
srs_warn
(
"amf0 read string data failed"
);
return
str
;
}
str
=
stream
->
read_string
(
len
);
...
...
@@ -85,6 +91,7 @@ std::string srs_amf0_read_string(SrsStream* stream)
return
""
;
}
}
srs_verbose
(
"amf0 read string data success. str=%s"
,
str
.
c_str
());
return
str
;
}
...
...
trunk/src/core/srs_core_stream.hpp
查看文件 @
a638ebd
...
...
@@ -66,8 +66,17 @@ public:
*/
virtual
bool
require
(
int
required_size
);
public
:
/**
* get 1bytes char from stream.
*/
virtual
char
read_char
();
/**
* get 2bytes int from stream.
*/
virtual
int16_t
read_2bytes
();
/**
* get string from stream, length specifies by param len.
*/
virtual
std
::
string
read_string
(
int
len
);
};
...
...
请
注册
或
登录
后发表评论