diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java index 3aad0035..47ca3ac5 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/LogServiceImpl.java @@ -24,7 +24,7 @@ public class LogServiceImpl implements ILogService { @Override public List queryList(String query, String startTime, String endTime) { File logFile = getLogDir(); - if (logFile == null && !logFile.exists()) { + if (logFile == null || !logFile.exists()) { throw new ControllerException(ErrorCode.ERROR100.getCode(), "获取日志文件目录失败"); } File[] files = logFile.listFiles(); diff --git a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java index d56cc286..30ed9155 100644 --- a/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/streamPush/service/impl/StreamPushPlayServiceImpl.java @@ -4,6 +4,7 @@ import com.genersoft.iot.vmp.common.StreamInfo; import com.genersoft.iot.vmp.conf.DynamicTask; import com.genersoft.iot.vmp.conf.UserSetting; import com.genersoft.iot.vmp.media.bean.MediaInfo; +import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.media.service.IMediaServerService; import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo; import com.genersoft.iot.vmp.service.bean.ErrorCallback; @@ -51,15 +52,22 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService { public void start(Integer id, ErrorCallback callback, String platformDeviceId, String platformName ) { StreamPush streamPush = streamPushMapper.queryOne(id); Assert.notNull(streamPush, "推流信息未找到"); - MediaInfo mediaInfo = redisCatchStorage.getPushListItem(streamPush.getApp(), streamPush.getStream()); + + MediaServer mediaServer = mediaServerService.getOne(streamPush.getMediaServerId()); + Assert.notNull(mediaServer, "节点" + streamPush.getMediaServerId() + "未找到"); + MediaInfo mediaInfo = mediaServerService.getMediaInfo(mediaServer, streamPush.getApp(), streamPush.getStream()); if (mediaInfo != null) { String callId = null; StreamAuthorityInfo streamAuthorityInfo = redisCatchStorage.getStreamAuthorityInfo(streamPush.getApp(), streamPush.getStream()); if (streamAuthorityInfo != null) { callId = streamAuthorityInfo.getCallId(); } - callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), mediaServerService.getStreamInfoByAppAndStream(mediaInfo.getMediaServer(), + callback.run(ErrorCode.SUCCESS.getCode(), ErrorCode.SUCCESS.getMsg(), mediaServerService.getStreamInfoByAppAndStream(mediaServer, streamPush.getApp(), streamPush.getStream(), mediaInfo, callId)); + if (!streamPush.isPushing()) { + streamPush.setPushing(true); + streamPushMapper.update(streamPush); + } return; } Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流"); diff --git a/数据库/2.7.3/更新-postgresql-kingbase-2.7.3.sql b/数据库/2.7.3/更新-postgresql-kingbase-2.7.3.sql index a330045b..237c9d75 100644 --- a/数据库/2.7.3/更新-postgresql-kingbase-2.7.3.sql +++ b/数据库/2.7.3/更新-postgresql-kingbase-2.7.3.sql @@ -22,8 +22,8 @@ update wvp_device_channel wdc set data_type = 2, data_device_id = (SELECT stream_push_id from wvp_device_channel where stream_push_id is not null and id = wdc.id ) where stream_push_id is not null; update wvp_device_channel wdc -set data_type = 1, data_device_id = (SELECT stream_proxy_id from wvp_device_channel where stream_proxy_id is not null and id = wdc.id ) where stream_proxy_id is not null; +set data_type = 3, data_device_id = (SELECT stream_proxy_id from wvp_device_channel where stream_proxy_id is not null and id = wdc.id ) where stream_proxy_id is not null; alter table wvp_device_channel drop device_db_id; alter table wvp_device_channel drop stream_push_id; -alter table wvp_device_channel drop stream_proxy_id; \ No newline at end of file +alter table wvp_device_channel drop stream_proxy_id;