| | |
| | | import com.genersoft.iot.vmp.gb28181.session.SSRCFactory; |
| | | import com.genersoft.iot.vmp.gb28181.session.VideoStreamSessionManager; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommanderFroPlatform; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.ZlmHttpHookSubscribe; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForStreamChange; |
| | |
| | | private ParentPlatformMapper platformMapper; |
| | | |
| | | @Autowired |
| | | private PlatformCatalogMapper catalogMapper; |
| | | |
| | | @Autowired |
| | | private PlatformChannelMapper platformChannelMapper; |
| | | |
| | | @Autowired |
| | | private PlatformGbStreamMapper platformGbStreamMapper; |
| | | |
| | | @Autowired |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | | @Autowired |
| | |
| | | private DynamicTask dynamicTask; |
| | | |
| | | @Autowired |
| | | private ZLMServerFactory ZLMServerFactory; |
| | | private ZLMServerFactory zlmServerFactory; |
| | | |
| | | @Autowired |
| | | private SubscribeHolder subscribeHolder; |
| | |
| | | param.put("vhost", "__defaultVhost__"); |
| | | param.put("app", sendRtpItem.getApp()); |
| | | param.put("stream", sendRtpItem.getStream()); |
| | | ZLMServerFactory.stopSendRtpStream(mediaInfo, param); |
| | | zlmServerFactory.stopSendRtpStream(mediaInfo, param); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | InviteInfo inviteInfo = inviteStreamService.getInviteInfoByDeviceAndChannel(InviteSessionType.PLAY, platform.getServerGBId(), channelId); |
| | | |
| | | |
| | | if (inviteInfo != null && inviteInfo.getStreamInfo() != null) { |
| | | // 如果zlm不存在这个流,则删除数据即可 |
| | | MediaServerItem mediaServerItemForStreamInfo = mediaServerService.getOne(inviteInfo.getStreamInfo().getMediaServerId()); |
| | | if (mediaServerItemForStreamInfo != null) { |
| | | Boolean ready = zlmrtpServerFactory.isStreamReady(mediaServerItemForStreamInfo, inviteInfo.getStreamInfo().getApp(), inviteInfo.getStreamInfo().getStream()); |
| | | Boolean ready = zlmServerFactory.isStreamReady(mediaServerItemForStreamInfo, inviteInfo.getStreamInfo().getApp(), inviteInfo.getStreamInfo().getStream()); |
| | | if (!ready) { |
| | | // 错误存在于redis中的数据 |
| | | inviteStreamService.removeInviteInfo(inviteInfo); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void stopBroadcast(ParentPlatform platform, String channelId, String stream) throws InvalidArgumentException, ParseException, SsrcTransactionNotFoundException, SipException { |
| | | commanderForPlatform.streamByeCmd(platform, channelId, stream, null, null); |
| | | public void stopBroadcast(ParentPlatform platform, DeviceChannel channel, String stream, boolean sendBye, MediaServerItem mediaServerItem) { |
| | | |
| | | try { |
| | | if (sendBye) { |
| | | commanderForPlatform.streamByeCmd(platform, channel.getChannelId(), stream, null, null); |
| | | } |
| | | } catch (InvalidArgumentException | SipException | ParseException | SsrcTransactionNotFoundException e) { |
| | | logger.warn("[消息发送失败] 停止语音对讲, 平台:{},通道:{}", platform.getId(), channel.getChannelId() ); |
| | | } finally { |
| | | mediaServerService.closeRTPServer(mediaServerItem, stream); |
| | | InviteInfo inviteInfo = inviteStreamService.getInviteInfo(null, platform.getServerGBId(), channel.getChannelId(), stream); |
| | | if (inviteInfo != null) { |
| | | // 释放ssrc |
| | | mediaServerService.releaseSsrc(mediaServerItem.getId(), inviteInfo.getSsrcInfo().getSsrc()); |
| | | inviteStreamService.removeInviteInfo(inviteInfo); |
| | | } |
| | | streamSession.remove(platform.getServerGBId(), channel.getChannelId(), stream); |
| | | } |
| | | } |
| | | } |