| | |
| | | String channelId = ssrcTransactionForAll.get(0).getChannelId();
|
| | | DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
|
| | | if (deviceChannel != null) {
|
| | | result.setEnable_audio(deviceChannel.isHasAudio());
|
| | | result.setEnable_audio(deviceChannel.getHasAudio());
|
| | | }
|
| | | // 如果是录像下载就设置视频间隔十秒
|
| | | if (ssrcTransactionForAll.get(0).getType() == InviteSessionType.DOWNLOAD) {
|
| | |
| | | MediaServerItem mediaInfo = mediaServerService.getOne(param.getMediaServerId());
|
| | | if (mediaInfo == null) {
|
| | | logger.info("[ZLM HOOK] 流变化未找到ZLM, {}", param.getMediaServerId());
|
| | | return;
|
| | | }
|
| | | if (!ObjectUtils.isEmpty(mediaInfo.getTranscodeSuffix())
|
| | | && !"null".equalsIgnoreCase(mediaInfo.getTranscodeSuffix())
|
| | | && param.getStream().endsWith(mediaInfo.getTranscodeSuffix()) ) {
|
| | | return;
|
| | | }
|
| | | if (subscribe != null) {
|
| | |
| | | }
|
| | | if (sendRtpItem.getApp().equals(param.getApp())) {
|
| | | // 在hook收到这个消息,说明发流一定是本级完成的。
|
| | | redisCatchStorage.deleteSendRTPServer(sendRtpItem);
|
| | | ssrcFactory.releaseSsrc(sendRtpItem.getMediaServerId(), sendRtpItem.getSsrc());
|
| | | ParentPlatform platform = storager.queryParentPlatByServerGBId(sendRtpItem.getPlatformId());
|
| | | Device device = deviceService.getDevice(sendRtpItem.getPlatformId());
|
| | | try {
|
| | | if (platform != null) {
|
| | | commanderFroPlatform.streamByeCmd(platform, sendRtpItem);
|
| | | redisCatchStorage.deleteSendRTPServer(sendRtpItem);
|
| | | redisCatchStorage.sendPlatformStopPlayMsg(sendRtpItem, platform);
|
| | | } else if (device != null) {
|
| | | cmder.streamByeCmd(device, sendRtpItem.getChannelId(), param.getStream(), sendRtpItem.getCallId());
|
| | |
| | | }
|
| | | }else {
|
| | | // 通知其他wvp停止发流
|
| | | redisRpcService.rtpSendStopped(sendRtpItem);
|
| | | redisRpcService.rtpSendStopped(sendRtpItem.getRedisKey());
|
| | | }
|
| | | } catch (SipException | InvalidArgumentException | ParseException |
|
| | | SsrcTransactionNotFoundException e) {
|
| | |
| | |
|
| | | logger.info("[ZLM HOOK]流无人观看:{}->{}->{}/{}", param.getMediaServerId(), param.getSchema(),
|
| | | param.getApp(), param.getStream());
|
| | |
|
| | | MediaServerItem mediaInfo = mediaServerService.getOne(param.getMediaServerId());
|
| | | if (mediaInfo == null) {
|
| | | JSONObject ret = new JSONObject();
|
| | | ret.put("code", 0);
|
| | | return ret;
|
| | | }
|
| | | if (!ObjectUtils.isEmpty(mediaInfo.getTranscodeSuffix())
|
| | | && !"null".equalsIgnoreCase(mediaInfo.getTranscodeSuffix())
|
| | | && param.getStream().endsWith(mediaInfo.getTranscodeSuffix()) ) {
|
| | | param.setStream(param.getStream().substring(0, param.getStream().lastIndexOf(mediaInfo.getTranscodeSuffix()) -1 ));
|
| | | }
|
| | |
|
| | | JSONObject ret = new JSONObject();
|
| | | ret.put("code", 0);
|
| | | // 国标类型的流
|