|  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.hook.*; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.*; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | GbStream gbStream = storager.getGbStream(param.getApp(), param.getStream()); | 
|---|
|  |  |  | if (gbStream != null) { | 
|---|
|  |  |  | eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF); | 
|---|
|  |  |  | if (userSetting.isUsePushingAsStatus()) { | 
|---|
|  |  |  | eventPublisher.catalogEventPublishForStream(null, gbStream, param.isRegist()?CatalogEvent.ON:CatalogEvent.OFF); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (type != null) { | 
|---|
|  |  |  | // 发送流变化redis消息 | 
|---|
|  |  |  | 
|---|
|  |  |  | if ("rtp".equals(param.getApp())) { | 
|---|
|  |  |  | ret.put("close", userSetting.getStreamOnDemand()); | 
|---|
|  |  |  | // 国标流, 点播/录像回放/录像下载 | 
|---|
|  |  |  | //            StreamInfo streamInfoForPlayCatch = redisCatchStorage.queryPlayByStreamId(param.getStream()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | InviteInfo inviteInfo = inviteStreamService.getInviteInfoByStream(null, param.getStream()); | 
|---|
|  |  |  | // 点播 | 
|---|
|  |  |  | if (inviteInfo != null) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | redisCatchStorage.deleteSendRTPServer(parentPlatform.getServerGBId(), sendRtpItem.getChannelId(), | 
|---|
|  |  |  | sendRtpItem.getCallId(), sendRtpItem.getStreamId()); | 
|---|
|  |  |  | if (InviteStreamType.PUSH == sendRtpItem.getPlayType()) { | 
|---|
|  |  |  | MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(0, | 
|---|
|  |  |  | sendRtpItem.getApp(), sendRtpItem.getStreamId(), sendRtpItem.getChannelId(), | 
|---|
|  |  |  | sendRtpItem.getPlatformId(), parentPlatform.getName(), userSetting.getServerId(), sendRtpItem.getMediaServerId()); | 
|---|
|  |  |  | messageForPushChannel.setPlatFormIndex(parentPlatform.getId()); | 
|---|
|  |  |  | redisCatchStorage.sendPlatformStopPlayMsg(messageForPushChannel); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | // 拉流代理 | 
|---|
|  |  |  | StreamProxyItem streamProxyItem = streamProxyService.getStreamProxyByAppAndStream(param.getApp(), param.getStream()); | 
|---|
|  |  |  | if (streamProxyItem != null) { | 
|---|
|  |  |  | if (streamProxyItem.isEnableDisableNoneReader()) { | 
|---|
|  |  |  | if (streamProxyItem.isEnableRemoveNoneReader()) { | 
|---|
|  |  |  | // 无人观看自动移除 | 
|---|
|  |  |  | ret.put("close", true); | 
|---|
|  |  |  | streamProxyService.del(param.getApp(), param.getStream()); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return ret; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 推流具有主动性,暂时不做处理 | 
|---|
|  |  |  | // TODO 推流具有主动性,暂时不做处理 | 
|---|
|  |  |  | //         StreamPushItem streamPushItem = streamPushService.getPush(app, streamId); | 
|---|
|  |  |  | //         if (streamPushItem != null) { | 
|---|
|  |  |  | //            // TODO 发送停止 | 
|---|
|  |  |  | 
|---|
|  |  |  | resultHolder.put(key, uuid, result); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (!exist) { | 
|---|
|  |  |  | playService.play(mediaInfo, deviceId, channelId, (code, message, data) -> { | 
|---|
|  |  |  | playService.play(mediaInfo, deviceId, channelId, null, (code, message, data) -> { | 
|---|
|  |  |  | msg.setData(new HookResult(code, message)); | 
|---|
|  |  |  | resultHolder.invokeResult(msg); | 
|---|
|  |  |  | }); | 
|---|