|
|
@@ -142,6 +142,17 @@ public class SDeviceService extends ServiceImpl<SDeviceMapper, SDevice> {
|
|
|
if (Objects.isNull(sDevice)) {
|
|
|
throw new BusinessException("视频流不存在");
|
|
|
}
|
|
|
+ //切换未使用中时主动拉流
|
|
|
+ if (Objects.equals(streamUpdateStatusRes.getUseFlag(), 1)) {
|
|
|
+ ThreadTask.addJob(() -> {
|
|
|
+ if (sDevice.getType() == 1) {
|
|
|
+ apiProxy.rtspPull(sDevice.getPath(), sDevice.getTarget(), "");
|
|
|
+ }
|
|
|
+ if (sDevice.getType() == 2) {
|
|
|
+ apiProxy.rtmpPull(sDevice.getPath(), sDevice.getTarget(), "");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
SDevice sDevice1 = new SDevice();
|
|
|
BeanUtil.copyProperties(streamUpdateStatusRes, sDevice1);
|
|
|
return sDeviceMapper.updateById(sDevice1);
|