mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-20 20:37:50 +08:00
修复拉流代理转国标级联点播失败的BUG
This commit is contained in:
parent
5f4d78fe8f
commit
54f6ff9f81
@ -118,6 +118,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||
|
||||
@Override
|
||||
public void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback<StreamInfo> callback) {
|
||||
log.info("[通用通道] 播放, 类型: {}, 编号:{}", channel.getDataType(), channel.getGbDeviceId());
|
||||
if (channel.getDataType() == ChannelDataType.GB28181.value) {
|
||||
// 国标通道
|
||||
playGbDeviceChannel(channel, record, callback);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.genersoft.iot.vmp.streamProxy.service.impl;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||
import com.genersoft.iot.vmp.conf.exception.ControllerException;
|
||||
@ -12,9 +11,9 @@ import com.genersoft.iot.vmp.media.event.hook.HookSubscribe;
|
||||
import com.genersoft.iot.vmp.media.event.hook.HookType;
|
||||
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
|
||||
import com.genersoft.iot.vmp.media.service.IMediaServerService;
|
||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService;
|
||||
import com.genersoft.iot.vmp.service.bean.ErrorCallback;
|
||||
import com.genersoft.iot.vmp.service.bean.InviteErrorCode;
|
||||
import com.genersoft.iot.vmp.service.redisMsg.IRedisRpcPlayService;
|
||||
import com.genersoft.iot.vmp.streamProxy.bean.StreamProxy;
|
||||
import com.genersoft.iot.vmp.streamProxy.dao.StreamProxyMapper;
|
||||
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyPlayService;
|
||||
@ -107,6 +106,7 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService {
|
||||
|
||||
@Override
|
||||
public StreamInfo start(int id, Boolean record, ErrorCallback<StreamInfo> callback) {
|
||||
log.info("[拉流代理], 开始拉流,ID:{}", id);
|
||||
StreamProxy streamProxy = streamProxyMapper.select(id);
|
||||
if (streamProxy == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR404.getCode(), "代理信息未找到");
|
||||
@ -114,6 +114,15 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService {
|
||||
if (record != null) {
|
||||
streamProxy.setEnableMp4(record);
|
||||
}
|
||||
if (streamProxy.getMediaServerId() != null) {
|
||||
StreamInfo streamInfo = mediaServerService.getStreamInfoByAppAndStreamWithCheck(streamProxy.getApp(), streamProxy.getStream(), streamProxy.getMediaServerId(), false);
|
||||
if (streamInfo != null) {
|
||||
callbackMap.remove(id);
|
||||
streamInfoMap.remove(id);
|
||||
callback.run(InviteErrorCode.SUCCESS.getCode(), InviteErrorCode.SUCCESS.getMsg(), streamInfo);
|
||||
return streamInfo;
|
||||
}
|
||||
}
|
||||
|
||||
StreamInfo streamInfo = startProxy(streamProxy);
|
||||
if (callback != null) {
|
||||
@ -121,6 +130,7 @@ public class StreamProxyPlayServiceImpl implements IStreamProxyPlayService {
|
||||
String timeOutTaskKey = UUID.randomUUID().toString();
|
||||
Hook rtpHook = Hook.getInstance(HookType.on_media_arrival, streamProxy.getApp(), streamProxy.getStream(), streamInfo.getMediaServer().getId());
|
||||
dynamicTask.startDelay(timeOutTaskKey, () -> {
|
||||
log.info("[拉流代理], 收流超时,ID:{}", id);
|
||||
// 收流超时
|
||||
subscribe.removeSubscribe(rtpHook);
|
||||
callback.run(InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getCode(), InviteErrorCode.ERROR_FOR_STREAM_TIMEOUT.getMsg(), streamInfo);
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div id="linkChannelRecord" style="width: 100%; background-color: #FFFFFF; display: grid; grid-template-columns: 200px auto;">
|
||||
<div id="linkChannelRecord" style="width: 100%; background-color: #FFFFFF;">
|
||||
<el-dialog v-el-drag-dialog v-if="showDialog" v-loading="dialogLoading" title="通道关联" top="2rem" width="80%" :close-on-click-modal="false" :visible.sync="showDialog" :destroy-on-close="true" @close="close()">
|
||||
<div style="display: grid; grid-template-columns: 100px auto;">
|
||||
<div style="display: grid; grid-template-columns: 100px minmax(0, 1fr);">
|
||||
<el-tabs v-model="hasLink" tab-position="left" style="" @tab-click="search">
|
||||
<el-tab-pane label="未关联" name="false" />
|
||||
<el-tab-pane label="已关联" name="true" />
|
||||
|
||||
Loading…
Reference in New Issue
Block a user