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
946945ce
Commit
946945ce
authored
Nov 12, 2022
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
整理代码
parent
6ffbcbfd
隐藏空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
22 行增加
和
41 行删除
+22
-41
.travis.yml
+0
-12
3rdpart/ZLToolKit
+1
-1
_config.yml
+0
-2
src/Common/MediaSource.h
+2
-2
src/Common/macros.h
+1
-1
src/Record/MP4Muxer.cpp
+1
-3
src/Record/MP4Muxer.h
+1
-1
src/Record/MPEG.cpp
+1
-1
src/Rtmp/RtmpCodec.h
+2
-2
src/Rtmp/RtmpMuxer.h
+2
-2
src/Rtp/RtpServer.cpp
+0
-2
src/Rtp/RtpServer.h
+1
-1
src/Rtsp/RtpMultiCaster.h
+2
-2
src/Rtsp/RtspMuxer.h
+3
-4
src/Rtsp/RtspSession.h
+1
-1
srt/SrtTransport.cpp
+4
-4
没有找到文件。
.travis.yml
deleted
100644 → 0
查看文件 @
6ffbcbfd
language
:
cpp
sudo
:
required
dist
:
trusty
compiler
:
-
clang
os
:
-
linux
script
:
-
./build_for_linux.sh
ZLToolKit
@
21fdfe4a
Subproject commit
844b866368fcbc4547c36474cc9d36479350bda3
Subproject commit
21fdfe4a6553356f1b01f7dde326535ba23aef45
_config.yml
deleted
100644 → 0
查看文件 @
6ffbcbfd
theme
:
jekyll-theme-cayman
\ No newline at end of file
src/Common/MediaSource.h
查看文件 @
946945ce
...
@@ -57,8 +57,8 @@ public:
...
@@ -57,8 +57,8 @@ public:
~
NotImplemented
()
override
=
default
;
~
NotImplemented
()
override
=
default
;
};
};
MediaSourceEvent
()
{}
;
MediaSourceEvent
()
=
default
;
virtual
~
MediaSourceEvent
()
{}
;
virtual
~
MediaSourceEvent
()
=
default
;
// 获取媒体源类型
// 获取媒体源类型
virtual
MediaOriginType
getOriginType
(
MediaSource
&
sender
)
const
{
return
MediaOriginType
::
unknown
;
}
virtual
MediaOriginType
getOriginType
(
MediaSource
&
sender
)
const
{
return
MediaOriginType
::
unknown
;
}
...
...
src/Common/macros.h
查看文件 @
946945ce
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
#endif
#endif
#ifndef CHECK
#ifndef CHECK
#define CHECK(exp, ...) mediakit::Assert_ThrowCpp(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__)
#define CHECK(exp, ...)
::
mediakit::Assert_ThrowCpp(!(exp), #exp, __FUNCTION__, __FILE__, __LINE__, ##__VA_ARGS__)
#endif // CHECK
#endif // CHECK
#ifndef MAX
#ifndef MAX
...
...
src/Record/MP4Muxer.cpp
查看文件 @
946945ce
...
@@ -19,8 +19,6 @@ using namespace toolkit;
...
@@ -19,8 +19,6 @@ using namespace toolkit;
namespace
mediakit
{
namespace
mediakit
{
MP4Muxer
::
MP4Muxer
()
{}
MP4Muxer
::~
MP4Muxer
()
{
MP4Muxer
::~
MP4Muxer
()
{
closeMP4
();
closeMP4
();
}
}
...
@@ -64,7 +62,7 @@ bool MP4MuxerInterface::haveVideo() const {
...
@@ -64,7 +62,7 @@ bool MP4MuxerInterface::haveVideo() const {
uint64_t
MP4MuxerInterface
::
getDuration
()
const
{
uint64_t
MP4MuxerInterface
::
getDuration
()
const
{
uint64_t
ret
=
0
;
uint64_t
ret
=
0
;
for
(
auto
&
pr
:
_codec_to_trackid
)
{
for
(
auto
&
pr
:
_codec_to_trackid
)
{
if
(
pr
.
second
.
stamp
.
getRelativeStamp
()
>
ret
)
{
if
(
pr
.
second
.
stamp
.
getRelativeStamp
()
>
(
int64_t
)
ret
)
{
ret
=
pr
.
second
.
stamp
.
getRelativeStamp
();
ret
=
pr
.
second
.
stamp
.
getRelativeStamp
();
}
}
}
}
...
...
src/Record/MP4Muxer.h
查看文件 @
946945ce
...
@@ -90,7 +90,7 @@ class MP4Muxer : public MP4MuxerInterface{
...
@@ -90,7 +90,7 @@ class MP4Muxer : public MP4MuxerInterface{
public
:
public
:
typedef
std
::
shared_ptr
<
MP4Muxer
>
Ptr
;
typedef
std
::
shared_ptr
<
MP4Muxer
>
Ptr
;
MP4Muxer
();
MP4Muxer
()
=
default
;
~
MP4Muxer
()
override
;
~
MP4Muxer
()
override
;
/**
/**
...
...
src/Record/MPEG.cpp
查看文件 @
946945ce
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
#if defined(ENABLE_HLS) || defined(ENABLE_RTPPROXY)
#if defined(ENABLE_HLS) || defined(ENABLE_RTPPROXY)
#include "mpeg-ts
-proto
.h"
#include "mpeg-ts.h"
#include "mpeg-muxer.h"
#include "mpeg-muxer.h"
using
namespace
toolkit
;
using
namespace
toolkit
;
...
...
src/Rtmp/RtmpCodec.h
查看文件 @
946945ce
...
@@ -56,8 +56,8 @@ protected:
...
@@ -56,8 +56,8 @@ protected:
class
RtmpCodec
:
public
RtmpRing
,
public
FrameDispatcher
,
public
CodecInfo
{
class
RtmpCodec
:
public
RtmpRing
,
public
FrameDispatcher
,
public
CodecInfo
{
public
:
public
:
typedef
std
::
shared_ptr
<
RtmpCodec
>
Ptr
;
typedef
std
::
shared_ptr
<
RtmpCodec
>
Ptr
;
RtmpCodec
()
{}
RtmpCodec
()
=
default
;
virtual
~
RtmpCodec
(){}
~
RtmpCodec
()
override
=
default
;
virtual
void
makeConfigPacket
()
{};
virtual
void
makeConfigPacket
()
{};
};
};
...
...
src/Rtmp/RtmpMuxer.h
查看文件 @
946945ce
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
namespace
mediakit
{
namespace
mediakit
{
class
RtmpMuxer
:
public
MediaSinkInterface
{
class
RtmpMuxer
:
public
MediaSinkInterface
{
public
:
public
:
typedef
std
::
shared_ptr
<
RtmpMuxer
>
Ptr
;
typedef
std
::
shared_ptr
<
RtmpMuxer
>
Ptr
;
...
@@ -26,7 +26,7 @@ public:
...
@@ -26,7 +26,7 @@ public:
* 构造函数
* 构造函数
*/
*/
RtmpMuxer
(
const
TitleMeta
::
Ptr
&
title
);
RtmpMuxer
(
const
TitleMeta
::
Ptr
&
title
);
virtual
~
RtmpMuxer
(){}
~
RtmpMuxer
()
override
=
default
;
/**
/**
* 获取完整的SDP字符串
* 获取完整的SDP字符串
...
...
src/Rtp/RtpServer.cpp
查看文件 @
946945ce
...
@@ -19,8 +19,6 @@ using namespace toolkit;
...
@@ -19,8 +19,6 @@ using namespace toolkit;
namespace
mediakit
{
namespace
mediakit
{
RtpServer
::
RtpServer
()
{}
RtpServer
::~
RtpServer
()
{
RtpServer
::~
RtpServer
()
{
if
(
_on_cleanup
)
{
if
(
_on_cleanup
)
{
_on_cleanup
();
_on_cleanup
();
...
...
src/Rtp/RtpServer.h
查看文件 @
946945ce
...
@@ -31,7 +31,7 @@ public:
...
@@ -31,7 +31,7 @@ public:
using
onRecv
=
std
::
function
<
void
(
const
toolkit
::
Buffer
::
Ptr
&
buf
)
>
;
using
onRecv
=
std
::
function
<
void
(
const
toolkit
::
Buffer
::
Ptr
&
buf
)
>
;
enum
TcpMode
{
NONE
=
0
,
PASSIVE
,
ACTIVE
};
enum
TcpMode
{
NONE
=
0
,
PASSIVE
,
ACTIVE
};
RtpServer
();
RtpServer
()
=
default
;
~
RtpServer
();
~
RtpServer
();
/**
/**
...
...
src/Rtsp/RtpMultiCaster.h
查看文件 @
946945ce
...
@@ -24,7 +24,7 @@ namespace mediakit{
...
@@ -24,7 +24,7 @@ namespace mediakit{
class
MultiCastAddressMaker
{
class
MultiCastAddressMaker
{
public
:
public
:
~
MultiCastAddressMaker
()
{}
~
MultiCastAddressMaker
()
=
default
;
static
MultiCastAddressMaker
&
Instance
();
static
MultiCastAddressMaker
&
Instance
();
static
bool
isMultiCastAddress
(
uint32_t
addr
);
static
bool
isMultiCastAddress
(
uint32_t
addr
);
static
std
::
string
toString
(
uint32_t
addr
);
static
std
::
string
toString
(
uint32_t
addr
);
...
@@ -32,7 +32,7 @@ public:
...
@@ -32,7 +32,7 @@ public:
std
::
shared_ptr
<
uint32_t
>
obtain
(
uint32_t
max_try
=
10
);
std
::
shared_ptr
<
uint32_t
>
obtain
(
uint32_t
max_try
=
10
);
private
:
private
:
MultiCastAddressMaker
()
{}
;
MultiCastAddressMaker
()
=
default
;
void
release
(
uint32_t
addr
);
void
release
(
uint32_t
addr
);
private
:
private
:
...
...
src/Rtsp/RtspMuxer.h
查看文件 @
946945ce
...
@@ -22,7 +22,7 @@ class RingDelegateHelper : public toolkit::RingDelegate<RtpPacket::Ptr> {
...
@@ -22,7 +22,7 @@ class RingDelegateHelper : public toolkit::RingDelegate<RtpPacket::Ptr> {
public
:
public
:
using
onRtp
=
std
::
function
<
void
(
RtpPacket
::
Ptr
in
,
bool
is_key
)
>
;
using
onRtp
=
std
::
function
<
void
(
RtpPacket
::
Ptr
in
,
bool
is_key
)
>
;
~
RingDelegateHelper
()
override
{}
~
RingDelegateHelper
()
override
=
default
;
RingDelegateHelper
(
onRtp
on_rtp
)
{
RingDelegateHelper
(
onRtp
on_rtp
)
{
_on_rtp
=
std
::
move
(
on_rtp
);
_on_rtp
=
std
::
move
(
on_rtp
);
...
@@ -39,7 +39,7 @@ private:
...
@@ -39,7 +39,7 @@ private:
/**
/**
* rtsp生成器
* rtsp生成器
*/
*/
class
RtspMuxer
:
public
MediaSinkInterface
{
class
RtspMuxer
:
public
MediaSinkInterface
{
public
:
public
:
using
Ptr
=
std
::
shared_ptr
<
RtspMuxer
>
;
using
Ptr
=
std
::
shared_ptr
<
RtspMuxer
>
;
...
@@ -47,8 +47,7 @@ public:
...
@@ -47,8 +47,7 @@ public:
* 构造函数
* 构造函数
*/
*/
RtspMuxer
(
const
TitleSdp
::
Ptr
&
title
=
nullptr
);
RtspMuxer
(
const
TitleSdp
::
Ptr
&
title
=
nullptr
);
~
RtspMuxer
()
override
=
default
;
virtual
~
RtspMuxer
(){}
/**
/**
* 获取完整的SDP字符串
* 获取完整的SDP字符串
...
...
src/Rtsp/RtspSession.h
查看文件 @
946945ce
...
@@ -37,7 +37,7 @@ public:
...
@@ -37,7 +37,7 @@ public:
using
Ptr
=
std
::
shared_ptr
<
BufferRtp
>
;
using
Ptr
=
std
::
shared_ptr
<
BufferRtp
>
;
BufferRtp
(
Buffer
::
Ptr
pkt
,
size_t
offset
=
0
)
:
_offset
(
offset
),
_rtp
(
std
::
move
(
pkt
))
{}
BufferRtp
(
Buffer
::
Ptr
pkt
,
size_t
offset
=
0
)
:
_offset
(
offset
),
_rtp
(
std
::
move
(
pkt
))
{}
~
BufferRtp
()
override
{}
~
BufferRtp
()
override
=
default
;
char
*
data
()
const
override
{
char
*
data
()
const
override
{
return
(
char
*
)
_rtp
->
data
()
+
_offset
;
return
(
char
*
)
_rtp
->
data
()
+
_offset
;
...
...
srt/SrtTransport.cpp
查看文件 @
946945ce
...
@@ -407,9 +407,9 @@ void SrtTransport::handleDropReq(uint8_t *buf, int len, struct sockaddr_storage
...
@@ -407,9 +407,9 @@ void SrtTransport::handleDropReq(uint8_t *buf, int len, struct sockaddr_storage
if
(
list
.
empty
())
{
if
(
list
.
empty
())
{
return
;
return
;
}
}
uint32_t
max_seq
=
0
;
//
uint32_t max_seq = 0;
for
(
auto
&
data
:
list
)
{
for
(
auto
&
data
:
list
)
{
max_seq
=
data
->
packet_seq_number
;
//
max_seq = data->packet_seq_number;
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
}
}
...
@@ -620,9 +620,9 @@ void SrtTransport::handleDataPacket(uint8_t *buf, int len, struct sockaddr_stora
...
@@ -620,9 +620,9 @@ void SrtTransport::handleDataPacket(uint8_t *buf, int len, struct sockaddr_stora
if
(
list
.
empty
())
{
if
(
list
.
empty
())
{
// when no data ok send nack to sender immediately
// when no data ok send nack to sender immediately
}
else
{
}
else
{
uint32_t
last_seq
;
//
uint32_t last_seq;
for
(
auto
&
data
:
list
)
{
for
(
auto
&
data
:
list
)
{
last_seq
=
data
->
packet_seq_number
;
//
last_seq = data->packet_seq_number;
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
if
(
_last_pkt_seq
+
1
!=
data
->
packet_seq_number
)
{
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
TraceL
<<
"pkt lost "
<<
_last_pkt_seq
+
1
<<
"->"
<<
data
->
packet_seq_number
;
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论