临时提交

This commit is contained in:
648540858
2024-08-08 22:43:37 +08:00
parent 9aad6ac719
commit 8ab88c0f02
10 changed files with 60 additions and 47 deletions

View File

@@ -102,4 +102,7 @@ public class ParentPlatform {
@Schema(description = "是否使用自定义业务分组")
private Boolean customCatalog;
@Schema(description = "是否自动推送通道变化")
private Boolean autoPushChannel;
}

View File

@@ -146,9 +146,9 @@ public interface CommonGBChannelMapper {
int update(CommonGBChannel commonGBChannel);
@Update(value = {" <script>" +
"UPDATE wvp_device_channel " +
"SET gb_status = #{gbStatus}" +
"WHERE id = #{gbId}"+
" UPDATE wvp_device_channel " +
" SET gb_status = #{status}" +
" WHERE id = #{gbId}"+
" </script>"})
int updateStatusById(@Param("gbId") int gbId, @Param("status") int status);

View File

@@ -108,7 +108,7 @@ public class ChannelProvider {
sqlBuild.append(getBaseSelectSql());
sqlBuild.append("where gb_status=#{status} and id in ( ");
List<CommonGBChannel> commonGBChannelList = (List<CommonGBChannel>)params.get("ids");
List<CommonGBChannel> commonGBChannelList = (List<CommonGBChannel>)params.get("commonGBChannelList");
boolean first = true;
for (CommonGBChannel channel : commonGBChannelList) {
if (!first) {

View File

@@ -315,7 +315,7 @@ public class PlatformServiceImpl implements IPlatformService {
},
(parentPlatform.getKeepTimeout())*1000);
}
if (parentPlatform.isAutoPushChannel()) {
if (parentPlatform.getAutoPushChannel() != null && parentPlatform.getAutoPushChannel()) {
if (subscribeHolder.getCatalogSubscribe(parentPlatform.getServerGBId()) == null) {
log.info("[国标级联]{}, 添加自动通道推送模拟订阅信息", parentPlatform.getServerGBId());
addSimulatedSubscribeInfo(parentPlatform);

View File

@@ -197,7 +197,8 @@ public class SubscribeRequestProcessor extends SIPRequestProcessorParent impleme
} catch (SipException | InvalidArgumentException | ParseException e) {
log.error("未处理的异常 ", e);
}
if (subscribeHolder.getCatalogSubscribe(platformId) == null && platform.isAutoPushChannel()) {
if (subscribeHolder.getCatalogSubscribe(platformId) == null
&& platform.getAutoPushChannel() != null && platform.getAutoPushChannel()) {
platformService.addSimulatedSubscribeInfo(platform);
}
}

View File

@@ -692,7 +692,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
@Override
public void addPushListItem(String app, String stream, MediaArrivalEvent event) {
String key = VideoManagerConstants.PUSH_STREAM_LIST + app + "_" + stream;
redisTemplate.opsForValue().set(key, event.getHookParam());
redisTemplate.opsForValue().set(key, event);
}
@Override

View File

@@ -74,7 +74,7 @@ public class StreamPush extends CommonGBChannel implements Comparable<StreamPush
* 拉起离线推流
*/
@Schema(description = "拉起离线推流")
private boolean autoPushChannel;
private boolean startOfflinePush;
@Override
public int compareTo(@NotNull StreamPush streamPushItem) {

View File

@@ -4,10 +4,8 @@ import com.baomidou.dynamic.datasource.annotation.DS;
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.event.hook.HookSubscribe;
import com.genersoft.iot.vmp.media.event.media.MediaArrivalEvent;
import com.genersoft.iot.vmp.media.service.IMediaServerService;
import com.genersoft.iot.vmp.media.zlm.SendRtpPortManager;
import com.genersoft.iot.vmp.media.zlm.dto.StreamAuthorityInfo;
import com.genersoft.iot.vmp.service.bean.ErrorCallback;
import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
@@ -20,7 +18,6 @@ import com.genersoft.iot.vmp.streamPush.service.IStreamPushPlayService;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
@@ -46,21 +43,12 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
@Autowired
private DynamicTask dynamicTask;
@Autowired
private HookSubscribe subscribe;
@Autowired
private IRedisRpcService redisRpcService;
@Autowired
private RedisTemplate<String, Object> redisTemplate;
@Autowired
private RedisPushStreamResponseListener redisPushStreamResponseListener;
@Autowired
private SendRtpPortManager sendRtpPortManager;
@Override
public void start(Integer id, ErrorCallback<StreamInfo> callback, String platformDeviceId, String platformName ) {
StreamPush streamPush = streamPushMapper.queryOne(id);
@@ -76,7 +64,7 @@ public class StreamPushPlayServiceImpl implements IStreamPushPlayService {
streamPush.getApp(), streamPush.getStream(), null, callId));
return;
}
Assert.isTrue(streamPush.isAutoPushChannel(), "通道未推流");
Assert.isTrue(streamPush.isStartOfflinePush(), "通道未推流");
// 发送redis消息以使设备上线流上线后被
log.info("[ app={}, stream={} ]通道未推流发送redis信息控制设备开始推流", streamPush.getApp(), streamPush.getStream());
MessageForPushChannel messageForPushChannel = MessageForPushChannel.getInstance(1,