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
11420b86
Commit
11420b86
authored
Apr 04, 2020
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理代码
parent
67f4ca4b
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
14 行增加
和
18 行删除
+14
-18
src/Common/config.h
+1
-1
src/Http/HttpClient.cpp
+1
-1
src/Http/HttpSession.cpp
+1
-2
src/Rtmp/Rtmp.h
+1
-1
src/Rtsp/Rtsp.cpp
+1
-2
src/Rtsp/Rtsp.h
+4
-4
src/Rtsp/RtspMediaSource.h
+1
-1
src/Rtsp/RtspPlayer.cpp
+1
-1
src/Rtsp/RtspPusher.cpp
+1
-1
src/Rtsp/RtspSession.cpp
+2
-2
src/Rtsp/RtspSession.h
+0
-2
没有找到文件。
src/Common/config.h
查看文件 @
11420b86
...
...
@@ -57,7 +57,7 @@ bool loadIniConfig(const char *ini_path = nullptr);
#define CLEAR_ARR(arr) for(auto &item : arr){ item = 0;}
#endif //CLEAR_ARR
#define SERVER_NAME "ZLMediaKit-4.0"
#define SERVER_NAME "ZLMediaKit-4.0
(build in " __DATE__ " " __TIME__ ")
"
#define VHOST_KEY "vhost"
#define HTTP_SCHEMA "http"
#define RTSP_SCHEMA "rtsp"
...
...
src/Http/HttpClient.cpp
查看文件 @
11420b86
...
...
@@ -71,7 +71,7 @@ void HttpClient::sendRequest(const string &strUrl, float fTimeOutSec) {
host
=
FindField
(
host
.
data
(),
NULL
,
":"
);
}
_header
.
emplace
(
"Host"
,
host
);
_header
.
emplace
(
"Tools"
,
"ZLMediaKit"
);
_header
.
emplace
(
"Tools"
,
SERVER_NAME
);
_header
.
emplace
(
"Connection"
,
"keep-alive"
);
_header
.
emplace
(
"Accept"
,
"*/*"
);
_header
.
emplace
(
"Accept-Language"
,
"zh-CN,zh;q=0.8"
);
...
...
src/Http/HttpSession.cpp
查看文件 @
11420b86
...
...
@@ -398,7 +398,6 @@ static const string kContentType = "Content-Type";
static
const
string
kContentLength
=
"Content-Length"
;
static
const
string
kAccessControlAllowOrigin
=
"Access-Control-Allow-Origin"
;
static
const
string
kAccessControlAllowCredentials
=
"Access-Control-Allow-Credentials"
;
static
const
string
kServerName
=
SERVER_NAME
;
void
HttpSession
::
sendResponse
(
const
char
*
pcStatus
,
bool
bClose
,
...
...
@@ -426,7 +425,7 @@ void HttpSession::sendResponse(const char *pcStatus,
HttpSession
::
KeyValue
&
headerOut
=
const_cast
<
HttpSession
::
KeyValue
&>
(
header
);
headerOut
.
emplace
(
kDate
,
dateStr
());
headerOut
.
emplace
(
kServer
,
kServerName
);
headerOut
.
emplace
(
kServer
,
SERVER_NAME
);
headerOut
.
emplace
(
kConnection
,
bClose
?
"close"
:
"keep-alive"
);
if
(
!
bClose
){
string
keepAliveString
=
"timeout="
;
...
...
src/Rtmp/Rtmp.h
查看文件 @
11420b86
...
...
@@ -325,7 +325,7 @@ public:
const
map
<
string
,
string
>
&
header
=
map
<
string
,
string
>
()){
_metadata
.
set
(
"duration"
,
dur_sec
);
_metadata
.
set
(
"fileSize"
,
0
);
_metadata
.
set
(
"server"
,
"ZLMediaKit"
);
_metadata
.
set
(
"server"
,
SERVER_NAME
);
for
(
auto
&
pr
:
header
){
_metadata
.
set
(
pr
.
first
,
pr
.
second
);
}
...
...
src/Rtsp/Rtsp.cpp
查看文件 @
11420b86
...
...
@@ -108,8 +108,7 @@ string SdpTrack::toString() const {
_printer
<<
"t="
<<
_t
<<
"
\r\n
"
;
}
_printer
<<
"s=RTSP Session, streamed by the ZLMediaKit
\r\n
"
;
_printer
<<
"i=ZLMediaKit Live Stream
\r\n
"
;
_printer
<<
"s=Streamed by "
<<
SERVER_NAME
<<
"
\r\n
"
;
getAttrSdp
(
_attr
,
_printer
);
}
break
;
...
...
src/Rtsp/Rtsp.h
查看文件 @
11420b86
...
...
@@ -258,17 +258,17 @@ public:
_printer
<<
pr
.
first
<<
"="
<<
pr
.
second
<<
"
\r\n
"
;
}
}
else
{
_printer
<<
"o=- 1383190487994921 1 IN IP4 0.0.0.0
\r\n
"
;
_printer
<<
"s=RTSP Session, streamed by the ZLMediaKit
\r\n
"
;
_printer
<<
"i=ZLMediaKit Live Stream
\r\n
"
;
_printer
<<
"o=- 0 0 IN IP4 0.0.0.0
\r\n
"
;
_printer
<<
"s=Streamed by "
<<
SERVER_NAME
<<
"
\r\n
"
;
_printer
<<
"c=IN IP4 0.0.0.0
\r\n
"
;
_printer
<<
"t=0 0
\r\n
"
;
}
if
(
dur_sec
<=
0
){
//直播
_printer
<<
"a=range:npt=now-
\r\n
"
;
}
else
{
//点播
情况下,vlc不支持支持npt=now-xxx, 但是貌似echo show只支持npt=now-xxx ?
//点播
_printer
<<
"a=range:npt=0-"
<<
dur_sec
<<
"
\r\n
"
;
}
_printer
<<
"a=control:*
\r\n
"
;
...
...
src/Rtsp/RtspMediaSource.h
查看文件 @
11420b86
...
...
@@ -133,7 +133,7 @@ public:
case
1
:
return
tracks
[
0
]
->
_time_stamp
;
default
:
return
M
AX
(
tracks
[
0
]
->
_time_stamp
,
tracks
[
1
]
->
_time_stamp
);
return
M
IN
(
tracks
[
0
]
->
_time_stamp
,
tracks
[
1
]
->
_time_stamp
);
}
}
...
...
src/Rtsp/RtspPlayer.cpp
查看文件 @
11420b86
...
...
@@ -668,7 +668,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
<<
_uiCseq
++
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
"(build in "
__DATE__
" "
__TIME__
")"
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
);
if
(
!
_strSession
.
empty
()){
header
.
emplace
(
"Session"
,
_strSession
);
...
...
src/Rtsp/RtspPusher.cpp
查看文件 @
11420b86
...
...
@@ -398,7 +398,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
<<
_uiCseq
++
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
"(build in "
__DATE__
" "
__TIME__
")"
);
header
.
emplace
(
"User-Agent"
,
SERVER_NAME
);
if
(
!
_strSession
.
empty
()){
header
.
emplace
(
"Session"
,
_strSession
);
...
...
src/Rtsp/RtspSession.cpp
查看文件 @
11420b86
...
...
@@ -795,7 +795,7 @@ void RtspSession::handleReq_Play(const Parser &parser) {
rtp_info
.
pop_back
();
sendRtspResponse
(
"200 OK"
,
{
"Range"
,
StrPrinter
<<
"npt="
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
2
)
<<
pMediaSrc
->
getTimeStamp
(
TrackInvalid
)
/
1000.0
,
{
"Range"
,
StrPrinter
<<
"npt="
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
2
)
<<
pMediaSrc
->
getTimeStamp
(
TrackInvalid
)
/
1000.0
<<
"-"
,
"RTP-Info"
,
rtp_info
});
...
...
@@ -1033,7 +1033,7 @@ bool RtspSession::sendRtspResponse(const string &res_code,
header
.
emplace
(
"Session"
,
_strSession
);
}
header
.
emplace
(
"Server"
,
SERVER_NAME
"(build in "
__DATE__
" "
__TIME__
")"
);
header
.
emplace
(
"Server"
,
SERVER_NAME
);
header
.
emplace
(
"Date"
,
dateStr
());
if
(
!
sdp
.
empty
()){
...
...
src/Rtsp/RtspSession.h
查看文件 @
11420b86
...
...
@@ -236,8 +236,6 @@ private:
RtcpCounter
_aRtcpCnt
[
2
];
//rtcp发送时间,trackid idx 为数组下标
Ticker
_aRtcpTicker
[
2
];
//时间戳修整器
Stamp
_stamp
[
2
];
};
/**
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论