修复推流信息播放

This commit is contained in:
648540858
2024-07-16 17:44:27 +08:00
parent d7abe7fb75
commit 8c95485504
5 changed files with 12 additions and 26 deletions

View File

@@ -6,6 +6,8 @@ import com.genersoft.iot.vmp.common.SystemAllInfo;
import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
import com.genersoft.iot.vmp.media.bean.MediaInfo;
import com.genersoft.iot.vmp.media.bean.MediaServer;
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
@@ -14,10 +16,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.hook.OnStreamChangedHookParam;
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.gb28181.dao.DeviceChannelMapper;
import com.genersoft.iot.vmp.gb28181.dao.DeviceMapper;
import com.genersoft.iot.vmp.storager.dao.dto.PlatformRegisterInfo;
import com.genersoft.iot.vmp.streamPush.bean.StreamPush;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.utils.JsonUtil;
import com.genersoft.iot.vmp.utils.SystemInfoUtils;
@@ -705,7 +704,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void removePushListItem(String app, String stream, String mediaServerId) {
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
StreamPush param = (StreamPush)redisTemplate.opsForValue().get(key);
OnStreamChangedHookParam param = (OnStreamChangedHookParam)redisTemplate.opsForValue().get(key);
if (param != null && param.getMediaServerId().equalsIgnoreCase(mediaServerId)) {
redisTemplate.delete(key);
}

View File

@@ -70,12 +70,6 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
@Schema(description = "是否正在推流")
private boolean pushIng;
/**
* 是否自己平台的推流
*/
@Schema(description = "是否自己平台的推流")
private boolean self;
@Override
public int compareTo(@NotNull StreamPush streamPushItem) {
return Long.valueOf(DateUtil.yyyy_MM_dd_HH_mm_ssToTimestamp(this.createTime)

View File

@@ -213,10 +213,6 @@ public class StreamPushController {
if (userInfo!= null) {
authority = true;
}
StreamPush push = streamPushService.getPush(app, stream);
if (push != null && !push.isSelf()) {
throw new ControllerException(ErrorCode.ERROR100.getCode(), "来自其他平台的推流信息");
}
StreamInfo streamInfo = mediaServerService.getStreamInfoByAppAndStreamWithCheck(app, stream, mediaServerId, authority);
if (streamInfo == null){
throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取播放地址失败");

View File

@@ -96,7 +96,6 @@ public class StreamPushServiceImpl implements IStreamPushService {
streamPush.setPushIng(true);
streamPush.setUpdateTime(DateUtil.getNow());
streamPush.setPushTime(DateUtil.getNow());
streamPush.setSelf(true);
add(streamPush);
}else {
updatePushStatus(streamPushInDb.getId(), true);
@@ -243,6 +242,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
if (streamPush.getGbId() > 0) {
gbChannelService.delete(streamPush.getGbId());
}
streamPushMapper.del(streamPush.getId());
}
@Override
@Transactional
@@ -522,7 +522,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public void updateStatus(StreamPush push) {
if (push.getGbDeviceId() != null) {
if (ObjectUtils.isEmpty(push.getGbDeviceId())) {
return;
}
if ("ON".equalsIgnoreCase(push.getGbStatus())) {