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-22 12:27:22 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e598616e14e4875bc5c7fcaf3ad981e7c992753e
e598616e
1 parent
99aa8bc0
fix objectEncoding bug, default to AMF0, change to AMF3 if required.
隐藏空白字符变更
内嵌
并排对比
正在显示
3 个修改的文件
包含
23 行增加
和
5 行删除
trunk/src/core/srs_core_client.cpp
trunk/src/core/srs_core_rtmp.cpp
trunk/src/core/srs_core_rtmp.hpp
trunk/src/core/srs_core_client.cpp
查看文件 @
e598616
...
...
@@ -96,7 +96,7 @@ int SrsClient::do_cycle()
}
srs_verbose
(
"set peer bandwidth success"
);
if
((
ret
=
rtmp
->
response_connect_app
())
!=
ERROR_SUCCESS
)
{
if
((
ret
=
rtmp
->
response_connect_app
(
req
))
!=
ERROR_SUCCESS
)
{
srs_error
(
"response connect app failed. ret=%d"
,
ret
);
return
ret
;
}
...
...
trunk/src/core/srs_core_rtmp.cpp
查看文件 @
e598616
...
...
@@ -34,7 +34,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* the signature for packets to client.
*/
#define RTMP_SIG_FMS_VER "3,5,3,888"
#define RTMP_SIG_AMF0_VER
3
#define RTMP_SIG_AMF0_VER
0
#define RTMP_SIG_SRS_NAME "srs(simple rtmp server)"
#define RTMP_SIG_SRS_URL "https://github.com/winlinvip/simple-rtmp-server"
#define RTMP_SIG_SRS_VERSION "0.1"
...
...
@@ -53,6 +53,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define StatusCodeStreamStart "NetStream.Play.Start"
#define StatusCodeDataStart "NetStream.Data.Start"
SrsRequest
::
SrsRequest
()
{
objectEncoding
=
RTMP_SIG_AMF0_VER
;
}
SrsRequest
::~
SrsRequest
()
{
}
int
SrsRequest
::
discovery_app
()
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -183,6 +192,11 @@ int SrsRtmp::connect_app(SrsRequest* req)
if
((
prop
=
pkt
->
command_object
->
ensure_property_string
(
"swfUrl"
))
!=
NULL
)
{
req
->
swfUrl
=
srs_amf0_convert
<
SrsAmf0String
>
(
prop
)
->
value
;
}
if
((
prop
=
pkt
->
command_object
->
ensure_property_string
(
"objectEncoding"
))
!=
NULL
)
{
req
->
objectEncoding
=
srs_amf0_convert
<
SrsAmf0Number
>
(
prop
)
->
value
;
}
srs_info
(
"get connect app message params success."
);
return
req
->
discovery_app
();
...
...
@@ -228,7 +242,7 @@ int SrsRtmp::set_peer_bandwidth(int bandwidth, int type)
return
ret
;
}
int
SrsRtmp
::
response_connect_app
()
int
SrsRtmp
::
response_connect_app
(
SrsRequest
*
req
)
{
int
ret
=
ERROR_SUCCESS
;
...
...
@@ -242,7 +256,7 @@ int SrsRtmp::response_connect_app()
pkt
->
info
->
properties
[
StatusLevel
]
=
new
SrsAmf0String
(
StatusLevelStatus
);
pkt
->
info
->
properties
[
StatusCode
]
=
new
SrsAmf0String
(
StatusCodeConnectSuccess
);
pkt
->
info
->
properties
[
StatusDescription
]
=
new
SrsAmf0String
(
"Connection succeeded"
);
pkt
->
info
->
properties
[
"objectEncoding"
]
=
new
SrsAmf0Number
(
RTMP_SIG_AMF0_VER
);
pkt
->
info
->
properties
[
"objectEncoding"
]
=
new
SrsAmf0Number
(
req
->
objectEncoding
);
SrsASrsAmf0EcmaArray
*
data
=
new
SrsASrsAmf0EcmaArray
();
pkt
->
info
->
properties
[
"data"
]
=
data
;
...
...
trunk/src/core/srs_core_rtmp.hpp
查看文件 @
e598616
...
...
@@ -46,6 +46,7 @@ struct SrsRequest
std
::
string
tcUrl
;
std
::
string
pageUrl
;
std
::
string
swfUrl
;
double
objectEncoding
;
std
::
string
schema
;
std
::
string
vhost
;
...
...
@@ -53,6 +54,9 @@ struct SrsRequest
std
::
string
app
;
std
::
string
stream
;
SrsRequest
();
virtual
~
SrsRequest
();
/**
* disconvery vhost/app from tcUrl.
*/
...
...
@@ -91,7 +95,7 @@ public:
* using the Limit type field.
*/
virtual
int
set_peer_bandwidth
(
int
bandwidth
,
int
type
);
virtual
int
response_connect_app
();
virtual
int
response_connect_app
(
SrsRequest
*
req
);
virtual
int
on_bw_done
();
/**
* recv some message to identify the client.
...
...
请
注册
或
登录
后发表评论