mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-22 19:00:01 +08:00
支持rtp代理服务器
This commit is contained in:
parent
55814070f8
commit
0d9bdec182
@ -1 +1 @@
|
|||||||
Subproject commit 678678b2ee7118d21d33a90a303698e0da02790c
|
Subproject commit 358b7bd3bf89564371fed48797ad396882f9d130
|
@ -30,29 +30,15 @@ endif ()
|
|||||||
|
|
||||||
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
|
LINK_DIRECTORIES(${LIBRARY_OUTPUT_PATH})
|
||||||
|
|
||||||
|
|
||||||
#设置工程源码根目录
|
#设置工程源码根目录
|
||||||
set(ToolKit_Root ${CMAKE_CURRENT_SOURCE_DIR}/3rdpart/ZLToolKit/src)
|
set(ToolKit_Root ${CMAKE_CURRENT_SOURCE_DIR}/3rdpart/ZLToolKit/src)
|
||||||
set(MediaKit_Root ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
set(MediaKit_Root ${CMAKE_CURRENT_SOURCE_DIR}/src)
|
||||||
set(MediaServer_Root ${CMAKE_CURRENT_SOURCE_DIR}/3rdpart/media-server)
|
set(MediaServer_Root ${CMAKE_CURRENT_SOURCE_DIR}/3rdpart/media-server)
|
||||||
|
|
||||||
|
|
||||||
#设置头文件目录
|
#设置头文件目录
|
||||||
INCLUDE_DIRECTORIES(${ToolKit_Root})
|
INCLUDE_DIRECTORIES(${ToolKit_Root})
|
||||||
INCLUDE_DIRECTORIES(${MediaKit_Root})
|
INCLUDE_DIRECTORIES(${MediaKit_Root})
|
||||||
|
|
||||||
#收集源代码
|
|
||||||
file(GLOB ToolKit_src_list ${ToolKit_Root}/*/*.cpp ${ToolKit_Root}/*/*.h ${ToolKit_Root}/*/*.c)
|
|
||||||
file(GLOB MediaKit_src_list ${MediaKit_Root}/*/*.cpp ${MediaKit_Root}/*/*.h ${MediaKit_Root}/*/*.c)
|
|
||||||
|
|
||||||
#去除win32的适配代码
|
|
||||||
if (NOT WIN32)
|
|
||||||
list(REMOVE_ITEM ToolKit_src_list ${ToolKit_Root}/win32/getopt.c)
|
|
||||||
else()
|
|
||||||
#防止Windows.h包含Winsock.h
|
|
||||||
add_definitions(-DWIN32_LEAN_AND_MEAN -DMP4V2_NO_STDINT_DEFS)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
set(ENABLE_HLS true)
|
set(ENABLE_HLS true)
|
||||||
set(ENABLE_OPENSSL true)
|
set(ENABLE_OPENSSL true)
|
||||||
set(ENABLE_MYSQL false)
|
set(ENABLE_MYSQL false)
|
||||||
@ -60,6 +46,7 @@ set(ENABLE_MP4V2 true)
|
|||||||
set(ENABLE_FAAC false)
|
set(ENABLE_FAAC false)
|
||||||
set(ENABLE_X264 false)
|
set(ENABLE_X264 false)
|
||||||
set(ENABLE_MP4RECORD true)
|
set(ENABLE_MP4RECORD true)
|
||||||
|
set(ENABLE_RTPPROXY true)
|
||||||
|
|
||||||
set(LINK_LIB_LIST zlmediakit zltoolkit)
|
set(LINK_LIB_LIST zlmediakit zltoolkit)
|
||||||
|
|
||||||
@ -109,6 +96,15 @@ if (FAAC_FOUND AND ENABLE_FAAC)
|
|||||||
list(APPEND LINK_LIB_LIST ${FAAC_LIBRARIES})
|
list(APPEND LINK_LIB_LIST ${FAAC_LIBRARIES})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
||||||
|
#查找jemalloc是否安装
|
||||||
|
find_package(JEMALLOC QUIET)
|
||||||
|
if(JEMALLOC_FOUND)
|
||||||
|
message(STATUS "found library:\"${JEMALLOC_LIBRARIES}\"")
|
||||||
|
include_directories(${JEMALLOC_INCLUDE_DIR})
|
||||||
|
list(APPEND LINK_LIB_LIST ${JEMALLOC_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(VS_FALGS "/wd4819 /wd4996 /wd4018 /wd4267 /wd4244 /wd4101 /wd4828 /wd4309 /wd4573" )
|
set(VS_FALGS "/wd4819 /wd4996 /wd4018 /wd4267 /wd4244 /wd4101 /wd4828 /wd4309 /wd4573" )
|
||||||
|
|
||||||
@ -151,24 +147,28 @@ if(ENABLE_MP4RECORD)
|
|||||||
endif(WIN32)
|
endif(WIN32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_BUILD_TYPE} MATCHES "Release")
|
if(ENABLE_RTPPROXY)
|
||||||
#查找jemalloc是否安装
|
|
||||||
find_package(JEMALLOC QUIET)
|
|
||||||
if(JEMALLOC_FOUND)
|
|
||||||
message(STATUS "found library:\"${JEMALLOC_LIBRARIES}\"")
|
|
||||||
include_directories(${JEMALLOC_INCLUDE_DIR})
|
|
||||||
list(APPEND LINK_LIB_LIST ${JEMALLOC_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
#添加rtp库用于rtp转ps/ts
|
#添加rtp库用于rtp转ps/ts
|
||||||
aux_source_directory(${MediaServer_Root}/librtp/include src_rtp)
|
aux_source_directory(${MediaServer_Root}/librtp/include src_rtp)
|
||||||
aux_source_directory(${MediaServer_Root}/librtp/source src_rtp)
|
aux_source_directory(${MediaServer_Root}/librtp/source src_rtp)
|
||||||
aux_source_directory(${MediaServer_Root}/librtp/payload src_rtp)
|
aux_source_directory(${MediaServer_Root}/librtp/payload src_rtp)
|
||||||
include_directories(${MediaServer_Root}/librtp/include)
|
include_directories(${MediaServer_Root}/librtp/include)
|
||||||
add_library(rtp STATIC ${src_rtp})
|
add_library(rtp STATIC ${src_rtp})
|
||||||
|
add_definitions(-DENABLE_RTPPROXY)
|
||||||
list(APPEND LINK_LIB_LIST rtp)
|
list(APPEND LINK_LIB_LIST rtp)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
#收集源代码
|
||||||
|
file(GLOB ToolKit_src_list ${ToolKit_Root}/*/*.cpp ${ToolKit_Root}/*/*.h ${ToolKit_Root}/*/*.c)
|
||||||
|
file(GLOB MediaKit_src_list ${MediaKit_Root}/*/*.cpp ${MediaKit_Root}/*/*.h ${MediaKit_Root}/*/*.c)
|
||||||
|
|
||||||
|
#去除win32的适配代码
|
||||||
|
if (NOT WIN32)
|
||||||
|
list(REMOVE_ITEM ToolKit_src_list ${ToolKit_Root}/win32/getopt.c)
|
||||||
|
else()
|
||||||
|
#防止Windows.h包含Winsock.h
|
||||||
|
add_definitions(-DWIN32_LEAN_AND_MEAN -DMP4V2_NO_STDINT_DEFS)
|
||||||
|
endif ()
|
||||||
|
|
||||||
#添加库
|
#添加库
|
||||||
add_library(zltoolkit STATIC ${ToolKit_src_list})
|
add_library(zltoolkit STATIC ${ToolKit_src_list})
|
||||||
@ -182,34 +182,8 @@ elseif(NOT ANDROID OR IOS)
|
|||||||
list(APPEND LINK_LIB_LIST pthread)
|
list(APPEND LINK_LIB_LIST pthread)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
#测试程序
|
#测试程序
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
#主服务器
|
#主服务器
|
||||||
add_subdirectory(server)
|
add_subdirectory(server)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,8 @@
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
||||||
|
Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
|
Copyright (c) 2018 huohuo <913481084@qq.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -331,6 +331,8 @@ docker build -t zlmediakit .
|
|||||||
MIT License
|
MIT License
|
||||||
|
|
||||||
Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
Copyright (c) 2016-2019 xiongziliang <771730766@qq.com>
|
||||||
|
Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
|
Copyright (c) 2018 huohuo <913481084@qq.com>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -349,6 +351,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,6 +161,18 @@ maxRtpCount=50
|
|||||||
#视频mtu大小,该参数限制rtp最大字节数,推荐不要超过1400
|
#视频mtu大小,该参数限制rtp最大字节数,推荐不要超过1400
|
||||||
videoMtuSize=1400
|
videoMtuSize=1400
|
||||||
|
|
||||||
|
[rtp_proxy]
|
||||||
|
#udp类型的代理服务器是否检查rtp源地址,地址不配备将丢弃数据
|
||||||
|
checkSource=1
|
||||||
|
#导出调试数据(包括rtp/ps/h264)至该目录,置空则关闭数据导出
|
||||||
|
dumpDir=
|
||||||
|
#udp和tcp代理服务器,支持rtp(必须是ts或ps类型)代理
|
||||||
|
port=10000
|
||||||
|
#rtp如果是ts/ps类型则选择MP2P,还可以设置为MP4V-ES
|
||||||
|
rtp_type=MP2P
|
||||||
|
#rtp超时时间,单位秒
|
||||||
|
timeoutSec=15
|
||||||
|
|
||||||
[rtsp]
|
[rtsp]
|
||||||
#rtsp专有鉴权方式是采用base64还是md5方式
|
#rtsp专有鉴权方式是采用base64还是md5方式
|
||||||
authBasic=0
|
authBasic=0
|
||||||
|
@ -693,6 +693,7 @@ void installWebApi() {
|
|||||||
invoker.responseFile(headerIn,StrCaseMap(),exePath());
|
invoker.responseFile(headerIn,StrCaseMap(),exePath());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
API_REGIST(api,getSsrcInfo,{
|
API_REGIST(api,getSsrcInfo,{
|
||||||
CHECK_SECRET();
|
CHECK_SECRET();
|
||||||
CHECK_ARGS("ssrc");
|
CHECK_ARGS("ssrc");
|
||||||
@ -705,6 +706,7 @@ void installWebApi() {
|
|||||||
val["peer_ip"] = process->get_peer_ip();
|
val["peer_ip"] = process->get_peer_ip();
|
||||||
val["peer_port"] = process->get_peer_port();
|
val["peer_port"] = process->get_peer_port();
|
||||||
});
|
});
|
||||||
|
#endif//ENABLE_RTPPROXY
|
||||||
|
|
||||||
// 开始录制hls或MP4
|
// 开始录制hls或MP4
|
||||||
API_REGIST(api,startRecord,{
|
API_REGIST(api,startRecord,{
|
||||||
|
@ -38,11 +38,11 @@
|
|||||||
#include "Common/config.h"
|
#include "Common/config.h"
|
||||||
#include "Rtsp/UDPServer.h"
|
#include "Rtsp/UDPServer.h"
|
||||||
#include "Rtsp/RtspSession.h"
|
#include "Rtsp/RtspSession.h"
|
||||||
|
#include "Rtp/RtpSession.h"
|
||||||
#include "Rtmp/RtmpSession.h"
|
#include "Rtmp/RtmpSession.h"
|
||||||
#include "Shell/ShellSession.h"
|
#include "Shell/ShellSession.h"
|
||||||
#include "Rtmp/FlvMuxer.h"
|
|
||||||
#include "Player/PlayerProxy.h"
|
|
||||||
#include "Http/WebSocketSession.h"
|
#include "Http/WebSocketSession.h"
|
||||||
|
#include "Rtp/UdpRecver.h"
|
||||||
#include "WebApi.h"
|
#include "WebApi.h"
|
||||||
#include "WebHook.h"
|
#include "WebHook.h"
|
||||||
|
|
||||||
@ -58,36 +58,31 @@ namespace mediakit {
|
|||||||
////////////HTTP配置///////////
|
////////////HTTP配置///////////
|
||||||
namespace Http {
|
namespace Http {
|
||||||
#define HTTP_FIELD "http."
|
#define HTTP_FIELD "http."
|
||||||
#define HTTP_PORT 80
|
|
||||||
const string kPort = HTTP_FIELD"port";
|
const string kPort = HTTP_FIELD"port";
|
||||||
#define HTTPS_PORT 443
|
|
||||||
const string kSSLPort = HTTP_FIELD"sslport";
|
const string kSSLPort = HTTP_FIELD"sslport";
|
||||||
onceToken token1([](){
|
onceToken token1([](){
|
||||||
mINI::Instance()[kPort] = HTTP_PORT;
|
mINI::Instance()[kPort] = 80;
|
||||||
mINI::Instance()[kSSLPort] = HTTPS_PORT;
|
mINI::Instance()[kSSLPort] = 443;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
}//namespace Http
|
}//namespace Http
|
||||||
|
|
||||||
////////////SHELL配置///////////
|
////////////SHELL配置///////////
|
||||||
namespace Shell {
|
namespace Shell {
|
||||||
#define SHELL_FIELD "shell."
|
#define SHELL_FIELD "shell."
|
||||||
#define SHELL_PORT 9000
|
|
||||||
const string kPort = SHELL_FIELD"port";
|
const string kPort = SHELL_FIELD"port";
|
||||||
onceToken token1([](){
|
onceToken token1([](){
|
||||||
mINI::Instance()[kPort] = SHELL_PORT;
|
mINI::Instance()[kPort] = 9000;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
} //namespace Shell
|
} //namespace Shell
|
||||||
|
|
||||||
////////////RTSP服务器配置///////////
|
////////////RTSP服务器配置///////////
|
||||||
namespace Rtsp {
|
namespace Rtsp {
|
||||||
#define RTSP_FIELD "rtsp."
|
#define RTSP_FIELD "rtsp."
|
||||||
#define RTSP_PORT 554
|
|
||||||
#define RTSPS_PORT 322
|
|
||||||
const string kPort = RTSP_FIELD"port";
|
const string kPort = RTSP_FIELD"port";
|
||||||
const string kSSLPort = RTSP_FIELD"sslport";
|
const string kSSLPort = RTSP_FIELD"sslport";
|
||||||
onceToken token1([](){
|
onceToken token1([](){
|
||||||
mINI::Instance()[kPort] = RTSP_PORT;
|
mINI::Instance()[kPort] = 554;
|
||||||
mINI::Instance()[kSSLPort] = RTSPS_PORT;
|
mINI::Instance()[kSSLPort] = 332;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
|
|
||||||
} //namespace Rtsp
|
} //namespace Rtsp
|
||||||
@ -95,12 +90,21 @@ onceToken token1([](){
|
|||||||
////////////RTMP服务器配置///////////
|
////////////RTMP服务器配置///////////
|
||||||
namespace Rtmp {
|
namespace Rtmp {
|
||||||
#define RTMP_FIELD "rtmp."
|
#define RTMP_FIELD "rtmp."
|
||||||
#define RTMP_PORT 1935
|
|
||||||
const string kPort = RTMP_FIELD"port";
|
const string kPort = RTMP_FIELD"port";
|
||||||
onceToken token1([](){
|
onceToken token1([](){
|
||||||
mINI::Instance()[kPort] = RTMP_PORT;
|
mINI::Instance()[kPort] = 1935;
|
||||||
},nullptr);
|
},nullptr);
|
||||||
} //namespace RTMP
|
} //namespace RTMP
|
||||||
|
|
||||||
|
////////////Rtp代理相关配置///////////
|
||||||
|
namespace RtpProxy {
|
||||||
|
#define RTP_PROXY_FIELD "rtp_proxy."
|
||||||
|
const string kPort = RTP_PROXY_FIELD"port";
|
||||||
|
onceToken token1([](){
|
||||||
|
mINI::Instance()[kPort] = 10000;
|
||||||
|
},nullptr);
|
||||||
|
} //namespace RtpProxy
|
||||||
|
|
||||||
} // namespace mediakit
|
} // namespace mediakit
|
||||||
|
|
||||||
|
|
||||||
@ -269,6 +273,7 @@ int start_main(int argc,char *argv[]) {
|
|||||||
uint16_t rtmpPort = mINI::Instance()[Rtmp::kPort];
|
uint16_t rtmpPort = mINI::Instance()[Rtmp::kPort];
|
||||||
uint16_t httpPort = mINI::Instance()[Http::kPort];
|
uint16_t httpPort = mINI::Instance()[Http::kPort];
|
||||||
uint16_t httpsPort = mINI::Instance()[Http::kSSLPort];
|
uint16_t httpsPort = mINI::Instance()[Http::kSSLPort];
|
||||||
|
uint16_t rtp_proxy = mINI::Instance()[RtpProxy::kPort];
|
||||||
|
|
||||||
//设置poller线程数,该函数必须在使用ZLToolKit网络相关对象之前调用才能生效
|
//设置poller线程数,该函数必须在使用ZLToolKit网络相关对象之前调用才能生效
|
||||||
EventPollerPool::setPoolSize(threads);
|
EventPollerPool::setPoolSize(threads);
|
||||||
@ -284,6 +289,11 @@ int start_main(int argc,char *argv[]) {
|
|||||||
//支持ssl加密的rtsp服务器,可用于诸如亚马逊echo show这样的设备访问
|
//支持ssl加密的rtsp服务器,可用于诸如亚马逊echo show这样的设备访问
|
||||||
TcpServer::Ptr rtspSSLSrv(new TcpServer());
|
TcpServer::Ptr rtspSSLSrv(new TcpServer());
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
UdpRecver recver;
|
||||||
|
TcpServer::Ptr tcpRtpServer(new TcpServer());
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
//rtsp服务器,端口默认554
|
//rtsp服务器,端口默认554
|
||||||
rtspSrv->start<RtspSession>(rtspPort);//默认554
|
rtspSrv->start<RtspSession>(rtspPort);//默认554
|
||||||
@ -297,6 +307,14 @@ int start_main(int argc,char *argv[]) {
|
|||||||
httpsSrv->start<HttpsSession>(httpsPort);
|
httpsSrv->start<HttpsSession>(httpsPort);
|
||||||
//telnet远程调试服务器
|
//telnet远程调试服务器
|
||||||
shellSrv->start<ShellSession>(shellPort);
|
shellSrv->start<ShellSession>(shellPort);
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
//创建rtp udp服务器
|
||||||
|
recver.initSock(rtp_proxy);
|
||||||
|
//创建rtp tcp服务器
|
||||||
|
tcpRtpServer->start<RtpSession>(rtp_proxy);
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
|
||||||
}catch (std::exception &ex){
|
}catch (std::exception &ex){
|
||||||
WarnL << "端口占用或无权限:" << ex.what() << endl;
|
WarnL << "端口占用或无权限:" << ex.what() << endl;
|
||||||
ErrorL << "程序启动失败,请修改配置文件中端口号后重试!" << endl;
|
ErrorL << "程序启动失败,请修改配置文件中端口号后重试!" << endl;
|
||||||
|
@ -275,6 +275,28 @@ onceToken token([](){
|
|||||||
},nullptr);
|
},nullptr);
|
||||||
} //namespace Hls
|
} //namespace Hls
|
||||||
|
|
||||||
|
|
||||||
|
////////////Rtp代理相关配置///////////
|
||||||
|
namespace RtpProxy {
|
||||||
|
#define RTP_PROXY_FIELD "rtp_proxy."
|
||||||
|
//rtp调试数据保存目录
|
||||||
|
const string kDumpDir = RTP_PROXY_FIELD"dumpDir";
|
||||||
|
//是否限制udp数据来源ip和端口
|
||||||
|
const string kCheckSource = RTP_PROXY_FIELD"checkSource";
|
||||||
|
//rtp类型,支持MP2P/MP4V-ES
|
||||||
|
const string kRtpType = RTP_PROXY_FIELD"rtp_type";
|
||||||
|
//rtp接收超时时间
|
||||||
|
const string kTimeoutSec = RTP_PROXY_FIELD"timeoutSec";
|
||||||
|
|
||||||
|
onceToken token([](){
|
||||||
|
mINI::Instance()[kDumpDir] = "";
|
||||||
|
mINI::Instance()[kCheckSource] = 1;
|
||||||
|
mINI::Instance()[kRtpType] = "MP2P";
|
||||||
|
mINI::Instance()[kTimeoutSec] = 15;
|
||||||
|
},nullptr);
|
||||||
|
} //namespace RtpProxy
|
||||||
|
|
||||||
|
|
||||||
namespace Client {
|
namespace Client {
|
||||||
const string kNetAdapter = "net_adapter";
|
const string kNetAdapter = "net_adapter";
|
||||||
const string kRtpType = "rtp_type";
|
const string kRtpType = "rtp_type";
|
||||||
|
@ -159,11 +159,6 @@ extern const string kBroadcastReloadConfig;
|
|||||||
static type arg = mINI::Instance()[key]; \
|
static type arg = mINI::Instance()[key]; \
|
||||||
LISTEN_RELOAD_KEY(arg,key);
|
LISTEN_RELOAD_KEY(arg,key);
|
||||||
|
|
||||||
|
|
||||||
//兼容老代码
|
|
||||||
#define GET_CONFIG_AND_REGISTER GET_CONFIG
|
|
||||||
#define BroadcastRtmpPublishArgs BroadcastMediaPublishArgs
|
|
||||||
#define kBroadcastRtmpPublish kBroadcastMediaPublish
|
|
||||||
} //namespace Broadcast
|
} //namespace Broadcast
|
||||||
|
|
||||||
////////////通用配置///////////
|
////////////通用配置///////////
|
||||||
@ -301,6 +296,17 @@ extern const string kFileBufSize;
|
|||||||
extern const string kFilePath;
|
extern const string kFilePath;
|
||||||
} //namespace Hls
|
} //namespace Hls
|
||||||
|
|
||||||
|
////////////Rtp代理相关配置///////////
|
||||||
|
namespace RtpProxy {
|
||||||
|
//rtp调试数据保存目录,置空则不生成
|
||||||
|
extern const string kDumpDir;
|
||||||
|
//是否限制udp数据来源ip和端口
|
||||||
|
extern const string kCheckSource;
|
||||||
|
//rtp类型,支持MP2P/MP4V-ES
|
||||||
|
extern const string kRtpType;
|
||||||
|
//rtp接收超时时间
|
||||||
|
extern const string kTimeoutSec;
|
||||||
|
} //namespace RtpProxy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rtsp/rtmp播放器、推流器相关设置名,
|
* rtsp/rtmp播放器、推流器相关设置名,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,7 +24,11 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "PSDecoder.h"
|
#include "PSDecoder.h"
|
||||||
|
#include "mpeg-ps.h"
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
PSDecoder::PSDecoder() {
|
PSDecoder::PSDecoder() {
|
||||||
_ps_demuxer = ps_demuxer_create([](void* param,
|
_ps_demuxer = ps_demuxer_create([](void* param,
|
||||||
@ -41,9 +45,13 @@ PSDecoder::PSDecoder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PSDecoder::~PSDecoder() {
|
PSDecoder::~PSDecoder() {
|
||||||
ps_demuxer_destroy(_ps_demuxer);
|
ps_demuxer_destroy((struct ps_demuxer_t*)_ps_demuxer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PSDecoder::decodePS(const uint8_t *data, size_t bytes) {
|
int PSDecoder::decodePS(const uint8_t *data, int bytes) {
|
||||||
return ps_demuxer_input(_ps_demuxer,data,bytes);
|
return ps_demuxer_input((struct ps_demuxer_t*)_ps_demuxer,data,bytes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
|
||||||
|
#endif//#if defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,23 +24,19 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTPPROXY_PSDECODER_H
|
#ifndef ZLMEDIAKIT_PSDECODER_H
|
||||||
#define RTPPROXY_PSDECODER_H
|
#define ZLMEDIAKIT_PSDECODER_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#if defined(ENABLE_RTPPROXY)
|
||||||
extern "C" {
|
#include <stdint.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "mpeg-ps.h"
|
namespace mediakit{
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class PSDecoder {
|
class PSDecoder {
|
||||||
public:
|
public:
|
||||||
PSDecoder();
|
PSDecoder();
|
||||||
virtual ~PSDecoder();
|
virtual ~PSDecoder();
|
||||||
int decodePS(const uint8_t *data, size_t bytes);
|
int decodePS(const uint8_t *data, int bytes);
|
||||||
protected:
|
protected:
|
||||||
virtual void onPSDecode(int stream,
|
virtual void onPSDecode(int stream,
|
||||||
int codecid,
|
int codecid,
|
||||||
@ -48,10 +44,12 @@ protected:
|
|||||||
int64_t pts,
|
int64_t pts,
|
||||||
int64_t dts,
|
int64_t dts,
|
||||||
const void *data,
|
const void *data,
|
||||||
size_t bytes) = 0;
|
int bytes) = 0;
|
||||||
private:
|
private:
|
||||||
struct ps_demuxer_t *_ps_demuxer = nullptr;
|
void *_ps_demuxer = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
|
||||||
#endif //RTPPROXY_PSDECODER_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_PSDECODER_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,11 +24,16 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include "Util/logger.h"
|
#include "Util/logger.h"
|
||||||
#include "RtpDecoder.h"
|
#include "RtpDecoder.h"
|
||||||
|
#include "rtp-payload.h"
|
||||||
|
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
RtpDecoder::RtpDecoder() {
|
RtpDecoder::RtpDecoder() {
|
||||||
_buffer = std::make_shared<BufferRaw>();
|
_buffer = std::make_shared<BufferRaw>();
|
||||||
}
|
}
|
||||||
@ -68,3 +73,6 @@ void RtpDecoder::decodeRtp(const void *data, int bytes,const char *type_name) {
|
|||||||
rtp_payload_decode_input(_rtp_decoder,data,bytes);
|
rtp_payload_decode_input(_rtp_decoder,data,bytes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,20 +24,14 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef IPTV_RTPTOTS_H
|
#ifndef ZLMEDIAKIT_RTPDECODER_H
|
||||||
#define IPTV_RTPTOTS_H
|
#define ZLMEDIAKIT_RTPDECODER_H
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "Network/Buffer.h"
|
#include "Network/Buffer.h"
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "rtp-payload.h"
|
namespace mediakit{
|
||||||
#include "mpeg-ts.h"
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
class RtpDecoder {
|
class RtpDecoder {
|
||||||
public:
|
public:
|
||||||
@ -51,5 +45,6 @@ private:
|
|||||||
BufferRaw::Ptr _buffer;
|
BufferRaw::Ptr _buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
#endif //IPTV_RTPTOTS_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_RTPDECODER_H
|
||||||
|
@ -1,79 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
|
||||||
*
|
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <cstdint>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include "RtpFileLoader.h"
|
|
||||||
#include "Util/logger.h"
|
|
||||||
#include "RtpSelector.h"
|
|
||||||
using namespace toolkit;
|
|
||||||
|
|
||||||
bool RtpFileLoader::loadFile(const char *path) {
|
|
||||||
FILE *fp = fopen(path, "rb");
|
|
||||||
if (!fp) {
|
|
||||||
WarnL << "open file failed:" << path;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t timeStamp_last = 0;
|
|
||||||
uint16_t len;
|
|
||||||
char rtp[2 * 1024];
|
|
||||||
while (true) {
|
|
||||||
if (2 != fread(&len, 1, 2, fp)) {
|
|
||||||
WarnL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
len = ntohs(len);
|
|
||||||
if (len < 12 || len > sizeof(rtp)) {
|
|
||||||
WarnL << len;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (len != fread(rtp, 1, len, fp)) {
|
|
||||||
WarnL;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint32_t timeStamp;
|
|
||||||
memcpy(&timeStamp, rtp + 4, 4);
|
|
||||||
timeStamp = ntohl(timeStamp);
|
|
||||||
timeStamp /= 90;
|
|
||||||
|
|
||||||
if(timeStamp_last){
|
|
||||||
auto diff = timeStamp - timeStamp_last;
|
|
||||||
if(diff > 0){
|
|
||||||
usleep(diff * 1000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
timeStamp_last = timeStamp;
|
|
||||||
RtpSelector::Instance().inputRtp(rtp,len, nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
fclose(fp);
|
|
||||||
return true;
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
/*
|
|
||||||
* MIT License
|
|
||||||
*
|
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
|
||||||
*
|
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
|
||||||
* in the Software without restriction, including without limitation the rights
|
|
||||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
* copies of the Software, and to permit persons to whom the Software is
|
|
||||||
* furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included in all
|
|
||||||
* copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
* SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RTPPROXY_RTPFILELOADER_H
|
|
||||||
#define RTPPROXY_RTPFILELOADER_H
|
|
||||||
|
|
||||||
|
|
||||||
class RtpFileLoader {
|
|
||||||
public:
|
|
||||||
RtpFileLoader(){};
|
|
||||||
~RtpFileLoader(){};
|
|
||||||
static bool loadFile(const char *path);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //RTPPROXY_RTPFILELOADER_H
|
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,34 +24,14 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
#include "mpeg-ps.h"
|
||||||
#include "RtpProcess.h"
|
#include "RtpProcess.h"
|
||||||
#include "Util/File.h"
|
#include "Util/File.h"
|
||||||
#include "Util/logger.h"
|
|
||||||
#include "Extension/H265.h"
|
#include "Extension/H265.h"
|
||||||
#include "Extension/H264.h"
|
|
||||||
#include "Extension/AAC.h"
|
#include "Extension/AAC.h"
|
||||||
|
|
||||||
using namespace toolkit;
|
namespace mediakit{
|
||||||
|
|
||||||
namespace dump {
|
|
||||||
const string kEnable = "dump.enable";
|
|
||||||
const string kDir = "dump.dir";
|
|
||||||
const string kChcekSource = "dump.checkSource";
|
|
||||||
onceToken token([](){
|
|
||||||
mINI::Instance()[kEnable] = 0;
|
|
||||||
mINI::Instance()[kDir] = "./dump/";
|
|
||||||
mINI::Instance()[kChcekSource] = 1;
|
|
||||||
});
|
|
||||||
}//namespace dump
|
|
||||||
|
|
||||||
namespace Rtp {
|
|
||||||
const string kRtpType = "rtp.rtp_type";
|
|
||||||
const string kTimeoutSec = "rtp.timeoutSec";
|
|
||||||
onceToken token([](){
|
|
||||||
mINI::Instance()[kRtpType] = "MP2P";
|
|
||||||
mINI::Instance()[kTimeoutSec] = 15;
|
|
||||||
});
|
|
||||||
}//namespace dump
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合并一些时间戳相同的frame
|
* 合并一些时间戳相同的frame
|
||||||
@ -106,10 +86,9 @@ RtpProcess::RtpProcess(uint32_t ssrc) {
|
|||||||
DebugL << printSSRC(_ssrc);
|
DebugL << printSSRC(_ssrc);
|
||||||
_muxer = std::make_shared<MultiMediaSourceMuxer>(DEFAULT_VHOST,"rtp",printSSRC(_ssrc));
|
_muxer = std::make_shared<MultiMediaSourceMuxer>(DEFAULT_VHOST,"rtp",printSSRC(_ssrc));
|
||||||
|
|
||||||
GET_CONFIG(bool,dump_enable,dump::kEnable);
|
GET_CONFIG(string,dump_dir,RtpProxy::kDumpDir);
|
||||||
GET_CONFIG(string,dump_dir,dump::kDir);
|
|
||||||
{
|
{
|
||||||
FILE *fp = dump_enable ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".rtp",dump_dir).data(),"wb") : nullptr;
|
FILE *fp = !dump_dir.empty() ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".rtp",dump_dir).data(),"wb") : nullptr;
|
||||||
if(fp){
|
if(fp){
|
||||||
_save_file_rtp.reset(fp,[](FILE *fp){
|
_save_file_rtp.reset(fp,[](FILE *fp){
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -118,7 +97,7 @@ RtpProcess::RtpProcess(uint32_t ssrc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
FILE *fp = dump_enable ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".mp2",dump_dir).data(),"wb") : nullptr;
|
FILE *fp = !dump_dir.empty() ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".mp2",dump_dir).data(),"wb") : nullptr;
|
||||||
if(fp){
|
if(fp){
|
||||||
_save_file_ps.reset(fp,[](FILE *fp){
|
_save_file_ps.reset(fp,[](FILE *fp){
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -127,7 +106,7 @@ RtpProcess::RtpProcess(uint32_t ssrc) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
FILE *fp = dump_enable ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".video",dump_dir).data(),"wb") : nullptr;
|
FILE *fp = !dump_dir.empty() ? File::createfile_file(File::absolutePath(printSSRC(_ssrc) + ".video",dump_dir).data(),"wb") : nullptr;
|
||||||
if(fp){
|
if(fp){
|
||||||
_save_file_video.reset(fp,[](FILE *fp){
|
_save_file_video.reset(fp,[](FILE *fp){
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@ -147,7 +126,7 @@ RtpProcess::~RtpProcess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RtpProcess::inputRtp(const char *data, int data_len,const struct sockaddr *addr) {
|
bool RtpProcess::inputRtp(const char *data, int data_len,const struct sockaddr *addr) {
|
||||||
GET_CONFIG(bool,check_source,dump::kChcekSource);
|
GET_CONFIG(bool,check_source,RtpProxy::kCheckSource);
|
||||||
//检查源是否合法
|
//检查源是否合法
|
||||||
if(!_addr){
|
if(!_addr){
|
||||||
_addr = new struct sockaddr;
|
_addr = new struct sockaddr;
|
||||||
@ -177,7 +156,7 @@ void RtpProcess::onRtpSorted(const RtpPacket::Ptr &rtp, int) {
|
|||||||
fwrite((uint8_t *) rtp->data() + 4, rtp->size() - 4, 1, _save_file_rtp.get());
|
fwrite((uint8_t *) rtp->data() + 4, rtp->size() - 4, 1, _save_file_rtp.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
GET_CONFIG(string,rtp_type,::Rtp::kRtpType);
|
GET_CONFIG(string,rtp_type,::RtpProxy::kRtpType);
|
||||||
decodeRtp(rtp->data() + 4 ,rtp->size() - 4,rtp_type.data());
|
decodeRtp(rtp->data() + 4 ,rtp->size() - 4,rtp_type.data());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +177,7 @@ void RtpProcess::onPSDecode(int stream,
|
|||||||
int64_t pts,
|
int64_t pts,
|
||||||
int64_t dts,
|
int64_t dts,
|
||||||
const void *data,
|
const void *data,
|
||||||
size_t bytes) {
|
int bytes) {
|
||||||
|
|
||||||
switch (codecid) {
|
switch (codecid) {
|
||||||
case STREAM_VIDEO_H264: {
|
case STREAM_VIDEO_H264: {
|
||||||
@ -270,7 +249,7 @@ void RtpProcess::onPSDecode(int stream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool RtpProcess::alive() {
|
bool RtpProcess::alive() {
|
||||||
GET_CONFIG(int,timeoutSec,::Rtp::kTimeoutSec)
|
GET_CONFIG(int,timeoutSec,RtpProxy::kTimeoutSec)
|
||||||
if(_last_rtp_time.elapsedTime() / 1000 < timeoutSec){
|
if(_last_rtp_time.elapsedTime() / 1000 < timeoutSec){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -284,3 +263,6 @@ string RtpProcess::get_peer_ip() {
|
|||||||
uint16_t RtpProcess::get_peer_port() {
|
uint16_t RtpProcess::get_peer_port() {
|
||||||
return ntohs(((struct sockaddr_in *) _addr)->sin_port);
|
return ntohs(((struct sockaddr_in *) _addr)->sin_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,8 +24,10 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTPPROXY_RTPDECODER_H
|
#ifndef ZLMEDIAKIT_RTPPROCESS_H
|
||||||
#define RTPPROXY_RTPDECODER_H
|
#define ZLMEDIAKIT_RTPPROCESS_H
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
|
||||||
#include "Rtsp/RtpReceiver.h"
|
#include "Rtsp/RtpReceiver.h"
|
||||||
#include "RtpDecoder.h"
|
#include "RtpDecoder.h"
|
||||||
@ -33,6 +35,8 @@
|
|||||||
#include "Common/Device.h"
|
#include "Common/Device.h"
|
||||||
using namespace mediakit;
|
using namespace mediakit;
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
string printSSRC(uint32_t ui32Ssrc);
|
string printSSRC(uint32_t ui32Ssrc);
|
||||||
|
|
||||||
class FrameMerger;
|
class FrameMerger;
|
||||||
@ -54,7 +58,7 @@ protected:
|
|||||||
int64_t pts,
|
int64_t pts,
|
||||||
int64_t dts,
|
int64_t dts,
|
||||||
const void *data,
|
const void *data,
|
||||||
size_t bytes) override ;
|
int bytes) override ;
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<FILE> _save_file_rtp;
|
std::shared_ptr<FILE> _save_file_rtp;
|
||||||
std::shared_ptr<FILE> _save_file_ps;
|
std::shared_ptr<FILE> _save_file_ps;
|
||||||
@ -70,5 +74,6 @@ private:
|
|||||||
Ticker _last_rtp_time;
|
Ticker _last_rtp_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
#endif //RTPPROXY_RTPDECODER_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_RTPPROCESS_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,8 +24,11 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "RtpSelector.h"
|
#include "RtpSelector.h"
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
INSTANCE_IMP(RtpSelector);
|
INSTANCE_IMP(RtpSelector);
|
||||||
|
|
||||||
bool RtpSelector::inputRtp(const char *data, int data_len,const struct sockaddr *addr) {
|
bool RtpSelector::inputRtp(const char *data, int data_len,const struct sockaddr *addr) {
|
||||||
@ -97,3 +100,6 @@ RtpSelector::RtpSelector() {
|
|||||||
|
|
||||||
RtpSelector::~RtpSelector() {
|
RtpSelector::~RtpSelector() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,14 +24,16 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTPPROXY_RTPSELECTOR_H
|
#ifndef ZLMEDIAKIT_RTPSELECTOR_H
|
||||||
#define RTPPROXY_RTPSELECTOR_H
|
#define ZLMEDIAKIT_RTPSELECTOR_H
|
||||||
|
|
||||||
#include <cstdint>
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
#include <stdint.h>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include "RtpProcess.h"
|
#include "RtpProcess.h"
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
class RtpSelector : public std::enable_shared_from_this<RtpSelector>{
|
class RtpSelector : public std::enable_shared_from_this<RtpSelector>{
|
||||||
public:
|
public:
|
||||||
@ -51,5 +53,6 @@ private:
|
|||||||
Ticker _last_rtp_time;
|
Ticker _last_rtp_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
#endif //RTPPROXY_RTPSELECTOR_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_RTPSELECTOR_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -23,8 +23,11 @@
|
|||||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "RtpSession.h"
|
#include "RtpSession.h"
|
||||||
#include "RtpSelector.h"
|
#include "RtpSelector.h"
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
RtpSession::RtpSession(const Socket::Ptr &sock) : TcpSession(sock) {
|
RtpSession::RtpSession(const Socket::Ptr &sock) : TcpSession(sock) {
|
||||||
DebugP(this);
|
DebugP(this);
|
||||||
@ -70,3 +73,6 @@ void RtpSession::onRtpPacket(const char *data, uint64_t len) {
|
|||||||
_process->inputRtp(data + 2,len - 2,&addr);
|
_process->inputRtp(data + 2,len - 2,&addr);
|
||||||
_ticker.resetTime();
|
_ticker.resetTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,16 +24,18 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTPPROXY_RTPSESSION_H
|
#ifndef ZLMEDIAKIT_RTPSESSION_H
|
||||||
#define RTPPROXY_RTPSESSION_H
|
#define ZLMEDIAKIT_RTPSESSION_H
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "Network/TcpSession.h"
|
#include "Network/TcpSession.h"
|
||||||
#include "RtpSplitter.h"
|
#include "RtpSplitter.h"
|
||||||
#include "RtpProcess.h"
|
#include "RtpProcess.h"
|
||||||
#include "Util/TimeTicker.h"
|
#include "Util/TimeTicker.h"
|
||||||
|
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
class RtpSession : public TcpSession , public RtpSplitter{
|
class RtpSession : public TcpSession , public RtpSplitter{
|
||||||
public:
|
public:
|
||||||
RtpSession(const Socket::Ptr &sock);
|
RtpSession(const Socket::Ptr &sock);
|
||||||
@ -50,5 +52,6 @@ private:
|
|||||||
struct sockaddr addr;
|
struct sockaddr addr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
#endif //RTPPROXY_RTPSESSION_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_RTPSESSION_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,7 +24,9 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "RtpSplitter.h"
|
#include "RtpSplitter.h"
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
RtpSplitter::RtpSplitter() {
|
RtpSplitter::RtpSplitter() {
|
||||||
}
|
}
|
||||||
@ -51,3 +53,6 @@ int64_t RtpSplitter::onRecvHeader(const char *data, uint64_t len) {
|
|||||||
onRtpPacket(data,len);
|
onRtpPacket(data,len);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,11 +24,13 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef RTPPROXY_RTPSPLITTER_H
|
#ifndef ZLMEDIAKIT_RTPSPLITTER_H
|
||||||
#define RTPPROXY_RTPSPLITTER_H
|
#define ZLMEDIAKIT_RTPSPLITTER_H
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "Http/HttpRequestSplitter.h"
|
#include "Http/HttpRequestSplitter.h"
|
||||||
using namespace mediakit;
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
class RtpSplitter : public HttpRequestSplitter{
|
class RtpSplitter : public HttpRequestSplitter{
|
||||||
public:
|
public:
|
||||||
@ -46,5 +48,6 @@ protected:
|
|||||||
int64_t onRecvHeader(const char *data,uint64_t len) override;
|
int64_t onRecvHeader(const char *data,uint64_t len) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
#endif //RTPPROXY_RTPSPLITTER_H
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
|
#endif //ZLMEDIAKIT_RTPSPLITTER_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -24,8 +24,11 @@
|
|||||||
* SOFTWARE.
|
* SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include "UdpRecver.h"
|
#include "UdpRecver.h"
|
||||||
#include "RtpSelector.h"
|
#include "RtpSelector.h"
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
UdpRecver::UdpRecver() {
|
UdpRecver::UdpRecver() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,3 +51,6 @@ bool UdpRecver::initSock(uint16_t local_port,const char *local_ip) {
|
|||||||
EventPoller::Ptr UdpRecver::getPoller() {
|
EventPoller::Ptr UdpRecver::getPoller() {
|
||||||
return _sock->getPoller();
|
return _sock->getPoller();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -27,11 +27,14 @@
|
|||||||
#ifndef ZLMEDIAKIT_UDPRECVER_H
|
#ifndef ZLMEDIAKIT_UDPRECVER_H
|
||||||
#define ZLMEDIAKIT_UDPRECVER_H
|
#define ZLMEDIAKIT_UDPRECVER_H
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include "Network/Socket.h"
|
#include "Network/Socket.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
|
|
||||||
|
namespace mediakit{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 组播接收器
|
* 组播接收器
|
||||||
*/
|
*/
|
||||||
@ -48,5 +51,6 @@ protected:
|
|||||||
Socket::Ptr _sock;
|
Socket::Ptr _sock;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}//namespace mediakit
|
||||||
|
#endif//defined(ENABLE_RTPPROXY)
|
||||||
#endif //ZLMEDIAKIT_UDPRECVER_H
|
#endif //ZLMEDIAKIT_UDPRECVER_H
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* MIT License
|
* MIT License
|
||||||
*
|
*
|
||||||
* Copyright (c) 2016-2019 Gemfield <gemfield@civilnet.cn>
|
* Copyright (c) 2019 Gemfield <gemfield@civilnet.cn>
|
||||||
*
|
*
|
||||||
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
||||||
*
|
*
|
||||||
@ -36,16 +36,64 @@
|
|||||||
#include "Rtsp/RtspSession.h"
|
#include "Rtsp/RtspSession.h"
|
||||||
#include "Rtmp/RtmpSession.h"
|
#include "Rtmp/RtmpSession.h"
|
||||||
#include "Http/HttpSession.h"
|
#include "Http/HttpSession.h"
|
||||||
#include "Rtp/RtpFileLoader.h"
|
#include "Rtp/RtpSelector.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace toolkit;
|
using namespace toolkit;
|
||||||
using namespace mediakit;
|
using namespace mediakit;
|
||||||
|
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
|
static bool loadFile(const char *path){
|
||||||
|
FILE *fp = fopen(path, "rb");
|
||||||
|
if (!fp) {
|
||||||
|
WarnL << "open file failed:" << path;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t timeStamp_last = 0;
|
||||||
|
uint16_t len;
|
||||||
|
char rtp[2 * 1024];
|
||||||
|
while (true) {
|
||||||
|
if (2 != fread(&len, 1, 2, fp)) {
|
||||||
|
WarnL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
len = ntohs(len);
|
||||||
|
if (len < 12 || len > sizeof(rtp)) {
|
||||||
|
WarnL << len;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (len != fread(rtp, 1, len, fp)) {
|
||||||
|
WarnL;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32_t timeStamp;
|
||||||
|
memcpy(&timeStamp, rtp + 4, 4);
|
||||||
|
timeStamp = ntohl(timeStamp);
|
||||||
|
timeStamp /= 90;
|
||||||
|
|
||||||
|
if(timeStamp_last){
|
||||||
|
auto diff = timeStamp - timeStamp_last;
|
||||||
|
if(diff > 0){
|
||||||
|
usleep(diff * 1000);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timeStamp_last = timeStamp;
|
||||||
|
|
||||||
|
RtpSelector::Instance().inputRtp(rtp,len, nullptr);
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif//#if defined(ENABLE_RTPPROXY)
|
||||||
|
|
||||||
int main(int argc,char *argv[]) {
|
int main(int argc,char *argv[]) {
|
||||||
{
|
|
||||||
//设置日志
|
//设置日志
|
||||||
Logger::Instance().add(std::make_shared<ConsoleChannel>("ConsoleChannel"));
|
Logger::Instance().add(std::make_shared<ConsoleChannel>("ConsoleChannel"));
|
||||||
|
#if defined(ENABLE_RTPPROXY)
|
||||||
//启动异步日志线程
|
//启动异步日志线程
|
||||||
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
|
Logger::Instance().setWriter(std::make_shared<AsyncLogWriter>());
|
||||||
loadIniConfig((exeDir() + "config.ini").data());
|
loadIniConfig((exeDir() + "config.ini").data());
|
||||||
@ -55,10 +103,11 @@ int main(int argc,char *argv[]) {
|
|||||||
rtspSrv->start<RtspSession>(554);//默认554
|
rtspSrv->start<RtspSession>(554);//默认554
|
||||||
rtmpSrv->start<RtmpSession>(1935);//默认1935
|
rtmpSrv->start<RtmpSession>(1935);//默认1935
|
||||||
httpSrv->start<HttpSession>(80);//默认80
|
httpSrv->start<HttpSession>(80);//默认80
|
||||||
RtpFileLoader::loadFile(argv[1]);
|
loadFile(argv[1]);
|
||||||
}
|
#else
|
||||||
|
ErrorL << "please ENABLE_RTPPROXY and then test";
|
||||||
|
#endif//#if defined(ENABLE_RTPPROXY)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user