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
5f50441f
Commit
5f50441f
authored
Jun 12, 2020
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
降低第三方库头文件依赖性
parent
f03351a7
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
17 行增加
和
5 行删除
+17
-5
CMakeLists.txt
+8
-4
src/Rtp/Decoder.cpp
+9
-1
没有找到文件。
CMakeLists.txt
查看文件 @
5f50441f
...
...
@@ -39,10 +39,6 @@ set(MediaServer_Root ${CMAKE_CURRENT_SOURCE_DIR}/3rdpart/media-server)
#设置头文件目录
INCLUDE_DIRECTORIES
(
${
ToolKit_Root
}
)
INCLUDE_DIRECTORIES
(
${
MediaKit_Root
}
)
INCLUDE_DIRECTORIES
(
${
MediaServer_Root
}
/libmpeg/include
)
INCLUDE_DIRECTORIES
(
${
MediaServer_Root
}
/libmov/include
)
INCLUDE_DIRECTORIES
(
${
MediaServer_Root
}
/libflv/include
)
INCLUDE_DIRECTORIES
(
${
MediaServer_Root
}
/librtp/include
)
INCLUDE_DIRECTORIES
(
${
CMAKE_CURRENT_SOURCE_DIR
}
/3rdpart
)
set
(
ENABLE_HLS true
)
...
...
@@ -62,6 +58,8 @@ if (OPENSSL_FOUND AND ENABLE_OPENSSL)
include_directories
(
${
OPENSSL_INCLUDE_DIR
}
)
add_definitions
(
-DENABLE_OPENSSL
)
list
(
APPEND LINK_LIB_LIST
${
OPENSSL_LIBRARIES
}
)
else
()
message
(
WARNING
"openssl未找到,rtmp将不支持flash播放器,https/wss/rtsps/rtmps也将失效"
)
endif
()
#查找mysql是否安装
...
...
@@ -109,6 +107,7 @@ if(ENABLE_HLS)
message
(
STATUS
"ENABLE_HLS defined"
)
add_definitions
(
-DENABLE_HLS
)
include_directories
(
${
MediaServer_Root
}
/libmpeg/include
)
aux_source_directory
(
${
MediaServer_Root
}
/libmpeg/include src_mpeg
)
aux_source_directory
(
${
MediaServer_Root
}
/libmpeg/source src_mpeg
)
...
...
@@ -125,6 +124,9 @@ if(ENABLE_MP4)
message
(
STATUS
"ENABLE_MP4 defined"
)
add_definitions
(
-DENABLE_MP4
)
include_directories
(
${
MediaServer_Root
}
/libmov/include
)
include_directories
(
${
MediaServer_Root
}
/libflv/include
)
aux_source_directory
(
${
MediaServer_Root
}
/libmov/include src_mov
)
aux_source_directory
(
${
MediaServer_Root
}
/libmov/source src_mov
)
...
...
@@ -143,6 +145,8 @@ endif()
#添加rtp库用于rtp转ps/ts
if
(
ENABLE_RTPPROXY AND ENABLE_HLS
)
message
(
STATUS
"ENABLE_RTPPROXY defined"
)
include_directories
(
${
MediaServer_Root
}
/librtp/include
)
aux_source_directory
(
${
MediaServer_Root
}
/librtp/include src_rtp
)
aux_source_directory
(
${
MediaServer_Root
}
/librtp/source src_rtp
)
aux_source_directory
(
${
MediaServer_Root
}
/librtp/payload src_rtp
)
...
...
src/Rtp/Decoder.cpp
查看文件 @
5f50441f
...
...
@@ -11,12 +11,15 @@
#include "Decoder.h"
#include "PSDecoder.h"
#include "TSDecoder.h"
#include "mpeg-ts-proto.h"
#include "Extension/H264.h"
#include "Extension/H265.h"
#include "Extension/AAC.h"
#include "Extension/G711.h"
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
#include "mpeg-ts-proto.h"
#endif
namespace
mediakit
{
static
Decoder
::
Ptr
createDecoder_l
(
DecoderImp
::
Type
type
)
{
switch
(
type
){
...
...
@@ -62,6 +65,7 @@ DecoderImp::DecoderImp(const Decoder::Ptr &decoder, MediaSinkInterface *sink){
});
}
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
#define SWITCH_CASE(codec_id) case codec_id : return #codec_id
static
const
char
*
getCodecName
(
int
codec_id
)
{
switch
(
codec_id
)
{
...
...
@@ -198,6 +202,9 @@ void DecoderImp::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d
break
;
}
}
#else
void
DecoderImp
::
onDecode
(
int
stream
,
int
codecid
,
int
flags
,
int64_t
pts
,
int64_t
dts
,
const
void
*
data
,
int
bytes
)
{}
#endif
void
DecoderImp
::
onTrack
(
const
Track
::
Ptr
&
track
)
{
_sink
->
addTrack
(
track
);
...
...
@@ -208,3 +215,4 @@ void DecoderImp::onFrame(const Frame::Ptr &frame) {
}
}
//namespace mediakit
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论