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
f5f58196
Commit
f5f58196
authored
Oct 16, 2021
by
ziyue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改常量命名
parent
8769ea83
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
20 行增加
和
19 行删除
+20
-19
src/Common/config.cpp
+1
-1
src/Common/macros.cpp
+3
-2
src/Common/macros.h
+1
-1
src/Http/HttpClient.cpp
+1
-1
src/Http/HttpSession.cpp
+1
-1
src/Rtmp/Rtmp.h
+1
-1
src/Rtmp/RtmpMediaSource.h
+1
-1
src/Rtsp/Rtsp.h
+1
-1
src/Rtsp/RtspPlayer.cpp
+2
-2
src/Rtsp/RtspPusher.cpp
+2
-2
src/Rtsp/RtspSession.cpp
+2
-2
src/Shell/ShellSession.cpp
+4
-4
没有找到文件。
src/Common/config.cpp
查看文件 @
f5f58196
...
...
@@ -138,7 +138,7 @@ onceToken token([](){
"<body bgcolor=
\"
white
\"
>"
"<center><h1>您访问的资源不存在!</h1></center>"
"<hr><center>"
<<
SERVER_NAME
<<
kServerName
<<
"</center>"
"</body>"
"</html>"
...
...
src/Common/macros.cpp
查看文件 @
f5f58196
...
...
@@ -37,9 +37,9 @@ void printArgs(std::ostream &out) {}
//请遵循MIT协议,勿修改服务器声明
#if !defined(ENABLE_VERSION)
const
char
SERVER_NAME
[]
=
"ZLMediaKit-6.0(build in "
__DATE__
" "
__TIME__
")"
;
const
char
kServerName
[]
=
"ZLMediaKit-6.0(build in "
__DATE__
" "
__TIME__
")"
;
#else
const
char
SERVER_NAME
[]
=
"ZLMediaKit(git hash:"
COMMIT_HASH
",branch:"
BRANCH_NAME
",build time:"
__DATE__
" "
__TIME__
")"
;
const
char
kServerName
[]
=
"ZLMediaKit(git hash:"
COMMIT_HASH
",branch:"
BRANCH_NAME
",build time:"
__DATE__
" "
__TIME__
")"
;
#endif
}
//
namespace
mediakit
\ No newline at end of file
src/Common/macros.h
查看文件 @
f5f58196
...
...
@@ -74,7 +74,7 @@ extern void Assert_Throw(int failed, const char *exp, const char *func, const ch
namespace
mediakit
{
extern
const
char
SERVER_NAME
[];
extern
const
char
kServerName
[];
void
printArgs
(
std
::
ostream
&
out
);
...
...
src/Http/HttpClient.cpp
查看文件 @
f5f58196
...
...
@@ -49,7 +49,7 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
host
=
FindField
(
host
.
data
(),
NULL
,
":"
);
}
_header
.
emplace
(
"Host"
,
host_header
);
_header
.
emplace
(
"Tools"
,
SERVER_NAME
);
_header
.
emplace
(
"Tools"
,
kServerName
);
_header
.
emplace
(
"Connection"
,
"keep-alive"
);
_header
.
emplace
(
"Accept"
,
"*/*"
);
_header
.
emplace
(
"Accept-Language"
,
"zh-CN,zh;q=0.8"
);
...
...
src/Http/HttpSession.cpp
查看文件 @
f5f58196
...
...
@@ -537,7 +537,7 @@ void HttpSession::sendResponse(int code,
HttpSession
::
KeyValue
&
headerOut
=
const_cast
<
HttpSession
::
KeyValue
&>
(
header
);
headerOut
.
emplace
(
kDate
,
dateStr
());
headerOut
.
emplace
(
kServer
,
SERVER_NAME
);
headerOut
.
emplace
(
kServer
,
kServerName
);
headerOut
.
emplace
(
kConnection
,
bClose
?
"close"
:
"keep-alive"
);
if
(
!
bClose
){
string
keepAliveString
=
"timeout="
;
...
...
src/Rtmp/Rtmp.h
查看文件 @
f5f58196
...
...
@@ -306,7 +306,7 @@ public:
const
map
<
string
,
string
>
&
header
=
map
<
string
,
string
>
()){
_metadata
.
set
(
"duration"
,
dur_sec
);
_metadata
.
set
(
"fileSize"
,
(
int
)
fileSize
);
_metadata
.
set
(
"server"
,
SERVER_NAME
);
_metadata
.
set
(
"server"
,
kServerName
);
for
(
auto
&
pr
:
header
){
_metadata
.
set
(
pr
.
first
,
pr
.
second
);
}
...
...
src/Rtmp/RtmpMediaSource.h
查看文件 @
f5f58196
...
...
@@ -101,7 +101,7 @@ public:
*/
virtual
void
setMetaData
(
const
AMFValue
&
metadata
)
{
_metadata
=
metadata
;
_metadata
.
set
(
"server"
,
SERVER_NAME
);
_metadata
.
set
(
"server"
,
kServerName
);
_have_video
=
_metadata
[
"videocodecid"
];
_have_audio
=
_metadata
[
"audiocodecid"
];
if
(
_ring
)
{
...
...
src/Rtsp/Rtsp.h
查看文件 @
f5f58196
...
...
@@ -346,7 +346,7 @@ public:
}
}
else
{
_printer
<<
"o=- 0 0 IN IP4 0.0.0.0
\r\n
"
;
_printer
<<
"s=Streamed by "
<<
SERVER_NAME
<<
"
\r\n
"
;
_printer
<<
"s=Streamed by "
<<
kServerName
<<
"
\r\n
"
;
_printer
<<
"c=IN IP4 0.0.0.0
\r\n
"
;
_printer
<<
"t=0 0
\r\n
"
;
}
...
...
src/Rtsp/RtspPlayer.cpp
查看文件 @
f5f58196
...
...
@@ -551,7 +551,7 @@ void RtspPlayer::sendRtspRequest(const string &cmd, const string &url, const std
void
RtspPlayer
::
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
StrCaseMap
&
header_const
)
{
auto
header
=
header_const
;
header
.
emplace
(
"CSeq"
,
StrPrinter
<<
_cseq_send
++
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
);
header
.
emplace
(
"User-Agent"
,
kServerName
);
if
(
!
_session_id
.
empty
()){
header
.
emplace
(
"Session"
,
_session_id
);
...
...
@@ -637,7 +637,7 @@ void RtspPlayer::onBeforeRtpSorted(const RtpPacket::Ptr &rtp, int track_idx){
auto
ssrc
=
rtp
->
getSSRC
();
auto
rtcp
=
rtcp_ctx
->
createRtcpRR
(
ssrc
+
1
,
ssrc
);
auto
rtcp_sdes
=
RtcpSdes
::
create
({
SERVER_NAME
});
auto
rtcp_sdes
=
RtcpSdes
::
create
({
kServerName
});
rtcp_sdes
->
chunks
.
type
=
(
uint8_t
)
SdesType
::
RTCP_SDES_CNAME
;
rtcp_sdes
->
chunks
.
ssrc
=
htonl
(
ssrc
);
send_rtcp
(
this
,
track_idx
,
std
::
move
(
rtcp
));
...
...
src/Rtsp/RtspPusher.cpp
查看文件 @
f5f58196
...
...
@@ -377,7 +377,7 @@ void RtspPusher::updateRtcpContext(const RtpPacket::Ptr &rtp){
auto
ssrc
=
rtp
->
getSSRC
();
auto
rtcp
=
rtcp_ctx
->
createRtcpSR
(
ssrc
+
1
);
auto
rtcp_sdes
=
RtcpSdes
::
create
({
SERVER_NAME
});
auto
rtcp_sdes
=
RtcpSdes
::
create
({
kServerName
});
rtcp_sdes
->
chunks
.
type
=
(
uint8_t
)
SdesType
::
RTCP_SDES_CNAME
;
rtcp_sdes
->
chunks
.
ssrc
=
htonl
(
ssrc
);
send_rtcp
(
this
,
track_index
,
std
::
move
(
rtcp
));
...
...
@@ -511,7 +511,7 @@ void RtspPusher::sendRtspRequest(const string &cmd, const string &url, const std
void
RtspPusher
::
sendRtspRequest
(
const
string
&
cmd
,
const
string
&
url
,
const
StrCaseMap
&
header_const
,
const
string
&
sdp
)
{
auto
header
=
header_const
;
header
.
emplace
(
"CSeq"
,
StrPrinter
<<
_cseq
++
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
);
header
.
emplace
(
"User-Agent"
,
kServerName
);
if
(
!
_session_id
.
empty
())
{
header
.
emplace
(
"Session"
,
_session_id
);
...
...
src/Rtsp/RtspSession.cpp
查看文件 @
f5f58196
...
...
@@ -1028,7 +1028,7 @@ bool RtspSession::sendRtspResponse(const string &res_code, const StrCaseMap &hea
header
.
emplace
(
"Session"
,
_sessionid
);
}
header
.
emplace
(
"Server"
,
SERVER_NAME
);
header
.
emplace
(
"Server"
,
kServerName
);
header
.
emplace
(
"Date"
,
dateStr
());
if
(
!
sdp
.
empty
()){
...
...
@@ -1163,7 +1163,7 @@ void RtspSession::updateRtcpContext(const RtpPacket::Ptr &rtp){
auto
ssrc
=
rtp
->
getSSRC
();
auto
rtcp
=
_push_src
?
rtcp_ctx
->
createRtcpRR
(
ssrc
+
1
,
ssrc
)
:
rtcp_ctx
->
createRtcpSR
(
ssrc
);
auto
rtcp_sdes
=
RtcpSdes
::
create
({
SERVER_NAME
});
auto
rtcp_sdes
=
RtcpSdes
::
create
({
kServerName
});
rtcp_sdes
->
chunks
.
type
=
(
uint8_t
)
SdesType
::
RTCP_SDES_CNAME
;
rtcp_sdes
->
chunks
.
ssrc
=
htonl
(
ssrc
);
send_rtcp
(
this
,
track_index
,
std
::
move
(
rtcp
));
...
...
src/Shell/ShellSession.cpp
查看文件 @
f5f58196
...
...
@@ -91,7 +91,7 @@ inline bool ShellSession::onCommandLine(const string& line) {
inline
void
ShellSession
::
pleaseInputUser
()
{
SockSender
::
send
(
"
\033
[0m"
);
SockSender
::
send
(
StrPrinter
<<
SERVER_NAME
<<
" login: "
<<
endl
);
SockSender
::
send
(
StrPrinter
<<
kServerName
<<
" login: "
<<
endl
);
_loginInterceptor
=
[
this
](
const
string
&
user_name
)
{
_strUserName
=
user_name
;
pleaseInputPasswd
();
...
...
@@ -108,14 +108,14 @@ inline void ShellSession::pleaseInputPasswd() {
<<
"
\033
[0mAuth failed("
<<
errMessage
<<
"), please try again.
\r\n
"
<<
_strUserName
<<
"@"
<<
SERVER_NAME
<<
_strUserName
<<
"@"
<<
kServerName
<<
"'s password:
\033
[8m"
<<
endl
);
return
;
}
SockSender
::
send
(
"
\033
[0m"
);
SockSender
::
send
(
"-----------------------------------------
\r\n
"
);
SockSender
::
send
(
StrPrinter
<<
"欢迎来到"
<<
SERVER_NAME
<<
", 你可输入
\"
help
\"
查看帮助.
\r\n
"
<<
endl
);
SockSender
::
send
(
StrPrinter
<<
"欢迎来到"
<<
kServerName
<<
", 你可输入
\"
help
\"
查看帮助.
\r\n
"
<<
endl
);
SockSender
::
send
(
"-----------------------------------------
\r\n
"
);
printShellPrefix
();
_loginInterceptor
=
nullptr
;
...
...
@@ -146,7 +146,7 @@ inline void ShellSession::pleaseInputPasswd() {
}
inline
void
ShellSession
::
printShellPrefix
()
{
SockSender
::
send
(
StrPrinter
<<
_strUserName
<<
"@"
<<
SERVER_NAME
<<
"# "
<<
endl
);
SockSender
::
send
(
StrPrinter
<<
_strUserName
<<
"@"
<<
kServerName
<<
"# "
<<
endl
);
}
}
/* namespace mediakit */
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论