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
477475a6
Commit
477475a6
authored
May 18, 2020
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量添加bom头、批量替换tab字符
parent
7bc7d952
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
54 行增加
和
87 行删除
+54
-87
api/include/mk_common.h
+5
-5
src/Common/Device.h
+3
-3
src/Extension/Factory.cpp
+1
-1
src/Extension/Opus.cpp
+1
-1
src/Extension/Opus.h
+1
-1
src/Http/HlsParser.cpp
+1
-1
src/Http/HlsParser.h
+1
-1
src/Http/HlsPlayer.cpp
+1
-1
src/Http/HlsPlayer.h
+1
-1
src/Http/HttpTSPlayer.cpp
+1
-1
src/Http/HttpTSPlayer.h
+1
-1
src/Record/MP4.cpp
+1
-1
src/Record/MP4.h
+1
-1
src/Record/MP4Demuxer.cpp
+1
-1
src/Record/MP4Demuxer.h
+1
-1
src/Rtsp/RtspSession.cpp
+18
-18
tests/bom.cpp
+13
-44
tests/tab.cpp
+0
-2
tests/test_player.cpp
+1
-1
tests/test_rtp.cpp
+1
-1
没有找到文件。
api/include/mk_common.h
查看文件 @
477475a6
...
...
@@ -17,12 +17,12 @@
#ifndef MediaKitApi_STATIC
#if defined(MediaKitApi_EXPORTS)
#define API_EXPORT __declspec(dllexport)
#else
#define API_EXPORT __declspec(dllimport)
#endif
#define API_EXPORT __declspec(dllexport)
#else
#define API_EXPORT __declspec(dllimport)
#endif
#define API_CALL __cdecl
#define API_CALL __cdecl
#else
#define API_EXPORT
#define API_CALL
...
...
src/Common/Device.h
查看文件 @
477475a6
...
...
@@ -43,9 +43,9 @@ public:
class
AudioInfo
{
public
:
CodecId
codecId
=
CodecAAC
;
int
iChannel
;
int
iSampleBit
;
int
iSampleRate
;
int
iChannel
;
int
iSampleBit
;
int
iSampleRate
;
};
/**
...
...
src/Extension/Factory.cpp
查看文件 @
477475a6
...
...
@@ -226,7 +226,7 @@ RtmpCodec::Ptr Factory::getRtmpCodecByTrack(const Track::Ptr &track) {
case
CodecH264
:
return
std
::
make_shared
<
H264RtmpEncoder
>
(
track
);
case
CodecAAC
:
return
std
::
make_shared
<
AACRtmpEncoder
>
(
track
);
case
CodecH265
:
return
std
::
make_shared
<
H265RtmpEncoder
>
(
track
);
case
CodecG711A
:
case
CodecG711A
:
case
CodecG711U
:
return
std
::
make_shared
<
G711RtmpEncoder
>
(
track
);
default
:
WarnL
<<
"暂不支持该CodecId:"
<<
track
->
getCodecName
();
return
nullptr
;
}
...
...
src/Extension/Opus.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Extension/Opus.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HlsParser.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HlsParser.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HlsPlayer.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HlsPlayer.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HttpTSPlayer.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Http/HttpTSPlayer.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2020 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Record/MP4.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Record/MP4.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Record/MP4Demuxer.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Record/MP4Demuxer.h
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
src/Rtsp/RtspSession.cpp
查看文件 @
477475a6
...
...
@@ -737,22 +737,22 @@ void RtspSession::handleReq_Play(const Parser &parser) {
}
bool
useBuf
=
true
;
_enableSendRtp
=
false
;
_enableSendRtp
=
false
;
float
iStartTime
=
0
;
if
(
strRange
.
size
()
&&
!
_bFirstPlay
)
{
if
(
strRange
.
size
()
&&
!
_bFirstPlay
)
{
//这个是seek操作
auto
strStart
=
FindField
(
strRange
.
data
(),
"npt="
,
"-"
);
if
(
strStart
==
"now"
)
{
strStart
=
"0"
;
}
iStartTime
=
1000
*
atof
(
strStart
.
data
());
InfoP
(
this
)
<<
"rtsp seekTo(ms):"
<<
iStartTime
;
useBuf
=
!
pMediaSrc
->
seekTo
(
iStartTime
);
}
else
if
(
pMediaSrc
->
totalReaderCount
()
==
0
){
//第一个消费者
pMediaSrc
->
seekTo
(
0
);
}
_bFirstPlay
=
false
;
auto
strStart
=
FindField
(
strRange
.
data
(),
"npt="
,
"-"
);
if
(
strStart
==
"now"
)
{
strStart
=
"0"
;
}
iStartTime
=
1000
*
atof
(
strStart
.
data
());
InfoP
(
this
)
<<
"rtsp seekTo(ms):"
<<
iStartTime
;
useBuf
=
!
pMediaSrc
->
seekTo
(
iStartTime
);
}
else
if
(
pMediaSrc
->
totalReaderCount
()
==
0
){
//第一个消费者
pMediaSrc
->
seekTo
(
0
);
}
_bFirstPlay
=
false
;
_StrPrinter
rtp_info
;
for
(
auto
&
track
:
_aTrackInfo
){
...
...
@@ -772,10 +772,10 @@ void RtspSession::handleReq_Play(const Parser &parser) {
rtp_info
.
pop_back
();
sendRtspResponse
(
"200 OK"
,
{
"Range"
,
StrPrinter
<<
"npt="
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
2
)
<<
(
useBuf
?
pMediaSrc
->
getTimeStamp
(
TrackInvalid
)
/
1000.0
:
iStartTime
/
1000
),
"RTP-Info"
,
rtp_info
});
sendRtspResponse
(
"200 OK"
,
{
"Range"
,
StrPrinter
<<
"npt="
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
2
)
<<
(
useBuf
?
pMediaSrc
->
getTimeStamp
(
TrackInvalid
)
/
1000.0
:
iStartTime
/
1000
),
"RTP-Info"
,
rtp_info
});
_enableSendRtp
=
true
;
setSocketFlags
();
...
...
tests/bom.cpp
查看文件 @
477475a6
...
...
@@ -61,40 +61,6 @@ public:
}
};
void
get_file_path
(
const
char
*
path
,
const
char
*
file_name
,
char
*
file_path
)
{
strcpy
(
file_path
,
path
);
if
(
file_path
[
strlen
(
file_path
)
-
1
]
!=
'/'
)
{
strcat
(
file_path
,
"/"
);
}
strcat
(
file_path
,
file_name
);
}
template
<
typename
FUNC
>
void
for_each_file
(
const
char
*
path
,
FUNC
&&
func
){
DIR
*
dir
;
dirent
*
dir_info
;
char
file_path
[
PATH_MAX
];
if
(
File
::
is_file
(
path
))
{
func
(
path
);
return
;
}
if
(
File
::
is_dir
(
path
))
{
if
((
dir
=
opendir
(
path
))
==
NULL
)
{
closedir
(
dir
);
return
;
}
while
((
dir_info
=
readdir
(
dir
))
!=
NULL
)
{
if
(
File
::
is_special_dir
(
dir_info
->
d_name
))
{
continue
;
}
get_file_path
(
path
,
dir_info
->
d_name
,
file_path
);
for_each_file
(
file_path
,
std
::
forward
<
FUNC
>
(
func
));
}
closedir
(
dir
);
return
;
}
}
static
const
char
s_bom
[]
=
"
\xEF\xBB\xBF
"
;
void
add_or_rm_bom
(
const
char
*
file
,
bool
rm_bom
){
...
...
@@ -159,23 +125,26 @@ int main(int argc, char *argv[]) {
bool
no_filter
=
filter_set
.
find
(
"*"
)
!=
filter_set
.
end
();
//设置日志
Logger
::
Instance
().
add
(
std
::
make_shared
<
ConsoleChannel
>
());
path
=
File
::
absolutePath
(
path
,
""
);
for_each_file
(
path
.
data
(),[
&
](
const
char
*
path
){
if
(
!
no_filter
){
File
::
scanDir
(
path
,
[
&
](
const
string
&
path
,
bool
isDir
)
{
if
(
isDir
)
{
return
true
;
}
if
(
!
no_filter
)
{
//开启了过滤器
auto
pos
=
strstr
(
path
,
"."
);
if
(
pos
==
nullptr
)
{
auto
pos
=
strstr
(
path
.
data
(),
"."
);
if
(
pos
==
nullptr
)
{
//没有后缀
return
;
return
true
;
}
auto
ext
=
pos
+
1
;
if
(
filter_set
.
find
(
ext
)
==
filter_set
.
end
())
{
if
(
filter_set
.
find
(
ext
)
==
filter_set
.
end
())
{
//后缀不匹配
return
;
return
true
;
}
}
//该文件匹配
process_file
(
path
,
rm_bom
);
});
process_file
(
path
.
data
(),
rm_bom
);
return
true
;
},
true
);
return
0
;
}
tests/tab.cpp
查看文件 @
477475a6
...
...
@@ -128,8 +128,6 @@ int main(int argc, char *argv[]) {
bool
no_filter
=
filter_set
.
find
(
"*"
)
!=
filter_set
.
end
();
//设置日志
Logger
::
Instance
().
add
(
std
::
make_shared
<
ConsoleChannel
>
());
path
=
File
::
absolutePath
(
path
,
""
);
DebugL
<<
path
;
File
::
scanDir
(
path
,
[
&
](
const
string
&
path
,
bool
isDir
)
{
if
(
isDir
)
{
return
true
;
...
...
tests/test_player.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
tests/test_rtp.cpp
查看文件 @
477475a6
/*
/*
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论