Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
a078010f
Commit
a078010f
authored
Jul 02, 2018
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化参数以及参数命名
parent
bca084d0
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
src/Device/PlayerProxy.cpp
+1
-1
src/Rtsp/RtspPlayer.cpp
+7
-7
没有找到文件。
src/Device/PlayerProxy.cpp
查看文件 @
a078010f
...
...
@@ -66,7 +66,7 @@ static uint8_t s_mute_adts[] = {0xff, 0xf1, 0x6c, 0x40, 0x2d, 0x3f, 0xfc, 0x00,
#define MUTE_ADTS_SAMPLE_RATE 8000
#define MUTE_ADTS_DATA s_mute_adts
#define MUTE_ADTS_DATA_LEN sizeof(s_mute_adts)
#define MUTE_ADTS_DATA_MS 1
2
0
#define MUTE_ADTS_DATA_MS 1
3
0
PlayerProxy
::
PlayerProxy
(
const
char
*
strVhost
,
const
char
*
strApp
,
...
...
src/Rtsp/RtspPlayer.cpp
查看文件 @
a078010f
...
...
@@ -50,7 +50,7 @@ namespace Rtsp {
onRecvRTP_l(it->second, trackidx); \
m_amapRtpSort[trackidx].erase(it);
const
char
k
Md5Nonce
[]
=
"
md5_nonce"
;
const
char
k
RtspMd5Nonce
[]
=
"rtsp_
md5_nonce"
;
const
char
kRtspRealm
[]
=
"rtsp_realm"
;
RtspPlayer
::
RtspPlayer
(
void
){
...
...
@@ -69,7 +69,7 @@ void RtspPlayer::teardown(){
shutdown
();
}
erase
(
kMd5Nonce
);
erase
(
k
Rtsp
Md5Nonce
);
erase
(
kRtspRealm
);
m_uiTrackCnt
=
0
;
m_onHandshake
=
nullptr
;
...
...
@@ -233,12 +233,12 @@ bool RtspPlayer::handleAuthenticationFailure(const string ¶msStr) {
if
(
sscanf
(
paramsStr
.
data
(),
"Digest realm=
\"
%[^
\"
]
\"
, nonce=
\"
%[^
\"
]
\"
, stale=%[a-zA-Z]"
,
realm
,
nonce
,
stale
)
==
3
)
{
(
*
this
)[
kRtspRealm
]
=
realm
;
(
*
this
)[
kMd5Nonce
]
=
nonce
;
(
*
this
)[
k
Rtsp
Md5Nonce
]
=
nonce
;
return
true
;
}
if
(
sscanf
(
paramsStr
.
data
(),
"Digest realm=
\"
%[^
\"
]
\"
, nonce=
\"
%[^
\"
]
\"
"
,
realm
,
nonce
)
==
2
)
{
(
*
this
)[
kRtspRealm
]
=
realm
;
(
*
this
)[
kMd5Nonce
]
=
nonce
;
(
*
this
)[
k
Rtsp
Md5Nonce
]
=
nonce
;
return
true
;
}
if
(
sscanf
(
paramsStr
.
data
(),
"Basic realm=
\"
%[^
\"
]
\"
"
,
realm
)
==
1
)
{
...
...
@@ -711,7 +711,7 @@ bool RtspPlayer::sendRtspRequest(const string &cmd, const string &url,const StrC
}
if
(
!
(
*
this
)[
kRtspRealm
].
empty
()
&&
!
(
*
this
)[
PlayerBase
::
kRtspUser
].
empty
()){
if
(
!
(
*
this
)[
kMd5Nonce
].
empty
()){
if
(
!
(
*
this
)[
k
Rtsp
Md5Nonce
].
empty
()){
//MD5认证
/*
response计算方法如下:
...
...
@@ -725,12 +725,12 @@ bool RtspPlayer::sendRtspRequest(const string &cmd, const string &url,const StrC
if
(
!
(
*
this
)[
PlayerBase
::
kRtspPwdIsMD5
].
as
<
bool
>
()){
encrypted_pwd
=
MD5
((
*
this
)[
PlayerBase
::
kRtspUser
]
+
":"
+
(
*
this
)[
kRtspRealm
]
+
":"
+
encrypted_pwd
).
hexdigest
();
}
auto
response
=
MD5
(
encrypted_pwd
+
":"
+
(
*
this
)[
kMd5Nonce
]
+
":"
+
MD5
(
cmd
+
":"
+
url
).
hexdigest
()).
hexdigest
();
auto
response
=
MD5
(
encrypted_pwd
+
":"
+
(
*
this
)[
k
Rtsp
Md5Nonce
]
+
":"
+
MD5
(
cmd
+
":"
+
url
).
hexdigest
()).
hexdigest
();
_StrPrinter
printer
;
printer
<<
"Digest "
;
printer
<<
"username=
\"
"
<<
(
*
this
)[
PlayerBase
::
kRtspUser
]
<<
"
\"
, "
;
printer
<<
"realm=
\"
"
<<
(
*
this
)[
kRtspRealm
]
<<
"
\"
, "
;
printer
<<
"nonce=
\"
"
<<
(
*
this
)[
kMd5Nonce
]
<<
"
\"
, "
;
printer
<<
"nonce=
\"
"
<<
(
*
this
)[
k
Rtsp
Md5Nonce
]
<<
"
\"
, "
;
printer
<<
"uri=
\"
"
<<
url
<<
"
\"
, "
;
printer
<<
"response=
\"
"
<<
response
<<
"
\"
"
;
header
.
emplace
(
"Authorization"
,
printer
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论