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
ad25ea18
Commit
ad25ea18
authored
Nov 27, 2018
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
858d2996
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
16 行增加
和
16 行删除
+16
-16
ZLToolKit
+1
-1
src/Extension/Factory.cpp
+3
-3
src/Http/HttpClient.cpp
+2
-2
src/Http/HttpSession.cpp
+5
-5
src/Player/MediaPlayer.cpp
+1
-1
src/Player/PlayerBase.cpp
+2
-2
src/Rtsp/Rtsp.h
+1
-1
src/Rtsp/RtspSession.cpp
+1
-1
没有找到文件。
ZLToolKit
@
c632732a
Subproject commit
95aadf51026c37e94d15b3d3a06b9df842d881e1
Subproject commit
c632732a699bf1b6d12996235a09cd67fab21ede
src/Extension/Factory.cpp
查看文件 @
ad25ea18
...
...
@@ -81,7 +81,7 @@ Sdp::Ptr Factory::getSdpByTrack(const Track::Ptr &track) {
Track
::
Ptr
Factory
::
getTrackBySdp
(
const
SdpTrack
::
Ptr
&
track
)
{
if
(
toolkit
::
strcasecmp
(
track
->
_codec
.
data
(),
"mpeg4-generic"
)
==
0
)
{
if
(
strcasecmp
(
track
->
_codec
.
data
(),
"mpeg4-generic"
)
==
0
)
{
string
aac_cfg_str
=
FindField
(
track
->
_fmtp
.
c_str
(),
"config="
,
nullptr
);
if
(
aac_cfg_str
.
size
()
!=
4
)
{
aac_cfg_str
=
FindField
(
track
->
_fmtp
.
c_str
(),
"config="
,
";"
);
...
...
@@ -105,7 +105,7 @@ Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) {
return
std
::
make_shared
<
AACTrack
>
(
aac_cfg
);
}
if
(
toolkit
::
strcasecmp
(
track
->
_codec
.
data
(),
"h264"
)
==
0
)
{
if
(
strcasecmp
(
track
->
_codec
.
data
(),
"h264"
)
==
0
)
{
string
sps_pps
=
FindField
(
track
->
_fmtp
.
c_str
(),
"sprop-parameter-sets="
,
nullptr
);
if
(
sps_pps
.
empty
()){
return
std
::
make_shared
<
H264Track
>
();
...
...
@@ -121,7 +121,7 @@ Track::Ptr Factory::getTrackBySdp(const SdpTrack::Ptr &track) {
return
std
::
make_shared
<
H264Track
>
(
sps
,
pps
,
0
,
0
);
}
if
(
toolkit
::
strcasecmp
(
track
->
_codec
.
data
(),
"h265"
)
==
0
)
{
if
(
strcasecmp
(
track
->
_codec
.
data
(),
"h265"
)
==
0
)
{
//a=fmtp:96 sprop-sps=QgEBAWAAAAMAsAAAAwAAAwBdoAKAgC0WNrkky/AIAAADAAgAAAMBlQg=; sprop-pps=RAHA8vA8kAA=
int
pt
;
char
sprop_vps
[
128
]
=
{
0
},
sprop_sps
[
128
]
=
{
0
},
sprop_pps
[
128
]
=
{
0
};
...
...
src/Http/HttpClient.cpp
查看文件 @
ad25ea18
...
...
@@ -41,10 +41,10 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
auto
protocol
=
FindField
(
strUrl
.
data
(),
NULL
,
"://"
);
uint16_t
defaultPort
;
bool
isHttps
;
if
(
toolkit
::
strcasecmp
(
protocol
.
data
(),
"http"
)
==
0
)
{
if
(
strcasecmp
(
protocol
.
data
(),
"http"
)
==
0
)
{
defaultPort
=
80
;
isHttps
=
false
;
}
else
if
(
toolkit
::
strcasecmp
(
protocol
.
data
(),
"https"
)
==
0
)
{
}
else
if
(
strcasecmp
(
protocol
.
data
(),
"https"
)
==
0
)
{
defaultPort
=
443
;
isHttps
=
true
;
}
else
{
...
...
src/Http/HttpSession.cpp
查看文件 @
ad25ea18
...
...
@@ -208,7 +208,7 @@ inline bool HttpSession::checkLiveFlvStream(){
//未找到".flv"后缀
return
false
;
}
if
(
toolkit
::
strcasecmp
(
pos
,
".flv"
)
!=
0
){
if
(
strcasecmp
(
pos
,
".flv"
)
!=
0
){
//未找到".flv"后缀
return
false
;
}
...
...
@@ -298,7 +298,7 @@ inline bool HttpSession::Handle_Req_GET(int64_t &content_len) {
/////////////HTTP连接是否需要被关闭////////////////
GET_CONFIG_AND_REGISTER
(
uint32_t
,
reqCnt
,
Http
::
kMaxReqCount
);
bool
bClose
=
(
toolkit
::
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
reqCnt
);
bool
bClose
=
(
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
reqCnt
);
//访问的是文件夹
if
(
strFile
.
back
()
==
'/'
)
{
//生成文件夹菜单索引
...
...
@@ -551,7 +551,7 @@ string HttpSession::urlDecode(const string &str){
auto
ret
=
strCoding
::
UrlUTF8Decode
(
str
);
#ifdef _WIN32
GET_CONFIG_AND_REGISTER
(
string
,
charSet
,
Http
::
kCharSet
);
bool
isGb2312
=
!
toolkit
::
strcasecmp
(
charSet
.
data
(),
"gb2312"
);
bool
isGb2312
=
!
strcasecmp
(
charSet
.
data
(),
"gb2312"
);
if
(
isGb2312
)
{
ret
=
strCoding
::
UTF8ToGB2312
(
ret
);
}
...
...
@@ -570,7 +570,7 @@ inline bool HttpSession::emitHttpEvent(bool doInvoke){
///////////////////是否断开本链接///////////////////////
GET_CONFIG_AND_REGISTER
(
uint32_t
,
reqCnt
,
Http
::
kMaxReqCount
);
bool
bClose
=
(
toolkit
::
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
reqCnt
);
bool
bClose
=
(
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
reqCnt
);
auto
Origin
=
_parser
[
"Origin"
];
/////////////////////异步回复Invoker///////////////////////////////
weak_ptr
<
HttpSession
>
weakSelf
=
dynamic_pointer_cast
<
HttpSession
>
(
shared_from_this
());
...
...
@@ -637,7 +637,7 @@ inline bool HttpSession::Handle_Req_POST(int64_t &content_len) {
content_len
=
-
1
;
auto
parserCopy
=
_parser
;
std
::
shared_ptr
<
uint64_t
>
recvedContentLen
=
std
::
make_shared
<
uint64_t
>
(
0
);
bool
bClose
=
(
toolkit
::
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
maxReqCnt
);
bool
bClose
=
(
strcasecmp
(
_parser
[
"Connection"
].
data
(),
"close"
)
==
0
)
||
(
++
_iReqCnt
>
maxReqCnt
);
_contentCallBack
=
[
this
,
parserCopy
,
totalContentLen
,
recvedContentLen
,
bClose
](
const
char
*
data
,
uint64_t
len
){
*
(
recvedContentLen
)
+=
len
;
...
...
src/Player/MediaPlayer.cpp
查看文件 @
ad25ea18
...
...
@@ -39,7 +39,7 @@ MediaPlayer::~MediaPlayer() {
}
void
MediaPlayer
::
play
(
const
char
*
strUrl
)
{
string
strPrefix
=
FindField
(
strUrl
,
NULL
,
"://"
);
if
((
toolkit
::
strcasecmp
(
_strPrefix
.
data
(),
strPrefix
.
data
())
!=
0
)
||
strPrefix
.
empty
())
{
if
((
strcasecmp
(
_strPrefix
.
data
(),
strPrefix
.
data
())
!=
0
)
||
strPrefix
.
empty
())
{
//协议切换
_strPrefix
=
strPrefix
;
_parser
=
PlayerBase
::
createPlayer
(
strUrl
);
...
...
src/Player/PlayerBase.cpp
查看文件 @
ad25ea18
...
...
@@ -48,10 +48,10 @@ PlayerBase::Ptr PlayerBase::createPlayer(const char* strUrl) {
ptr
->
teardown
();
};
string
prefix
=
FindField
(
strUrl
,
NULL
,
"://"
);
if
(
toolkit
::
strcasecmp
(
"rtsp"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtsp"
,
prefix
.
data
())
==
0
)
{
return
PlayerBase
::
Ptr
(
new
RtspPlayerImp
(),
releasePlayer
);
}
if
(
toolkit
::
strcasecmp
(
"rtmp"
,
prefix
.
data
())
==
0
)
{
if
(
strcasecmp
(
"rtmp"
,
prefix
.
data
())
==
0
)
{
return
PlayerBase
::
Ptr
(
new
RtmpPlayerImp
(),
releasePlayer
);
}
return
PlayerBase
::
Ptr
(
new
RtspPlayerImp
(),
releasePlayer
);
...
...
src/Rtsp/Rtsp.h
查看文件 @
ad25ea18
...
...
@@ -101,7 +101,7 @@ string FindField(const char* buf, const char* start, const char *end,int bufSize
struct
StrCaseCompare
{
bool
operator
()(
const
string
&
__x
,
const
string
&
__y
)
const
{
return
toolkit
::
strcasecmp
(
__x
.
data
(),
__y
.
data
())
<
0
;}
{
return
strcasecmp
(
__x
.
data
(),
__y
.
data
())
<
0
;}
};
typedef
map
<
string
,
string
,
StrCaseCompare
>
StrCaseMap
;
...
...
src/Rtsp/RtspSession.cpp
查看文件 @
ad25ea18
...
...
@@ -444,7 +444,7 @@ void RtspSession::onAuthDigest(const weak_ptr<RtspSession> &weakSelf,const strin
}
auto
good_response
=
MD5
(
encrypted_pwd
+
":"
+
nonce
+
":"
+
MD5
(
string
(
"DESCRIBE"
)
+
":"
+
uri
).
hexdigest
()).
hexdigest
();
if
(
toolkit
::
strcasecmp
(
good_response
.
data
(),
response
.
data
())
==
0
){
if
(
strcasecmp
(
good_response
.
data
(),
response
.
data
())
==
0
){
//认证成功!md5不区分大小写
onAuthSuccess
(
weakSelf
);
TraceL
<<
"onAuthSuccess"
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论