移除非主线内容

pull/1411/head
648540858 2024-04-09 10:30:00 +08:00
parent a1c02605c1
commit 0b2f635176
18 changed files with 0 additions and 4385 deletions

View File

@ -1,413 +0,0 @@
package com.genersoft.iot.vmp.media.abl;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
import com.genersoft.iot.vmp.gb28181.session.AudioBroadcastManager;
import com.genersoft.iot.vmp.gb28181.session.SSRCFactory;
import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager;
import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
import com.genersoft.iot.vmp.media.abl.bean.hook.*;
import com.genersoft.iot.vmp.media.abl.event.HookAblServerKeepaliveEvent;
import com.genersoft.iot.vmp.media.abl.event.HookAblServerStartEvent;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import com.genersoft.iot.vmp.media.bean.ResultForOnPublish;
import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
import com.genersoft.iot.vmp.media.event.media.MediaDepartureEvent;
import com.genersoft.iot.vmp.media.event.media.MediaNotFoundEvent;
import com.genersoft.iot.vmp.media.event.media.MediaRtpServerTimeoutEvent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.media.zlm.ZLMMediaListManager;
import com.genersoft.iot.vmp.media.zlm.dto.hook.HookResult;
import com.genersoft.iot.vmp.media.zlm.dto.hook.HookResultForOnPublish;
import com.genersoft.iot.vmp.service.*;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/**
* ABL hook
*/
@RestController
@RequestMapping("/index/hook/abl")
public class ABLHttpHookListener {
private final static Logger logger = LoggerFactory.getLogger(ABLHttpHookListener.class);
@Autowired
private ABLRESTfulUtils ablresTfulUtils;
@Autowired
private ISIPCommanderForPlatform commanderFroPlatform;
@Autowired
private AudioBroadcastManager audioBroadcastManager;
@Autowired
private IPlayService playService;
@Autowired
private IVideoManagerStorage storager;
@Autowired
private IRedisCatchStorage redisCatchStorage;
@Autowired
private IInviteStreamService inviteStreamService;
@Autowired
private IDeviceService deviceService;
@Autowired
private IMediaServerService mediaServerService;
@Autowired
private IStreamProxyService streamProxyService;
@Autowired
private DeferredResultHolder resultHolder;
@Autowired
private IMediaService mediaService;
@Autowired
private EventPublisher eventPublisher;
@Autowired
private ZLMMediaListManager zlmMediaListManager;
@Autowired
private HookSubscribe subscribe;
@Autowired
private UserSetting userSetting;
@Autowired
private IUserService userService;
@Autowired
private ICloudRecordService cloudRecordService;
@Autowired
private VideoStreamSessionManager sessionManager;
@Autowired
private SSRCFactory ssrcFactory;
@Qualifier("taskExecutor")
@Autowired
private ThreadPoolTaskExecutor taskExecutor;
@Autowired
private RedisTemplate<Object, Object> redisTemplate;
@Autowired
private ApplicationEventPublisher applicationEventPublisher;
/**
* 10s
*/
@ResponseBody
@PostMapping(value = "/on_server_keepalive", produces = "application/json;charset=UTF-8")
public HookResult onServerKeepalive(@RequestBody OnServerKeepaliveABLHookParam param) {
try {
HookAblServerKeepaliveEvent event = new HookAblServerKeepaliveEvent(this);
MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
if (mediaServerItem != null) {
event.setMediaServerItem(mediaServerItem);
applicationEventPublisher.publishEvent(event);
}
}catch (Exception e) {
logger.info("[ZLM-HOOK-心跳] 发送通知失败 ", e);
}
return HookResult.SUCCESS();
}
/**
* rtsp/rtmp/http-flv/ws-flv/hls
*/
@ResponseBody
@PostMapping(value = "/on_play", produces = "application/json;charset=UTF-8")
public HookResult onPlay(@RequestBody OnPlayABLHookParam param) {
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (mediaServer == null) {
return new HookResultForOnPublish(0, "success");
}
Map<String, String> paramMap = urlParamToMap(param.getParams());
// 对于播放流进行鉴权
boolean authenticateResult = mediaService.authenticatePlay(param.getApp(), param.getStream(), paramMap.get("callId"));
if (!authenticateResult) {
logger.info("[ABL HOOK] 播放鉴权 失败:{}->{}", param.getMediaServerId(), param);
ablresTfulUtils.closeStreams(mediaServer, param.getApp(), param.getStream());
}
logger.info("[ABL HOOK] 播放鉴权成功:{}->{}", param.getMediaServerId(), param);
return HookResult.SUCCESS();
}
/**
* rtsp/rtmp/rtp
*/
@ResponseBody
@PostMapping(value = "/on_publish", produces = "application/json;charset=UTF-8")
public HookResult onPublish(@RequestBody OnPublishABLHookParam param) {
logger.info("[ABL HOOK]推流鉴权:{}->{}", param.getMediaServerId(), param);
// TODO 加快处理速度
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (mediaServer == null) {
return new HookResultForOnPublish(0, "success");
}
ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams());
if (resultForOnPublish == null) {
logger.info("[ABL HOOK]推流鉴权 拒绝 响应:{}->{}", param.getMediaServerId(), param);
ablresTfulUtils.closeStreams(mediaServer, param.getApp(), param.getStream());
}
return HookResult.SUCCESS();
}
/**
* MP4enable_mp4=1
*/
@ResponseBody
@PostMapping(value = "/on_record_progress", produces = "application/json;charset=UTF-8")
public HookResult onRecordProgress(@RequestBody OnRecordProgressABLHookParam param) {
logger.info("[ABL HOOK] 录像进度通知:{}->{}/{}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream(), param.getCurrentFileDuration(), param.getTotalVideoDuration());
// TODO 这里用来做录像进度
// MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
// if (mediaServer == null) {
// return new HookResultForOnPublish(0, "success");
// }
//
// ResultForOnPublish resultForOnPublish = mediaService.authenticatePublish(mediaServer, param.getApp(), param.getStream(), param.getParams());
// if (resultForOnPublish == null) {
// logger.info("[ABL HOOK]推流鉴权 拒绝 响应:{}->{}", param.getMediaServerId(), param);
// ablresTfulUtils.closeStreams(mediaServer, param.getApp(), param.getStream());
// }
return HookResult.SUCCESS();
}
/**
*
*/
@ResponseBody
@PostMapping(value = "/on_stream_not_arrive", produces = "application/json;charset=UTF-8")
public HookResult onStreamNotArrive(@RequestBody ABLHookParam param) {
logger.info("[ABL HOOK] 码流不到达通知:{}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
try {
if ("rtp".equals(param.getApp())) {
return HookResult.SUCCESS();
}
MediaRtpServerTimeoutEvent event = new MediaRtpServerTimeoutEvent(this);
MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
if (mediaServerItem != null) {
event.setMediaServer(mediaServerItem);
event.setApp("rtp");
applicationEventPublisher.publishEvent(event);
}
}catch (Exception e) {
logger.info("[ABL-HOOK-码流不到达通知] 发送通知失败 ", e);
}
return HookResult.SUCCESS();
}
/**
* MP4enable_mp4=1MP4
*/
@ResponseBody
@PostMapping(value = "/on_delete_record_mp4", produces = "application/json;charset=UTF-8")
public HookResult onDeleteRecordMp4(@RequestBody OnRecordMp4ABLHookParam param) {
logger.info("[ABL HOOK] MP4文件被删除通知{}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
return HookResult.SUCCESS();
}
/**
* rtsp/rtmp
*/
@ResponseBody
@PostMapping(value = "/on_stream_arrive", produces = "application/json;charset=UTF-8")
public HookResult onStreamArrive(@RequestBody OnStreamArriveABLHookParam param) {
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (mediaServer == null) {
return HookResult.SUCCESS();
}
logger.info("[ABL HOOK] 码流到达, {}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
MediaArrivalEvent mediaArrivalEvent = MediaArrivalEvent.getInstance(this, param, mediaServer);
applicationEventPublisher.publishEvent(mediaArrivalEvent);
return HookResult.SUCCESS();
}
/**
*
*/
@ResponseBody
@PostMapping(value = "/on_stream_none_reader", produces = "application/json;charset=UTF-8")
public JSONObject onStreamNoneReader(@RequestBody ABLHookParam param) {
logger.info("[ZLM HOOK]流无人观看:{}->{}/{}", param.getMediaServerId(),
param.getApp(), param.getStream());
JSONObject ret = new JSONObject();
boolean close = mediaService.closeStreamOnNoneReader(param.getMediaServerId(), param.getApp(), param.getStream(), null);
ret.put("code", close);
return ret;
}
/**
* url
*/
@ResponseBody
@PostMapping(value = "/on_stream_not_found", produces = "application/json;charset=UTF-8")
public HookResult onStreamNotFound(@RequestBody ABLHookParam param) {
logger.info("[ABL HOOK] 流未找到:{}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (!userSetting.isAutoApplyPlay() || mediaServer == null) {
return HookResult.SUCCESS();
}
MediaNotFoundEvent mediaNotFoundEvent = MediaNotFoundEvent.getInstance(this, param, mediaServer);
applicationEventPublisher.publishEvent(mediaNotFoundEvent);
return HookResult.SUCCESS();
}
/**
* ABLMediaServer线
*/
@ResponseBody
@PostMapping(value = "/on_server_started", produces = "application/json;charset=UTF-8")
public HookResult onServerStarted(HttpServletRequest request, @RequestBody OnServerStaredABLHookParam param) {
logger.info("[ABL HOOK] 启动 " + param.getMediaServerId());
try {
HookAblServerStartEvent event = new HookAblServerStartEvent(this);
MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
if (mediaServerItem != null) {
event.setMediaServerItem(mediaServerItem);
applicationEventPublisher.publishEvent(event);
}
}catch (Exception e) {
logger.info("[ABL-HOOK-启动] 发送通知失败 ", e);
}
return HookResult.SUCCESS();
}
/**
* TODO rtp(startSendRtp)
*/
// @ResponseBody
// @PostMapping(value = "/on_send_rtp_stopped", produces = "application/json;charset=UTF-8")
// public HookResult onSendRtpStopped(HttpServletRequest request, @RequestBody OnSendRtpStoppedHookParam param) {
//
// logger.info("[ZLM HOOK] rtp发送关闭{}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
//
// // 查找对应的上级推流,发送停止
// if (!"rtp".equals(param.getApp())) {
// return HookResult.SUCCESS();
// }
// try {
// MediaSendRtpStoppedEvent event = new MediaSendRtpStoppedEvent(this);
// MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
// if (mediaServerItem != null) {
// event.setMediaServer(mediaServerItem);
// applicationEventPublisher.publishEvent(event);
// }
// }catch (Exception e) {
// logger.info("[ZLM-HOOK-rtp发送关闭] 发送通知失败 ", e);
// }
//
// return HookResult.SUCCESS();
// }
/**
* TODO
*/
@ResponseBody
@PostMapping(value = "/on_record_mp4", produces = "application/json;charset=UTF-8")
public HookResult onRecordMp4(HttpServletRequest request, @RequestBody OnRecordMp4ABLHookParam param) {
logger.info("[ABL HOOK] 录像完成事件:{}->{}", param.getMediaServerId(), param.getFileName());
// try {
// MediaServer mediaServerItem = mediaServerService.getOne(param.getMediaServerId());
// if (mediaServerItem != null) {
// MediaRecordMp4Event event = MediaRecordMp4Event.getInstance(this, param, mediaServerItem);
// event.setMediaServer(mediaServerItem);
// applicationEventPublisher.publishEvent(event);
// }
// }catch (Exception e) {
// logger.info("[ZLM-HOOK-rtpServer收流超时] 发送通知失败 ", e);
// }
return HookResult.SUCCESS();
}
/**
*
*/
@ResponseBody
@PostMapping(value = "/on_stream_disconnect", produces = "application/json;charset=UTF-8")
public HookResult onRecordMp4(HttpServletRequest request, @RequestBody ABLHookParam param) {
logger.info("[ABL HOOK] 码流断开事件, {}->{}/{}", param.getMediaServerId(), param.getApp(), param.getStream());
MediaServer mediaServer = mediaServerService.getOne(param.getMediaServerId());
if (mediaServer == null) {
return HookResult.SUCCESS();
}
MediaDepartureEvent mediaDepartureEvent = MediaDepartureEvent.getInstance(this, param, mediaServer);
applicationEventPublisher.publishEvent(mediaDepartureEvent);
return HookResult.SUCCESS();
}
private Map<String, String> urlParamToMap(String params) {
HashMap<String, String> map = new HashMap<>();
if (ObjectUtils.isEmpty(params)) {
return map;
}
String[] paramsArray = params.split("&");
if (paramsArray.length == 0) {
return map;
}
for (String param : paramsArray) {
String[] paramArray = param.split("=");
if (paramArray.length == 2) {
map.put(paramArray[0], paramArray[1]);
}
}
return map;
}
}

View File

@ -1,151 +0,0 @@
package com.genersoft.iot.vmp.media.abl;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.common.CommonCallback;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.media.bean.MediaInfo;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import com.genersoft.iot.vmp.media.service.IMediaNodeServerService;
import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service("abl")
public class ABLMediaNodeServerService implements IMediaNodeServerService {
private final static Logger logger = LoggerFactory.getLogger(ABLMediaNodeServerService.class);
@Autowired
private ABLRESTfulUtils ablresTfulUtils;
@Override
public int createRTPServer(MediaServer mediaServer, String stream, long ssrc, Integer port, Boolean onlyAuto, Boolean disableAudio, Boolean reUsePort, Integer tcpMode) {
return ablresTfulUtils.openRtpServer(mediaServer, "rtp", stream, 96, port, tcpMode, disableAudio?1:0);
}
@Override
public void closeRtpServer(MediaServer mediaServer, String streamId) {
closeRtpServer(mediaServer, streamId, null);
}
@Override
public void closeRtpServer(MediaServer serverItem, String streamId, CommonCallback<Boolean> callback) {
if (serverItem == null) {
return;
}
Map<String, Object> param = new HashMap<>();
param.put("stream_id", streamId);
param.put("force", 1);
JSONObject jsonObject = ablresTfulUtils.closeStreams(serverItem, "rtp", streamId);
logger.info("关闭RTP Server " + jsonObject);
if (jsonObject != null ) {
if (jsonObject.getInteger("code") != 0) {
logger.error("关闭RTP Server 失败: " + jsonObject.getString("msg"));
}
}else {
// 检查ZLM状态
logger.error("关闭RTP Server 失败: 请检查ZLM服务");
}
}
@Override
public void closeStreams(MediaServer mediaServerItem, String rtp, String streamId) {
}
@Override
public Boolean updateRtpServerSSRC(MediaServer mediaServerItem, String streamId, String ssrc) {
return null;
}
@Override
public boolean checkNodeId(MediaServer mediaServerItem) {
return false;
}
@Override
public void online(MediaServer mediaServerItem) {
}
@Override
public MediaServer checkMediaServer(String ip, int port, String secret) {
return null;
}
@Override
public boolean stopSendRtp(MediaServer mediaInfo, String app, String stream, String ssrc) {
return false;
}
@Override
public boolean deleteRecordDirectory(MediaServer mediaServerItem, String app, String stream, String date, String fileName) {
return false;
}
@Override
public List<StreamInfo> getMediaList(MediaServer mediaServerItem, String app, String stream, String callId) {
return null;
}
@Override
public Boolean connectRtpServer(MediaServer mediaServerItem, String address, int port, String stream) {
return null;
}
@Override
public void getSnap(MediaServer mediaServerItem, String streamUrl, int timeoutSec, int expireSec, String path, String fileName) {
}
@Override
public MediaInfo getMediaInfo(MediaServer mediaServerItem, String app, String stream) {
return null;
}
@Override
public Boolean pauseRtpCheck(MediaServer mediaServer, String streamKey) {
return null;
}
@Override
public Boolean resumeRtpCheck(MediaServer mediaServer, String streamKey) {
return null;
}
@Override
public String getFfmpegCmd(MediaServer mediaServer, String cmdKey) {
return null;
}
@Override
public WVPResult<String> addFFmpegSource(MediaServer mediaServer, String srcUrl, String dstUrl, int timeoutMs, boolean enableAudio, boolean enableMp4, String ffmpegCmdKey) {
return null;
}
@Override
public WVPResult<String> addStreamProxy(MediaServer mediaServer, String app, String stream, String url, boolean enableAudio, boolean enableMp4, String rtpType) {
return null;
}
@Override
public Boolean delFFmpegSource(MediaServer mediaServer, String streamKey) {
return null;
}
@Override
public Boolean delStreamProxy(MediaServer mediaServer, String streamKey) {
return null;
}
@Override
public Map<String, String> getFFmpegCMDs(MediaServer mediaServer) {
return null;
}
}

View File

@ -1,362 +0,0 @@
package com.genersoft.iot.vmp.media.abl;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.conf.DynamicTask;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.media.abl.bean.AblServerConfig;
import com.genersoft.iot.vmp.media.abl.bean.ConfigKeyId;
import com.genersoft.iot.vmp.media.abl.event.HookAblServerKeepaliveEvent;
import com.genersoft.iot.vmp.media.abl.event.HookAblServerStartEvent;
import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerChangeEvent;
import com.genersoft.iot.vmp.media.event.mediaServer.MediaServerDeleteEvent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.lang.reflect.Field;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* zlm
*/
@Component
public class ABLMediaServerStatusManger {
private final static Logger logger = LoggerFactory.getLogger(ABLMediaServerStatusManger.class);
private final Map<Object, MediaServer> offlineABLPrimaryMap = new ConcurrentHashMap<>();
private final Map<Object, MediaServer> offlineAblsecondaryMap = new ConcurrentHashMap<>();
private final Map<Object, Long> offlineAblTimeMap = new ConcurrentHashMap<>();
@Autowired
private ABLRESTfulUtils ablResTfulUtils;
@Autowired
private IMediaServerService mediaServerService;
@Autowired
private DynamicTask dynamicTask;
@Value("${server.ssl.enabled:false}")
private boolean sslEnabled;
@Value("${server.port}")
private Integer serverPort;
@Autowired
private UserSetting userSetting;
private final String type = "abl";
@Async("taskExecutor")
@EventListener
public void onApplicationEvent(MediaServerChangeEvent event) {
if (event.getMediaServerItemList() == null
|| event.getMediaServerItemList().isEmpty()) {
return;
}
for (MediaServer mediaServerItem : event.getMediaServerItemList()) {
if (!type.equals(mediaServerItem.getType())) {
continue;
}
logger.info("[ABL-添加待上线节点] ID" + mediaServerItem.getId());
offlineABLPrimaryMap.put(mediaServerItem.getId(), mediaServerItem);
offlineAblTimeMap.put(mediaServerItem.getId(), System.currentTimeMillis());
}
}
@Async("taskExecutor")
@EventListener
public void onApplicationEvent(HookAblServerStartEvent event) {
if (event.getMediaServerItem() == null
|| !type.equals(event.getMediaServerItem().getType())
|| event.getMediaServerItem().isStatus()) {
return;
}
MediaServer serverItem = mediaServerService.getOne(event.getMediaServerItem().getId());
if (serverItem == null) {
return;
}
logger.info("[ABL-HOOK事件-服务启动] ID" + event.getMediaServerItem().getId());
online(serverItem, null);
}
@Async("taskExecutor")
@EventListener
public void onApplicationEvent(HookAblServerKeepaliveEvent event) {
if (event.getMediaServerItem() == null) {
return;
}
MediaServer serverItem = mediaServerService.getOne(event.getMediaServerItem().getId());
if (serverItem == null) {
return;
}
logger.info("[ABL-HOOK事件-心跳] ID" + event.getMediaServerItem().getId());
online(serverItem, null);
}
@Async("taskExecutor")
@EventListener
public void onApplicationEvent(MediaServerDeleteEvent event) {
if (event.getMediaServerId() == null) {
return;
}
logger.info("[ABL-节点被移除] ID" + event.getMediaServerId());
offlineABLPrimaryMap.remove(event.getMediaServerId());
offlineAblsecondaryMap.remove(event.getMediaServerId());
offlineAblTimeMap.remove(event.getMediaServerId());
}
@Scheduled(fixedDelay = 10*1000) //每隔10秒检查一次
public void execute(){
// 初次加入的离线节点会在30分钟内每间隔十秒尝试一次30分钟后如果仍然没有上线则每隔30分钟尝试一次连接
if (offlineABLPrimaryMap.isEmpty() && offlineAblsecondaryMap.isEmpty()) {
return;
}
if (!offlineABLPrimaryMap.isEmpty()) {
for (MediaServer mediaServerItem : offlineABLPrimaryMap.values()) {
if (offlineAblTimeMap.get(mediaServerItem.getId()) < System.currentTimeMillis() - 30*60*1000) {
offlineAblsecondaryMap.put(mediaServerItem.getId(), mediaServerItem);
offlineABLPrimaryMap.remove(mediaServerItem.getId());
continue;
}
logger.info("[ABL-尝试连接] ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
JSONObject responseJson = ablResTfulUtils.getServerConfig(mediaServerItem);
AblServerConfig ablServerConfig = null;
if (responseJson == null) {
logger.info("[ABL-尝试连接]失败, ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
continue;
}
JSONArray data = responseJson.getJSONArray("params");
if (data == null || data.isEmpty()) {
logger.info("[ABL-尝试连接]失败, ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
}else {
ablServerConfig = AblServerConfig.getInstance(data);
initPort(mediaServerItem, ablServerConfig);
online(mediaServerItem, ablServerConfig);
}
}
}
if (!offlineAblsecondaryMap.isEmpty()) {
for (MediaServer mediaServerItem : offlineAblsecondaryMap.values()) {
if (offlineAblTimeMap.get(mediaServerItem.getId()) < System.currentTimeMillis() - 30*60*1000) {
continue;
}
logger.info("[ABL-尝试连接] ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
JSONObject responseJson = ablResTfulUtils.getServerConfig(mediaServerItem);
AblServerConfig ablServerConfig = null;
if (responseJson == null) {
logger.info("[ABL-尝试连接]失败, ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
offlineAblTimeMap.put(mediaServerItem.getId(), System.currentTimeMillis());
continue;
}
JSONArray data = responseJson.getJSONArray("params");
if (data == null || data.isEmpty()) {
logger.info("[ABL-尝试连接]失败, ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
offlineAblTimeMap.put(mediaServerItem.getId(), System.currentTimeMillis());
}else {
ablServerConfig = AblServerConfig.getInstance(data);
initPort(mediaServerItem, ablServerConfig);
online(mediaServerItem, ablServerConfig);
}
}
}
}
private void online(MediaServer mediaServerItem, AblServerConfig config) {
offlineABLPrimaryMap.remove(mediaServerItem.getId());
offlineAblsecondaryMap.remove(mediaServerItem.getId());
offlineAblTimeMap.remove(mediaServerItem.getId());
if (!mediaServerItem.isStatus()) {
logger.info("[ABL-连接成功] ID{}, 地址: {}:{}", mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
mediaServerItem.setStatus(true);
mediaServerItem.setHookAliveInterval(10F);
mediaServerService.update(mediaServerItem);
if(mediaServerItem.isAutoConfig()) {
if (config == null) {
JSONObject responseJSON = ablResTfulUtils.getServerConfig(mediaServerItem);
JSONArray data = responseJSON.getJSONArray("params");
if (data != null && !data.isEmpty()) {
config = AblServerConfig.getInstance(data);
}
}
if (config != null) {
initPort(mediaServerItem, config);
setAblConfig(mediaServerItem, false, config);
}
}
mediaServerService.update(mediaServerItem);
}
// 设置两次心跳未收到则认为zlm离线
String key = "ABL-keepalive-" + mediaServerItem.getId();
dynamicTask.startDelay(key, ()->{
logger.warn("[ABL-心跳超时] ID{}", mediaServerItem.getId());
mediaServerItem.setStatus(false);
offlineABLPrimaryMap.put(mediaServerItem.getId(), mediaServerItem);
offlineAblTimeMap.put(mediaServerItem.getId(), System.currentTimeMillis());
// TODO 发送离线通知
mediaServerService.update(mediaServerItem);
}, (int)(mediaServerItem.getHookAliveInterval() * 2 * 1000));
}
private void initPort(MediaServer mediaServerItem, AblServerConfig ablServerConfig) {
// 端口只会从配置中读取一次,一旦自己配置或者读取过了将不在配置
// if (mediaServerItem.getHttpSSlPort() == 0) {
// mediaServerItem.setHttpSSlPort(ablServerConfig.getHttpSSLport());
// }
if (mediaServerItem.getRtmpPort() == 0 && ablServerConfig.getRtmpPort() != null) {
mediaServerItem.setRtmpPort(ablServerConfig.getRtmpPort());
}
// if (mediaServerItem.getRtmpSSlPort() == 0) {
// mediaServerItem.setRtmpSSlPort(ablServerConfig.getRtmpSslPort());
// }
if (mediaServerItem.getRtspPort() == 0 && ablServerConfig.getRtspPort() != null) {
mediaServerItem.setRtspPort(ablServerConfig.getRtspPort());
}
if (mediaServerItem.getFlvPort() == 0 && ablServerConfig.getHttpFlvPort() != null) {
mediaServerItem.setFlvPort(ablServerConfig.getHttpFlvPort());
}
if (mediaServerItem.getWsFlvPort() == 0 && ablServerConfig.getWsPort() != null) {
mediaServerItem.setWsFlvPort(ablServerConfig.getWsPort());
}
if (mediaServerItem.getRtpProxyPort() == 0 && ablServerConfig.getPsTsRecvPort() != null) {
mediaServerItem.setRtpProxyPort(ablServerConfig.getPsTsRecvPort());
}
// if (mediaServerItem.getRtspSSLPort() == 0) {
// mediaServerItem.setRtspSSLPort(ablServerConfig.getRtspSSlport());
// }
// if (mediaServerItem.getRtpProxyPort() == 0) {
// mediaServerItem.setRtpProxyPort(ablServerConfig.getRtpProxyPort());
// }
mediaServerItem.setHookAliveInterval(10F);
}
public void setAblConfig(MediaServer mediaServerItem, boolean restart, AblServerConfig config) {
try {
if (config.getHookEnable() == 0) {
logger.info("[媒体服务节点-ABL] 开启HOOK功能 {}", mediaServerItem.getId());
JSONObject responseJSON = ablResTfulUtils.setConfigParamValue(mediaServerItem, "hook_enable", "1");
if (responseJSON.getInteger("code") == 0) {
logger.info("[媒体服务节点-ABL] 开启HOOK功能成功 {}", mediaServerItem.getId());
}else {
logger.info("[媒体服务节点-ABL] 开启HOOK功能失败 {}->{}", mediaServerItem.getId(), responseJSON.getString("memo"));
}
}
}catch (Exception e) {
logger.info("[媒体服务节点-ABL] 开启HOOK功能失败 {}", mediaServerItem.getId(), e);
}
// 设置相关的HOOK
String[] hookUrlArray = {
"on_stream_arrive",
"on_stream_none_reader",
"on_record_mp4",
"on_stream_disconnect",
"on_stream_not_found",
"on_server_started",
"on_publish",
"on_play",
"on_record_progress",
"on_server_keepalive",
"on_stream_not_arrive",
"on_delete_record_mp4",
};
String protocol = sslEnabled ? "https" : "http";
String hookPrefix = String.format("%s://%s:%s/index/hook/abl", protocol, mediaServerItem.getHookIp(), serverPort);
Field[] fields = AblServerConfig.class.getDeclaredFields();
for (Field field : fields) {
try {
if (field.isAnnotationPresent(ConfigKeyId.class)) {
ConfigKeyId configKeyId = field.getAnnotation(ConfigKeyId.class);
for (String hook : hookUrlArray) {
if (configKeyId.value().equals(hook)) {
String hookUrl = String.format("%s/%s", hookPrefix, hook);
field.setAccessible(true);
// 利用反射获取值后对比是否与配置中相同,不同则进行设置
if (!hookUrl.equals(field.get(config))) {
JSONObject responseJSON = ablResTfulUtils.setConfigParamValue(mediaServerItem, hook, hookUrl);
if (responseJSON.getInteger("code") == 0) {
logger.info("[媒体服务节点-ABL] 设置HOOK {} 成功 {}", hook, mediaServerItem.getId());
}else {
logger.info("[媒体服务节点-ABL] 设置HOOK {} 失败 {}->{}", hook, mediaServerItem.getId(), responseJSON.getString("memo"));
}
}
}
}
}
}catch (Exception e) {
logger.info("[媒体服务节点-ABL] 设置HOOK 失败 {}", mediaServerItem.getId(), e);
}
}
// Map<String, Object> param = new HashMap<>();
// param.put("api.secret",mediaServerItem.getSecret()); // -profile:v Baseline
// if (mediaServerItem.getRtspPort() != 0) {
// param.put("ffmpeg.snap", "%s -rtsp_transport tcp -i %s -y -f mjpeg -frames:v 1 %s");
// }
// param.put("hook.enable","1");
// param.put("hook.on_flow_report","");
// param.put("hook.on_play",String.format("%s/on_play", hookPrefix));
// param.put("hook.on_http_access","");
// param.put("hook.on_publish", String.format("%s/on_publish", hookPrefix));
// param.put("hook.on_record_ts","");
// param.put("hook.on_rtsp_auth","");
// param.put("hook.on_rtsp_realm","");
// param.put("hook.on_server_started",String.format("%s/on_server_started", hookPrefix));
// param.put("hook.on_shell_login","");
// param.put("hook.on_stream_changed",String.format("%s/on_stream_changed", hookPrefix));
// param.put("hook.on_stream_none_reader",String.format("%s/on_stream_none_reader", hookPrefix));
// param.put("hook.on_stream_not_found",String.format("%s/on_stream_not_found", hookPrefix));
// param.put("hook.on_server_keepalive",String.format("%s/on_server_keepalive", hookPrefix));
// param.put("hook.on_send_rtp_stopped",String.format("%s/on_send_rtp_stopped", hookPrefix));
// param.put("hook.on_rtp_server_timeout",String.format("%s/on_rtp_server_timeout", hookPrefix));
// param.put("hook.on_record_mp4",String.format("%s/on_record_mp4", hookPrefix));
// param.put("hook.timeoutSec","30");
// param.put("hook.alive_interval", mediaServerItem.getHookAliveInterval());
// // 推流断开后可以在超时时间内重新连接上继续推流,这样播放器会接着播放。
// // 置0关闭此特性(推流断开会导致立即断开播放器)
// // 此参数不应大于播放器超时时间
// // 优化此消息以更快的收到流注销事件
// param.put("protocol.continue_push_ms", "3000" );
// // 最多等待未初始化的Track时间单位毫秒超时之后会忽略未初始化的Track, 设置此选项优化那些音频错误的不规范流,
// // 等zlm支持给每个rtpServer设置关闭音频的时候可以不设置此选项
// if (mediaServerItem.isRtpEnable() && !ObjectUtils.isEmpty(mediaServerItem.getRtpPortRange())) {
// param.put("rtp_proxy.port_range", mediaServerItem.getRtpPortRange().replace(",", "-"));
// }
//
// if (!ObjectUtils.isEmpty(mediaServerItem.getRecordPath())) {
// File recordPathFile = new File(mediaServerItem.getRecordPath());
// param.put("protocol.mp4_save_path", recordPathFile.getParentFile().getPath());
// param.put("protocol.downloadRoot", recordPathFile.getParentFile().getPath());
// param.put("record.appName", recordPathFile.getName());
// }
//
// JSONObject responseJSON = ablResTfulUtils.setConfigParamValue(mediaServerItem, param);
//
// if (responseJSON != null && responseJSON.getInteger("code") == 0) {
// if (restart) {
// logger.info("[媒体服务节点] 设置成功,开始重启以保证配置生效 {} -> {}:{}",
// mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
// ablResTfulUtils.restartServer(mediaServerItem);
// }else {
// logger.info("[媒体服务节点] 设置成功 {} -> {}:{}",
// mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
// }
// }else {
// logger.info("[媒体服务节点] 设置媒体服务节点失败 {} -> {}:{}",
// mediaServerItem.getId(), mediaServerItem.getIp(), mediaServerItem.getHttpPort());
// }
}
}

View File

@ -1,317 +0,0 @@
package com.genersoft.iot.vmp.media.abl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import okhttp3.*;
import okhttp3.logging.HttpLoggingInterceptor;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ConnectException;
import java.net.SocketTimeoutException;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
@Component
public class ABLRESTfulUtils {
private final static Logger logger = LoggerFactory.getLogger(ABLRESTfulUtils.class);
private OkHttpClient client;
public interface RequestCallback{
void run(JSONObject response);
}
private OkHttpClient getClient(){
return getClient(null);
}
private OkHttpClient getClient(Integer readTimeOut){
if (client == null) {
if (readTimeOut == null) {
readTimeOut = 10;
}
OkHttpClient.Builder httpClientBuilder = new OkHttpClient.Builder();
//todo 暂时写死超时时间 均为5s
// 设置连接超时时间
httpClientBuilder.connectTimeout(8,TimeUnit.SECONDS);
// 设置读取超时时间
httpClientBuilder.readTimeout(readTimeOut,TimeUnit.SECONDS);
// 设置连接池
httpClientBuilder.connectionPool(new ConnectionPool(16, 5, TimeUnit.MINUTES));
if (logger.isDebugEnabled()) {
HttpLoggingInterceptor logging = new HttpLoggingInterceptor(message -> {
logger.debug("http请求参数" + message);
});
logging.setLevel(HttpLoggingInterceptor.Level.BASIC);
// OkHttp進行添加攔截器loggingInterceptor
httpClientBuilder.addInterceptor(logging);
}
client = httpClientBuilder.build();
}
return client;
}
public JSONObject sendPost(MediaServer mediaServerItem, String api, Map<String, Object> param, RequestCallback callback) {
return sendPost(mediaServerItem, api, param, callback, null);
}
public JSONObject sendPost(MediaServer mediaServerItem, String api, Map<String, Object> param, RequestCallback callback, Integer readTimeOut) {
OkHttpClient client = getClient(readTimeOut);
if (mediaServerItem == null) {
return null;
}
String url = String.format("http://%s:%s/index/api/%s", mediaServerItem.getIp(), mediaServerItem.getHttpPort(), api);
JSONObject responseJSON = new JSONObject();
//-2自定义流媒体 调用错误码
responseJSON.put("code",-2);
responseJSON.put("msg","流媒体调用失败");
FormBody.Builder builder = new FormBody.Builder();
builder.add("secret",mediaServerItem.getSecret());
if (param != null && param.keySet().size() > 0) {
for (String key : param.keySet()){
if (param.get(key) != null) {
builder.add(key, param.get(key).toString());
}
}
}
FormBody body = builder.build();
Request request = new Request.Builder()
.post(body)
.url(url)
.build();
if (callback == null) {
try {
Response response = client.newCall(request).execute();
if (response.isSuccessful()) {
ResponseBody responseBody = response.body();
if (responseBody != null) {
String responseStr = responseBody.string();
responseJSON = JSON.parseObject(responseStr);
}
}else {
System.out.println( 2222);
System.out.println( response.code());
response.close();
Objects.requireNonNull(response.body()).close();
}
}catch (IOException e) {
logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
if(e instanceof SocketTimeoutException){
//读取超时超时异常
logger.error(String.format("读取ABL数据超时失败: %s, %s", url, e.getMessage()));
}
if(e instanceof ConnectException){
//判断连接异常我这里是报Failed to connect to 10.7.5.144
logger.error(String.format("连接ABL连接失败: %s, %s", url, e.getMessage()));
}
}catch (Exception e){
logger.error(String.format("访问ABL失败: %s, %s", url, e.getMessage()));
}
}else {
client.newCall(request).enqueue(new Callback(){
@Override
public void onResponse(@NotNull Call call, @NotNull Response response){
if (response.isSuccessful()) {
try {
String responseStr = Objects.requireNonNull(response.body()).string();
callback.run(JSON.parseObject(responseStr));
} catch (IOException e) {
logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
}
}else {
response.close();
Objects.requireNonNull(response.body()).close();
}
}
@Override
public void onFailure(@NotNull Call call, @NotNull IOException e) {
logger.error(String.format("连接ABL失败: %s, %s", call.request().toString(), e.getMessage()));
if(e instanceof SocketTimeoutException){
//读取超时超时异常
logger.error(String.format("读取ABL数据失败: %s, %s", call.request().toString(), e.getMessage()));
}
if(e instanceof ConnectException){
//判断连接异常我这里是报Failed to connect to 10.7.5.144
logger.error(String.format("连接ABL失败: %s, %s", call.request().toString(), e.getMessage()));
}
}
});
}
return responseJSON;
}
public JSONObject sendGet(MediaServer mediaServerItem, String api, Map<String, Object> param) {
OkHttpClient client = getClient();
if (mediaServerItem == null) {
return null;
}
JSONObject responseJSON = null;
StringBuilder stringBuffer = new StringBuilder();
stringBuffer.append(String.format("http://%s:%s/index/api/%s", mediaServerItem.getIp(), mediaServerItem.getHttpPort(), api));
if (param != null && !param.keySet().isEmpty()) {
stringBuffer.append("?secret=").append(mediaServerItem.getSecret()).append("&");
int index = 1;
for (String key : param.keySet()){
if (param.get(key) != null) {
stringBuffer.append(key + "=" + param.get(key));
if (index < param.size()) {
stringBuffer.append("&");
}
}
index++;
}
}
String url = stringBuffer.toString();
logger.info("[访问ABL] {}", url);
Request request = new Request.Builder()
.get()
.url(url)
.build();
try {
Response response = client.newCall(request).execute();
if (response.isSuccessful()) {
ResponseBody responseBody = response.body();
if (responseBody != null) {
String responseStr = responseBody.string();
responseJSON = JSON.parseObject(responseStr);
}
}else {
response.close();
Objects.requireNonNull(response.body()).close();
}
} catch (ConnectException e) {
logger.error(String.format("连接ABL失败: %s, %s", e.getCause().getMessage(), e.getMessage()));
logger.info("请检查media配置并确认ABL已启动...");
}catch (IOException e) {
logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
}
return responseJSON;
}
public void sendGetForImg(MediaServer mediaServerItem, String api, Map<String, Object> params, String targetPath, String fileName) {
String url = String.format("http://%s:%s/index/api/%s", mediaServerItem.getIp(), mediaServerItem.getHttpPort(), api);
HttpUrl parseUrl = HttpUrl.parse(url);
if (parseUrl == null) {
return;
}
HttpUrl.Builder httpBuilder = parseUrl.newBuilder();
httpBuilder.addQueryParameter("secret", mediaServerItem.getSecret());
if (params != null) {
for (Map.Entry<String, Object> param : params.entrySet()) {
httpBuilder.addQueryParameter(param.getKey(), param.getValue().toString());
}
}
Request request = new Request.Builder()
.url(httpBuilder.build())
.build();
logger.info(request.toString());
try {
OkHttpClient client = getClient();
Response response = client.newCall(request).execute();
if (response.isSuccessful()) {
if (targetPath != null) {
File snapFolder = new File(targetPath);
if (!snapFolder.exists()) {
if (!snapFolder.mkdirs()) {
logger.warn("{}路径创建失败", snapFolder.getAbsolutePath());
}
}
File snapFile = new File(targetPath + File.separator + fileName);
FileOutputStream outStream = new FileOutputStream(snapFile);
outStream.write(Objects.requireNonNull(response.body()).bytes());
outStream.flush();
outStream.close();
} else {
logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message()));
}
} else {
logger.error(String.format("[ %s ]请求失败: %s %s", url, response.code(), response.message()));
}
Objects.requireNonNull(response.body()).close();
} catch (ConnectException e) {
logger.error(String.format("连接ABL失败: %s, %s", e.getCause().getMessage(), e.getMessage()));
logger.info("请检查media配置并确认ABL已启动...");
} catch (IOException e) {
logger.error(String.format("[ %s ]请求失败: %s", url, e.getMessage()));
}
}
public Integer openRtpServer(MediaServer mediaServer, String app, String stream, int payload, Integer port, Integer tcpMode, Integer disableAudio) {
Map<String, Object> param = new HashMap<>();
param.put("vhost", "_defaultVhost_");
param.put("app", app);
param.put("stream_id", stream);
param.put("payload", payload);
if (port != null) {
param.put("port", port);
}
if (tcpMode != null) {
param.put("enable_tcp", tcpMode);
}
if (disableAudio != null) {
param.put("disableAudio", disableAudio);
}
JSONObject jsonObject = sendPost(mediaServer, "openRtpServer", param, null);
if (jsonObject.getInteger("code") == 0) {
return jsonObject.getInteger("port");
}else {
return 0;
}
}
public JSONObject closeStreams(MediaServer mediaServerItem, String app, String stream) {
Map<String, Object> param = new HashMap<>();
param.put("vhost", "__defaultVhost__");
param.put("app", app);
param.put("stream", stream);
param.put("force", 1);
return sendPost(mediaServerItem, "close_streams",param, null);
}
public JSONObject getServerConfig(MediaServer mediaServerItem){
return sendPost(mediaServerItem, "getServerConfig",null, null);
}
public JSONObject setConfigParamValue(MediaServer mediaServerItem, String key, Object value){
Map<String, Object> param = new HashMap<>();
param.put("key", key);
param.put("value", value);
return sendGet(mediaServerItem,"setConfigParamValue", param);
}
}

View File

@ -1,812 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.Map;
public class AblServerConfig {
@ConfigKeyId("secret")
private String secret;
@ConfigKeyId("ServerIP")
private String serverIp;
@ConfigKeyId("mediaServerID")
private String mediaServerId;
@ConfigKeyId("hook_enable")
private Integer hookEnable;
@ConfigKeyId("enable_audio")
private Integer enableAudio;
@ConfigKeyId("httpServerPort")
private Integer httpServerPort;
@ConfigKeyId("rtspPort")
private Integer rtspPort;
@ConfigKeyId("rtmpPort")
private Integer rtmpPort;
@ConfigKeyId("httpFlvPort")
private Integer httpFlvPort;
@ConfigKeyId("hls_enable")
private Integer hlsEnable;
@ConfigKeyId("hlsPort")
private Integer hlsPort;
@ConfigKeyId("wsPort")
private Integer wsPort;
@ConfigKeyId("mp4Port")
private Integer mp4Port;
@ConfigKeyId("ps_tsRecvPort")
private Integer psTsRecvPort;
@ConfigKeyId("hlsCutType")
private Integer hlsCutType;
@ConfigKeyId("h265CutType")
private Integer h265CutType;
@ConfigKeyId("RecvThreadCount")
private Integer RecvThreadCount;
@ConfigKeyId("SendThreadCount")
private Integer SendThreadCount;
@ConfigKeyId("GB28181RtpTCPHeadType")
private Integer GB28181RtpTCPHeadType;
@ConfigKeyId("ReConnectingCount")
private Integer ReConnectingCount;
@ConfigKeyId("maxTimeNoOneWatch")
private Integer maxTimeNoOneWatch;
@ConfigKeyId("pushEnable_mp4")
private Integer pushEnableMp4;
@ConfigKeyId("fileSecond")
private Integer fileSecond;
@ConfigKeyId("fileKeepMaxTime")
private Integer fileKeepMaxTime;
@ConfigKeyId("httpDownloadSpeed")
private Integer httpDownloadSpeed;
@ConfigKeyId("RecordReplayThread")
private Integer RecordReplayThread;
@ConfigKeyId("convertMaxObject")
private Integer convertMaxObject;
@ConfigKeyId("version")
private String version;
@ConfigKeyId("recordPath")
private String recordPath;
@ConfigKeyId("picturePath")
private String picturePath;
@ConfigKeyId("noneReaderDuration")
private Integer noneReaderDuration;
@ConfigKeyId("on_server_started")
private String onServerStarted;
@ConfigKeyId("on_server_keepalive")
private String onServerKeepalive;
@ConfigKeyId("on_play")
private String onPlay;
@ConfigKeyId("on_publish")
private String onPublish;
@ConfigKeyId("on_stream_arrive")
private String onStreamArrive;
@ConfigKeyId("on_stream_not_arrive")
private String onStreamNotArrive;
@ConfigKeyId("on_stream_none_reader")
private String onStreamNoneReader;
@ConfigKeyId("on_stream_disconnect")
private String onStreamDisconnect;
@ConfigKeyId("on_stream_not_found")
private String onStreamNotFound;
@ConfigKeyId("on_record_mp4")
private String onRecordMp4;
@ConfigKeyId("on_delete_record_mp4")
private String onDeleteRecordMp4;
@ConfigKeyId("on_record_progress")
private String onRecordProgress;
@ConfigKeyId("on_record_ts")
private String onRecordTs;
@ConfigKeyId("enable_GetFileDuration")
private Integer enableGetFileDuration;
@ConfigKeyId("keepaliveDuration")
private Integer keepaliveDuration;
@ConfigKeyId("captureReplayType")
private Integer captureReplayType;
@ConfigKeyId("pictureMaxCount")
private Integer pictureMaxCount;
@ConfigKeyId("videoFileFormat")
private Integer videoFileFormat;
@ConfigKeyId("MaxDiconnectTimeoutSecond")
private Integer maxDiconnectTimeoutSecond;
@ConfigKeyId("G711ConvertAAC")
private Integer g711ConvertAAC;
@ConfigKeyId("filterVideo_enable")
private Integer filterVideoEnable;
@ConfigKeyId("filterVideo_text")
private String filterVideoText;
@ConfigKeyId("FilterFontSize")
private Integer filterFontSize;
@ConfigKeyId("FilterFontColor")
private String filterFontColor;
@ConfigKeyId("FilterFontLeft")
private Integer filterFontLeft;
@ConfigKeyId("FilterFontTop")
private Integer filterFontTop;
@ConfigKeyId("FilterFontAlpha")
private Double filterFontAlpha;
@ConfigKeyId("convertOutWidth")
private Integer convertOutWidth;
@ConfigKeyId("convertOutHeight")
private Integer convertOutHeight;
@ConfigKeyId("convertOutBitrate")
private Integer convertOutBitrate;
@ConfigKeyId("flvPlayAddMute")
private Integer flvPlayAddMute;
@ConfigKeyId("gb28181LibraryUse")
private Integer gb28181LibraryUse;
@ConfigKeyId("rtc.listening-ip")
private String rtcListeningIp;
@ConfigKeyId("rtc.listening-port")
private Integer rtcListeningIpPort;
@ConfigKeyId("rtc.external-ip")
private String rtcExternalIp;
@ConfigKeyId("rtc.realm")
private String rtcRealm;
@ConfigKeyId("rtc.user")
private String rtcUser;
@ConfigKeyId("rtc.min-port")
private Integer rtcMinPort;
@ConfigKeyId("rtc.max-port")
private Integer rtcMaxPort;
public static AblServerConfig getInstance(JSONArray jsonArray) {
if (jsonArray == null || jsonArray.isEmpty()) {
return null;
}
AblServerConfig ablServerConfig = new AblServerConfig();
Field[] fields = AblServerConfig.class.getDeclaredFields();
Map<String, Field> fieldMap = new HashMap<>();
for (Field field : fields) {
if (field.isAnnotationPresent(ConfigKeyId.class)) {
ConfigKeyId configKeyId = field.getAnnotation(ConfigKeyId.class);
fieldMap.put(configKeyId.value(), field);
}
}
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject jsonObject = jsonArray.getJSONObject(i);
if (jsonObject == null) {
continue;
}
for (String key : fieldMap.keySet()) {
if (jsonObject.containsKey(key)) {
Field field = fieldMap.get(key);
field.setAccessible(true);
try {
field.set(ablServerConfig, jsonObject.getObject(key, fieldMap.get(key).getType()));
} catch (IllegalAccessException e) {}
}
}
}
return ablServerConfig;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getServerIp() {
return serverIp;
}
public void setServerIp(String serverIp) {
this.serverIp = serverIp;
}
public String getMediaServerId() {
return mediaServerId;
}
public void setMediaServerId(String mediaServerId) {
this.mediaServerId = mediaServerId;
}
public Integer getHookEnable() {
return hookEnable;
}
public void setHookEnable(Integer hookEnable) {
this.hookEnable = hookEnable;
}
public Integer getEnableAudio() {
return enableAudio;
}
public void setEnableAudio(Integer enableAudio) {
this.enableAudio = enableAudio;
}
public Integer getHttpServerPort() {
return httpServerPort;
}
public void setHttpServerPort(Integer httpServerPort) {
this.httpServerPort = httpServerPort;
}
public Integer getRtspPort() {
return rtspPort;
}
public void setRtspPort(Integer rtspPort) {
this.rtspPort = rtspPort;
}
public Integer getRtmpPort() {
return rtmpPort;
}
public void setRtmpPort(Integer rtmpPort) {
this.rtmpPort = rtmpPort;
}
public Integer getHttpFlvPort() {
return httpFlvPort;
}
public void setHttpFlvPort(Integer httpFlvPort) {
this.httpFlvPort = httpFlvPort;
}
public Integer getHlsEnable() {
return hlsEnable;
}
public void setHlsEnable(Integer hlsEnable) {
this.hlsEnable = hlsEnable;
}
public Integer getHlsPort() {
return hlsPort;
}
public void setHlsPort(Integer hlsPort) {
this.hlsPort = hlsPort;
}
public Integer getWsPort() {
return wsPort;
}
public void setWsPort(Integer wsPort) {
this.wsPort = wsPort;
}
public Integer getMp4Port() {
return mp4Port;
}
public void setMp4Port(Integer mp4Port) {
this.mp4Port = mp4Port;
}
public Integer getPsTsRecvPort() {
return psTsRecvPort;
}
public void setPsTsRecvPort(Integer psTsRecvPort) {
this.psTsRecvPort = psTsRecvPort;
}
public Integer getHlsCutType() {
return hlsCutType;
}
public void setHlsCutType(Integer hlsCutType) {
this.hlsCutType = hlsCutType;
}
public Integer getH265CutType() {
return h265CutType;
}
public void setH265CutType(Integer h265CutType) {
this.h265CutType = h265CutType;
}
public Integer getRecvThreadCount() {
return RecvThreadCount;
}
public void setRecvThreadCount(Integer recvThreadCount) {
RecvThreadCount = recvThreadCount;
}
public Integer getSendThreadCount() {
return SendThreadCount;
}
public void setSendThreadCount(Integer sendThreadCount) {
SendThreadCount = sendThreadCount;
}
public Integer getGB28181RtpTCPHeadType() {
return GB28181RtpTCPHeadType;
}
public void setGB28181RtpTCPHeadType(Integer GB28181RtpTCPHeadType) {
this.GB28181RtpTCPHeadType = GB28181RtpTCPHeadType;
}
public Integer getReConnectingCount() {
return ReConnectingCount;
}
public void setReConnectingCount(Integer reConnectingCount) {
ReConnectingCount = reConnectingCount;
}
public Integer getMaxTimeNoOneWatch() {
return maxTimeNoOneWatch;
}
public void setMaxTimeNoOneWatch(Integer maxTimeNoOneWatch) {
this.maxTimeNoOneWatch = maxTimeNoOneWatch;
}
public Integer getPushEnableMp4() {
return pushEnableMp4;
}
public void setPushEnableMp4(Integer pushEnableMp4) {
this.pushEnableMp4 = pushEnableMp4;
}
public Integer getFileSecond() {
return fileSecond;
}
public void setFileSecond(Integer fileSecond) {
this.fileSecond = fileSecond;
}
public Integer getFileKeepMaxTime() {
return fileKeepMaxTime;
}
public void setFileKeepMaxTime(Integer fileKeepMaxTime) {
this.fileKeepMaxTime = fileKeepMaxTime;
}
public Integer getHttpDownloadSpeed() {
return httpDownloadSpeed;
}
public void setHttpDownloadSpeed(Integer httpDownloadSpeed) {
this.httpDownloadSpeed = httpDownloadSpeed;
}
public Integer getRecordReplayThread() {
return RecordReplayThread;
}
public void setRecordReplayThread(Integer recordReplayThread) {
RecordReplayThread = recordReplayThread;
}
public Integer getConvertMaxObject() {
return convertMaxObject;
}
public void setConvertMaxObject(Integer convertMaxObject) {
this.convertMaxObject = convertMaxObject;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getRecordPath() {
return recordPath;
}
public void setRecordPath(String recordPath) {
this.recordPath = recordPath;
}
public String getPicturePath() {
return picturePath;
}
public void setPicturePath(String picturePath) {
this.picturePath = picturePath;
}
public Integer getNoneReaderDuration() {
return noneReaderDuration;
}
public void setNoneReaderDuration(Integer noneReaderDuration) {
this.noneReaderDuration = noneReaderDuration;
}
public String getOnServerStarted() {
return onServerStarted;
}
public void setOnServerStarted(String onServerStarted) {
this.onServerStarted = onServerStarted;
}
public String getOnServerKeepalive() {
return onServerKeepalive;
}
public void setOnServerKeepalive(String onServerKeepalive) {
this.onServerKeepalive = onServerKeepalive;
}
public String getOnPlay() {
return onPlay;
}
public void setOnPlay(String onPlay) {
this.onPlay = onPlay;
}
public String getOnPublish() {
return onPublish;
}
public void setOnPublish(String onPublish) {
this.onPublish = onPublish;
}
public String getOnStreamArrive() {
return onStreamArrive;
}
public void setOnStreamArrive(String onStreamArrive) {
this.onStreamArrive = onStreamArrive;
}
public String getOnStreamNotArrive() {
return onStreamNotArrive;
}
public void setOnStreamNotArrive(String onStreamNotArrive) {
this.onStreamNotArrive = onStreamNotArrive;
}
public String getOnStreamNoneReader() {
return onStreamNoneReader;
}
public void setOnStreamNoneReader(String onStreamNoneReader) {
this.onStreamNoneReader = onStreamNoneReader;
}
public String getOnStreamDisconnect() {
return onStreamDisconnect;
}
public void setOnStreamDisconnect(String onStreamDisconnect) {
this.onStreamDisconnect = onStreamDisconnect;
}
public String getOnDeleteRecordMp4() {
return onDeleteRecordMp4;
}
public void setOnDeleteRecordMp4(String onDeleteRecordMp4) {
this.onDeleteRecordMp4 = onDeleteRecordMp4;
}
public String getOnRecordProgress() {
return onRecordProgress;
}
public void setOnRecordProgress(String onRecordProgress) {
this.onRecordProgress = onRecordProgress;
}
public String getOnRecordTs() {
return onRecordTs;
}
public void setOnRecordTs(String onRecordTs) {
this.onRecordTs = onRecordTs;
}
public Integer getEnableGetFileDuration() {
return enableGetFileDuration;
}
public void setEnableGetFileDuration(Integer enableGetFileDuration) {
this.enableGetFileDuration = enableGetFileDuration;
}
public Integer getKeepaliveDuration() {
return keepaliveDuration;
}
public void setKeepaliveDuration(Integer keepaliveDuration) {
this.keepaliveDuration = keepaliveDuration;
}
public Integer getCaptureReplayType() {
return captureReplayType;
}
public void setCaptureReplayType(Integer captureReplayType) {
this.captureReplayType = captureReplayType;
}
public Integer getVideoFileFormat() {
return videoFileFormat;
}
public void setVideoFileFormat(Integer videoFileFormat) {
this.videoFileFormat = videoFileFormat;
}
public Integer getMaxDiconnectTimeoutSecond() {
return maxDiconnectTimeoutSecond;
}
public void setMaxDiconnectTimeoutSecond(Integer maxDiconnectTimeoutSecond) {
this.maxDiconnectTimeoutSecond = maxDiconnectTimeoutSecond;
}
public Integer getG711ConvertAAC() {
return g711ConvertAAC;
}
public void setG711ConvertAAC(Integer g711ConvertAAC) {
this.g711ConvertAAC = g711ConvertAAC;
}
public Integer getFilterVideoEnable() {
return filterVideoEnable;
}
public void setFilterVideoEnable(Integer filterVideoEnable) {
this.filterVideoEnable = filterVideoEnable;
}
public String getFilterVideoText() {
return filterVideoText;
}
public void setFilterVideoText(String filterVideoText) {
this.filterVideoText = filterVideoText;
}
public Integer getFilterFontSize() {
return filterFontSize;
}
public void setFilterFontSize(Integer filterFontSize) {
this.filterFontSize = filterFontSize;
}
public String getFilterFontColor() {
return filterFontColor;
}
public void setFilterFontColor(String filterFontColor) {
this.filterFontColor = filterFontColor;
}
public Integer getFilterFontLeft() {
return filterFontLeft;
}
public void setFilterFontLeft(Integer filterFontLeft) {
this.filterFontLeft = filterFontLeft;
}
public Integer getFilterFontTop() {
return filterFontTop;
}
public void setFilterFontTop(Integer filterFontTop) {
this.filterFontTop = filterFontTop;
}
public Double getFilterFontAlpha() {
return filterFontAlpha;
}
public void setFilterFontAlpha(Double filterFontAlpha) {
this.filterFontAlpha = filterFontAlpha;
}
public Integer getConvertOutWidth() {
return convertOutWidth;
}
public void setConvertOutWidth(Integer convertOutWidth) {
this.convertOutWidth = convertOutWidth;
}
public Integer getConvertOutHeight() {
return convertOutHeight;
}
public void setConvertOutHeight(Integer convertOutHeight) {
this.convertOutHeight = convertOutHeight;
}
public Integer getConvertOutBitrate() {
return convertOutBitrate;
}
public void setConvertOutBitrate(Integer convertOutBitrate) {
this.convertOutBitrate = convertOutBitrate;
}
public Integer getFlvPlayAddMute() {
return flvPlayAddMute;
}
public void setFlvPlayAddMute(Integer flvPlayAddMute) {
this.flvPlayAddMute = flvPlayAddMute;
}
public Integer getGb28181LibraryUse() {
return gb28181LibraryUse;
}
public void setGb28181LibraryUse(Integer gb28181LibraryUse) {
this.gb28181LibraryUse = gb28181LibraryUse;
}
public String getRtcListeningIp() {
return rtcListeningIp;
}
public void setRtcListeningIp(String rtcListeningIp) {
this.rtcListeningIp = rtcListeningIp;
}
public Integer getRtcListeningIpPort() {
return rtcListeningIpPort;
}
public void setRtcListeningIpPort(Integer rtcListeningIpPort) {
this.rtcListeningIpPort = rtcListeningIpPort;
}
public String getRtcExternalIp() {
return rtcExternalIp;
}
public void setRtcExternalIp(String rtcExternalIp) {
this.rtcExternalIp = rtcExternalIp;
}
public String getRtcRealm() {
return rtcRealm;
}
public void setRtcRealm(String rtcRealm) {
this.rtcRealm = rtcRealm;
}
public String getRtcUser() {
return rtcUser;
}
public void setRtcUser(String rtcUser) {
this.rtcUser = rtcUser;
}
public Integer getRtcMinPort() {
return rtcMinPort;
}
public void setRtcMinPort(Integer rtcMinPort) {
this.rtcMinPort = rtcMinPort;
}
public Integer getRtcMaxPort() {
return rtcMaxPort;
}
public void setRtcMaxPort(Integer rtcMaxPort) {
this.rtcMaxPort = rtcMaxPort;
}
public String getOnRecordMp4() {
return onRecordMp4;
}
public void setOnRecordMp4(String onRecordMp4) {
this.onRecordMp4 = onRecordMp4;
}
public Integer getPictureMaxCount() {
return pictureMaxCount;
}
public void setPictureMaxCount(Integer pictureMaxCount) {
this.pictureMaxCount = pictureMaxCount;
}
public String getOnStreamNotFound() {
return onStreamNotFound;
}
public void setOnStreamNotFound(String onStreamNotFound) {
this.onStreamNotFound = onStreamNotFound;
}
}

View File

@ -1,58 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean;
public class AblUrls {
private String rtsp;
private String rtmp;
private String httpFlv;
private String wsFlv;
private String httpMp4;
private String httpHls;
public String getRtsp() {
return rtsp;
}
public void setRtsp(String rtsp) {
this.rtsp = rtsp;
}
public String getRtmp() {
return rtmp;
}
public void setRtmp(String rtmp) {
this.rtmp = rtmp;
}
public String getHttpFlv() {
return httpFlv;
}
public void setHttpFlv(String httpFlv) {
this.httpFlv = httpFlv;
}
public String getWsFlv() {
return wsFlv;
}
public void setWsFlv(String wsFlv) {
this.wsFlv = wsFlv;
}
public String getHttpMp4() {
return httpMp4;
}
public void setHttpMp4(String httpMp4) {
this.httpMp4 = httpMp4;
}
public String getHttpHls() {
return httpHls;
}
public void setHttpHls(String httpHls) {
this.httpHls = httpHls;
}
}

View File

@ -1,10 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean;
import java.lang.annotation.*;
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface ConfigKeyId {
String value();
}

View File

@ -1,65 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class ABLHookParam {
private String mediaServerId;
/**
*
*/
private String app;
/**
* id
*/
private String stream;
/**
* key delMediaStreamclose_streams
*/
private String key;
/**
*
*/
private Integer networkType;
public String getMediaServerId() {
return mediaServerId;
}
public void setMediaServerId(String mediaServerId) {
this.mediaServerId = mediaServerId;
}
public String getApp() {
return app;
}
public void setApp(String app) {
this.app = app;
}
public String getStream() {
return stream;
}
public void setStream(String stream) {
this.stream = stream;
}
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public Integer getNetworkType() {
return networkType;
}
public void setNetworkType(Integer networkType) {
this.networkType = networkType;
}
}

View File

@ -1,31 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnPlayABLHookParam extends ABLHookParam{
private String ip;
private Integer port;
private String params;
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}

View File

@ -1,31 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnPublishABLHookParam extends ABLHookParam{
private String ip;
private Integer port;
private String params;
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public Integer getPort() {
return port;
}
public void setPort(Integer port) {
this.port = port;
}
public String getParams() {
return params;
}
public void setParams(String params) {
this.params = params;
}
}

View File

@ -1,13 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnRecordMp4ABLHookParam extends ABLHookParam{
private String fileName;
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
}

View File

@ -1,22 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnRecordProgressABLHookParam extends OnRecordMp4ABLHookParam{
private Integer currentFileDuration;
private Integer TotalVideoDuration;
public Integer getCurrentFileDuration() {
return currentFileDuration;
}
public void setCurrentFileDuration(Integer currentFileDuration) {
this.currentFileDuration = currentFileDuration;
}
public Integer getTotalVideoDuration() {
return TotalVideoDuration;
}
public void setTotalVideoDuration(Integer totalVideoDuration) {
TotalVideoDuration = totalVideoDuration;
}
}

View File

@ -1,32 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnServerKeepaliveABLHookParam {
private String localipAddress;
private String mediaServerId;
private String datetime;
public String getLocalipAddress() {
return localipAddress;
}
public void setLocalipAddress(String localipAddress) {
this.localipAddress = localipAddress;
}
public String getMediaServerId() {
return mediaServerId;
}
public void setMediaServerId(String mediaServerId) {
this.mediaServerId = mediaServerId;
}
public String getDatetime() {
return datetime;
}
public void setDatetime(String datetime) {
this.datetime = datetime;
}
}

View File

@ -1,32 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
public class OnServerStaredABLHookParam {
private String localipAddress;
private String mediaServerId;
private String datetime;
public String getLocalipAddress() {
return localipAddress;
}
public void setLocalipAddress(String localipAddress) {
this.localipAddress = localipAddress;
}
public String getMediaServerId() {
return mediaServerId;
}
public void setMediaServerId(String mediaServerId) {
this.mediaServerId = mediaServerId;
}
public String getDatetime() {
return datetime;
}
public void setDatetime(String datetime) {
this.datetime = datetime;
}
}

View File

@ -1,245 +0,0 @@
package com.genersoft.iot.vmp.media.abl.bean.hook;
import com.genersoft.iot.vmp.media.abl.bean.AblUrls;
/**
*
*/
public class OnStreamArriveABLHookParam extends ABLHookParam{
/**
* Id
*/
private String callId;
/**
*
*/
private Boolean status;
/**
*
*/
private Boolean enableHls;
/**
*
*/
private Boolean transcodingStatus;
/**
*
*/
private String sourceURL;
/**
*
*/
private Integer readerCount;
/**
*
*/
private Integer noneReaderDuration;
/**
*
*/
private String videoCodec;
/**
*
*/
private Integer videoFrameSpeed;
/**
*
*/
private Integer width;
/**
*
*/
private Integer height;
/**
*
*/
private Integer videoBitrate;
/**
*
*/
private String audioCodec;
/**
*
*/
private Integer audioChannels;
/**
*
*/
private Integer audioSampleRate;
/**
*
*/
private Integer audioBitrate;
private AblUrls url;
public String getCallId() {
return callId;
}
public void setCallId(String callId) {
this.callId = callId;
}
public Boolean getStatus() {
return status;
}
public void setStatus(Boolean status) {
this.status = status;
}
public Boolean getEnableHls() {
return enableHls;
}
public void setEnableHls(Boolean enableHls) {
this.enableHls = enableHls;
}
public Boolean getTranscodingStatus() {
return transcodingStatus;
}
public void setTranscodingStatus(Boolean transcodingStatus) {
this.transcodingStatus = transcodingStatus;
}
public String getSourceURL() {
return sourceURL;
}
public void setSourceURL(String sourceURL) {
this.sourceURL = sourceURL;
}
public Integer getReaderCount() {
return readerCount;
}
public void setReaderCount(Integer readerCount) {
this.readerCount = readerCount;
}
public Integer getNoneReaderDuration() {
return noneReaderDuration;
}
public void setNoneReaderDuration(Integer noneReaderDuration) {
this.noneReaderDuration = noneReaderDuration;
}
public String getVideoCodec() {
return videoCodec;
}
public void setVideoCodec(String videoCodec) {
this.videoCodec = videoCodec;
}
public Integer getVideoFrameSpeed() {
return videoFrameSpeed;
}
public void setVideoFrameSpeed(Integer videoFrameSpeed) {
this.videoFrameSpeed = videoFrameSpeed;
}
public Integer getWidth() {
return width;
}
public void setWidth(Integer width) {
this.width = width;
}
public Integer getHeight() {
return height;
}
public void setHeight(Integer height) {
this.height = height;
}
public Integer getVideoBitrate() {
return videoBitrate;
}
public void setVideoBitrate(Integer videoBitrate) {
this.videoBitrate = videoBitrate;
}
public String getAudioCodec() {
return audioCodec;
}
public void setAudioCodec(String audioCodec) {
this.audioCodec = audioCodec;
}
public Integer getAudioChannels() {
return audioChannels;
}
public void setAudioChannels(Integer audioChannels) {
this.audioChannels = audioChannels;
}
public Integer getAudioSampleRate() {
return audioSampleRate;
}
public void setAudioSampleRate(Integer audioSampleRate) {
this.audioSampleRate = audioSampleRate;
}
public Integer getAudioBitrate() {
return audioBitrate;
}
public void setAudioBitrate(Integer audioBitrate) {
this.audioBitrate = audioBitrate;
}
public AblUrls getUrl() {
return url;
}
public void setUrl(AblUrls url) {
this.url = url;
}
}

View File

@ -1,24 +0,0 @@
package com.genersoft.iot.vmp.media.abl.event;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import org.springframework.context.ApplicationEvent;
/**
* zlm
*/
public class HookAblServerKeepaliveEvent extends ApplicationEvent {
public HookAblServerKeepaliveEvent(Object source) {
super(source);
}
private MediaServer mediaServerItem;
public MediaServer getMediaServerItem() {
return mediaServerItem;
}
public void setMediaServerItem(MediaServer mediaServerItem) {
this.mediaServerItem = mediaServerItem;
}
}

View File

@ -1,24 +0,0 @@
package com.genersoft.iot.vmp.media.abl.event;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import org.springframework.context.ApplicationEvent;
/**
* zlm server_start
*/
public class HookAblServerStartEvent extends ApplicationEvent {
public HookAblServerStartEvent(Object source) {
super(source);
}
private MediaServer mediaServerItem;
public MediaServer getMediaServerItem() {
return mediaServerItem;
}
public void setMediaServerItem(MediaServer mediaServerItem) {
this.mediaServerItem = mediaServerItem;
}
}