From da63ef5b1988c85675d62e853dbce78c163d3736 Mon Sep 17 00:00:00 2001 From: che_shuai Date: Fri, 22 Sep 2023 11:34:10 +0800 Subject: [PATCH 01/38] =?UTF-8?q?=E6=8E=A8=E6=B5=81=E5=88=97=E8=A1=A8-->?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=80=9A=E9=81=93=20=E8=A1=A5=E5=85=85?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E9=9C=80=E8=A6=81=E7=9A=84=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=8F=82=E6=95=B0=20=20=E5=AA=92=E4=BD=93=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=99=A8ID,=E6=98=AF=E5=90=A6=E6=9C=AC=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E6=8E=A8=E9=80=81,=E6=98=AF=E5=90=A6=E6=AD=A3=E5=9C=A8?= =?UTF-8?q?=E6=8E=A8=E9=80=81(=E5=BD=B1=E5=93=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E6=98=AF=E5=90=A6=E6=98=BE=E7=A4=BA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java index dcaab9e3..7b9664b0 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java @@ -506,6 +506,9 @@ public class StreamPushServiceImpl implements IStreamPushService { stream.setUpdateTime(DateUtil.getNow()); stream.setCreateTime(DateUtil.getNow()); stream.setServerId(userSetting.getServerId()); + stream.setMediaServerId(mediaConfig.getId()); + stream.setSelf(true); + stream.setPushIng(true); // 放在事务内执行 boolean result = false; From f6c1ce15e4ce1e30cf3328bb89cf02b06eadf776 Mon Sep 17 00:00:00 2001 From: AlphaWu Date: Sun, 1 Oct 2023 12:29:48 +0800 Subject: [PATCH 02/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E8=84=9A=E6=9C=AC=E7=9A=84BUG=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/2.6.9更新.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/2.6.9更新.sql b/sql/2.6.9更新.sql index 769004d2..f8f44d95 100644 --- a/sql/2.6.9更新.sql +++ b/sql/2.6.9更新.sql @@ -5,4 +5,4 @@ alter table wvp_platform add auto_push_channel bool default false alter table wvp_stream_proxy - add stream_key varying(255) + add stream_key character varying(255) From 4084080a8e8162260afc4733865c347a8a816d49 Mon Sep 17 00:00:00 2001 From: xubinbin <1323875150@qq.com> Date: Tue, 10 Oct 2023 15:17:06 +0800 Subject: [PATCH 03/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=A8=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E7=9A=84=E7=A7=BB?= =?UTF-8?q?=E5=8A=A8=E4=BD=8D=E7=BD=AE=E8=AE=A2=E9=98=85=E7=94=B1=E9=9D=9E?= =?UTF-8?q?0=E5=80=BC=E6=94=B9=E4=B8=BA0=E5=80=BC=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java index 0d99eccd..f0e3f230 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/DeviceServiceImpl.java @@ -544,6 +544,8 @@ public class DeviceServiceImpl implements IDeviceService { } }else if (device.getSubscribeCycleForMobilePosition() == 0) { if (deviceInStore.getSubscribeCycleForMobilePosition() != 0) { + deviceInStore.setMobilePositionSubmissionInterval(device.getMobilePositionSubmissionInterval()); + deviceInStore.setSubscribeCycleForMobilePosition(device.getSubscribeCycleForMobilePosition()); // 取消订阅 removeMobilePositionSubscribe(deviceInStore); } From f5d89e06a3915a7e3d0032673f2849a42449c190 Mon Sep 17 00:00:00 2001 From: chenzhangyue Date: Wed, 11 Oct 2023 13:52:08 +0800 Subject: [PATCH 04/38] =?UTF-8?q?feat:=E6=94=AF=E6=8C=81=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E6=8B=89=E6=B5=81=E7=8A=B6=E6=80=81=E6=A3=80=E6=B5=8B=EF=BC=8C?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF=E6=9F=A5=E8=AF=A2=E6=B5=81=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E7=A6=BB=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iot/vmp/media/zlm/ZLMRESTfulUtils.java | 15 +++++++ .../iot/vmp/media/zlm/ZLMRunner.java | 1 + .../service/impl/StreamProxyServiceImpl.java | 43 +++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java index 84e9e7e6..52bc9028 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRESTfulUtils.java @@ -215,6 +215,21 @@ public class ZLMRESTfulUtils { } } + public JSONObject isMediaOnline(MediaServerItem mediaServerItem, String app, String stream, String schema){ + Map param = new HashMap<>(); + if (app != null) { + param.put("app",app); + } + if (stream != null) { + param.put("stream",stream); + } + if (schema != null) { + param.put("schema",schema); + } + param.put("vhost","__defaultVhost__"); + return sendPost(mediaServerItem, "isMediaOnline", param, null); + } + public JSONObject getMediaList(MediaServerItem mediaServerItem, String app, String stream, String schema, RequestCallback callback){ Map param = new HashMap<>(); if (app != null) { diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java index 6e594024..4a781f31 100755 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMRunner.java @@ -9,6 +9,7 @@ import com.genersoft.iot.vmp.gb28181.event.EventPublisher; import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeFactory; import com.genersoft.iot.vmp.media.zlm.dto.HookSubscribeForServerStarted; import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; +import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; import com.genersoft.iot.vmp.service.IMediaServerService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java index 7fbe7691..eac543a3 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java @@ -35,15 +35,19 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.jdbc.datasource.DataSourceTransactionManager; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Service; import org.springframework.transaction.TransactionDefinition; import org.springframework.transaction.TransactionStatus; +import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 视频代理业务 @@ -560,4 +564,43 @@ public class StreamProxyServiceImpl implements IStreamProxyService { return new ResourceBaseInfo(total, online); } + + + @Scheduled(cron = "* 0/10 * * * ?") + public void asyncCheckStreamProxyStatus() { + + List all = mediaServerService.getAllOnline(); + + if (CollectionUtils.isEmpty(all)){ + return; + } + + Map serverItemMap = all.stream().collect(Collectors.toMap(MediaServerItem::getId, Function.identity(), (m1, m2) -> m1)); + + List list = videoManagerStorager.getStreamProxyListForEnable(true); + + if (CollectionUtils.isEmpty(list)){ + return; + } + + for (StreamProxyItem streamProxyItem : list) { + + MediaServerItem mediaServerItem = serverItemMap.get(streamProxyItem.getMediaServerId()); + + // TODO 支持其他 schema + JSONObject mediaInfo = zlmresTfulUtils.isMediaOnline(mediaServerItem, streamProxyItem.getApp(), streamProxyItem.getStream(), "rtsp"); + + if (mediaInfo == null){ + streamProxyItem.setStatus(false); + } else { + if (mediaInfo.getInteger("code") == 0 && mediaInfo.getBoolean("online")) { + streamProxyItem.setStatus(true); + } else { + streamProxyItem.setStatus(false); + } + } + + updateStreamProxy(streamProxyItem); + } + } } From 7d6aaf3bb0a4bdcc319eaec1840c78ab32cfa81e Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 12 Oct 2023 16:36:07 +0800 Subject: [PATCH 05/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=BD=E6=A0=87?= =?UTF-8?q?=E6=8E=A5=E8=BF=9E=E9=80=89=E6=8B=A9=E9=80=9A=E9=81=93=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PlatformChannelServiceImpl.java | 2 +- .../storager/dao/PlatformCatalogMapper.java | 16 +++++++- .../storager/dao/PlatformChannelMapper.java | 3 +- .../impl/VideoManagerStorageImpl.java | 37 +++++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java index 7ede0921..9f2b5e05 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlatformChannelServiceImpl.java @@ -162,7 +162,7 @@ public class PlatformChannelServiceImpl implements IPlatformChannelService { return 0; } if (ObjectUtils.isEmpty(catalogId)) { - catalogId = platform.getDeviceGBId(); + catalogId = null; } if ((result = platformChannelMapper.delChannelForGBByCatalogId(platformId, catalogId)) > 0) { diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java index edd34e5d..62d61019 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformCatalogMapper.java @@ -31,8 +31,8 @@ public interface PlatformCatalogMapper { @Update(value = {" "}) int update(@Param("platformCatalog") PlatformCatalog platformCatalog); @@ -51,4 +51,16 @@ public interface PlatformCatalogMapper { " from wvp_platform_catalog pc " + " WHERE pc.id=#{id} and pc.platform_id=#{platformId}") PlatformCatalog selectByPlatFormAndCatalogId(@Param("platformId") String platformId, @Param("id") String id); + + + @Delete("") + int deleteAll(String platformId, List ids); + + @Select("SELECT id from wvp_platform_catalog WHERE platform_id=#{platformId} and parent_id = #{id}") + List queryCatalogFromParent(@Param("id") String id, @Param("platformId") String platformId); } diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java index 38263506..f363f66f 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/PlatformChannelMapper.java @@ -105,7 +105,8 @@ public interface PlatformChannelMapper { void delByPlatformId(String serverGBId); @Delete("") int delChannelForGBByCatalogId(@Param("platformId") String platformId, @Param("catalogId") String catalogId); diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index a316a5cb..e96e09b2 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -73,6 +73,9 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { @Autowired private PlatformChannelMapper platformChannelMapper; + @Autowired + private PlatformCatalogMapper platformCatalogMapper; + @Autowired private StreamProxyMapper streamProxyMapper; @@ -910,9 +913,43 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { eventPublisher.catalogEventPublish(platformId, deviceChannelList, CatalogEvent.DEL); } int delChannelresult = platformChannelMapper.delByCatalogId(platformId, id); + // 查看是否存在子目录,如果存在一并删除 + List allChildCatalog = getAllChildCatalog(id, platformId); + if (!allChildCatalog.isEmpty()) { + int limitCount = 50; + if (allChildCatalog.size() > limitCount) { + for (int i = 0; i < allChildCatalog.size(); i += limitCount) { + int toIndex = i + limitCount; + if (i + limitCount > allChildCatalog.size()) { + toIndex = allChildCatalog.size(); + } + delChannelresult += platformCatalogMapper.deleteAll(platformId, allChildCatalog.subList(i, toIndex)); + } + }else { + delChannelresult += platformCatalogMapper.deleteAll(platformId, allChildCatalog); + } + } return delresult + delChannelresult + delStreamresult; } + private List getAllChildCatalog(String id, String platformId) { + List catalogList = platformCatalogMapper.queryCatalogFromParent(id, platformId); + List catalogListChild = new ArrayList<>(); + if (catalogList != null && !catalogList.isEmpty()) { + for (String childId : catalogList) { + List allChildCatalog = getAllChildCatalog(childId, platformId); + if (allChildCatalog != null && !allChildCatalog.isEmpty()) { + catalogListChild.addAll(allChildCatalog); + } + + } + } + if (!catalogListChild.isEmpty()) { + catalogList.addAll(catalogListChild); + } + return catalogList; + } + @Override public int updateCatalog(PlatformCatalog platformCatalog) { From 78f628dd6fca9be675376a20a753b6f4556e9844 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Thu, 12 Oct 2023 17:01:25 +0800 Subject: [PATCH 06/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=97=B6=E6=89=B9=E9=87=8F=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../storager/impl/VideoManagerStorageImpl.java | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index e96e09b2..d4062255 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -169,7 +169,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } } } - if (channels.size() > 0) { + if (!channels.isEmpty()) { for (DeviceChannel channel : channels) { if (subContMap.get(channel.getChannelId()) != null){ Integer count = subContMap.get(channel.getChannelId()); @@ -190,19 +190,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } try { int limitCount = 50; - int cleanChannelsResult = 0; - if (channels.size() > limitCount) { - for (int i = 0; i < channels.size(); i += limitCount) { - int toIndex = i + limitCount; - if (i + limitCount > channels.size()) { - toIndex = channels.size(); - } - cleanChannelsResult += this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels.subList(i, toIndex)); - } - } else { - cleanChannelsResult = this.deviceChannelMapper.cleanChannelsNotInList(deviceId, channels); - } - boolean result = cleanChannelsResult < 0; + boolean result = false; if (!result && addChannels.size() > 0) { if (addChannels.size() > limitCount) { for (int i = 0; i < addChannels.size(); i += limitCount) { From 12c4128e814d4bae84608172ccc92f6a66aa2254 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Fri, 13 Oct 2023 15:44:49 +0800 Subject: [PATCH 07/38] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E5=B7=B2=E5=88=A0=E9=99=A4=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E7=9A=84=E6=95=B4=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/VideoManagerStorageImpl.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java index d4062255..af9454d2 100755 --- a/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java @@ -129,6 +129,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { List updateChannels = new ArrayList<>(); List addChannels = new ArrayList<>(); + List deleteChannels = new ArrayList<>(); StringBuilder stringBuilder = new StringBuilder(); Map subContMap = new HashMap<>(); @@ -159,6 +160,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { deviceChannel.setUpdateTime(DateUtil.getNow()); addChannels.add(deviceChannel); } + allChannelMap.remove(deviceChannel.getChannelId()); channels.add(deviceChannel); if (!ObjectUtils.isEmpty(deviceChannel.getParentId())) { if (subContMap.get(deviceChannel.getParentId()) == null) { @@ -169,6 +171,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { } } } + deleteChannels.addAll(allChannelMap.values()); if (!channels.isEmpty()) { for (DeviceChannel channel : channels) { if (subContMap.get(channel.getChannelId()) != null){ @@ -191,7 +194,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { try { int limitCount = 50; boolean result = false; - if (!result && addChannels.size() > 0) { + if (!result && !addChannels.isEmpty()) { if (addChannels.size() > limitCount) { for (int i = 0; i < addChannels.size(); i += limitCount) { int toIndex = i + limitCount; @@ -204,7 +207,7 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { result = result || deviceChannelMapper.batchAdd(addChannels) < 0; } } - if (!result && updateChannels.size() > 0) { + if (!result && !updateChannels.isEmpty()) { if (updateChannels.size() > limitCount) { for (int i = 0; i < updateChannels.size(); i += limitCount) { int toIndex = i + limitCount; @@ -217,6 +220,20 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage { result = result || deviceChannelMapper.batchUpdate(updateChannels) < 0; } } + if (!result && !deleteChannels.isEmpty()) { + System.out.println("删除: " + deleteChannels.size()); + if (deleteChannels.size() > limitCount) { + for (int i = 0; i < deleteChannels.size(); i += limitCount) { + int toIndex = i + limitCount; + if (i + limitCount > deleteChannels.size()) { + toIndex = deleteChannels.size(); + } + result = result || deviceChannelMapper.batchDel(deleteChannels.subList(i, toIndex)) < 0; + } + }else { + result = result || deviceChannelMapper.batchDel(deleteChannels) < 0; + } + } if (result) { //事务回滚 From 613399cc6d14cfe5b8a245d462629ecee5deb2db Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Tue, 17 Oct 2023 17:49:31 +0800 Subject: [PATCH 08/38] =?UTF-8?q?fix(play):=20=E4=BF=AE=E5=A4=8D=E5=8D=95?= =?UTF-8?q?=E7=AB=AF=E5=8F=A3=E6=8E=A8=E6=B5=81=E4=B8=8B=E7=BA=A7=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20ssrc=20=E6=97=B6,=20=E6=B5=81=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=90=8E=E6=8E=A5=E5=8F=A3=E4=BB=8D=E7=84=B6=E8=B6=85?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java index d630a2c0..752d0631 100755 --- a/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/impl/InviteStreamServiceImpl.java @@ -257,7 +257,7 @@ public class InviteStreamServiceImpl implements IInviteStreamService { ":" + inviteInfo.getDeviceId() + ":" + inviteInfo.getChannelId() + ":" + inviteInfo.getStream() + - ":" + inviteInfo.getSsrcInfo().getSsrc(); + ":" + ssrc; if (inviteInfoInDb.getSsrcInfo() != null) { inviteInfoInDb.getSsrcInfo().setSsrc(ssrc); } From e1d604a5604aec7e925aed74aad8a1b6e5c25263 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Wed, 25 Oct 2023 17:44:07 +0800 Subject: [PATCH 09/38] =?UTF-8?q?feat:=20=E5=8D=87=E7=BA=A7=20Jessibuca=20?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=99=A8=E5=88=B0=202023-09-15=20v3.1.36=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=EF=BC=8C=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_src/src/components/common/jessibuca.vue | 197 ++++++------------ .../src/components/dialog/devicePlayer.vue | 2 +- web_src/static/js/jessibuca/jessibuca.d.ts | 4 +- web_src/static/js/jessibuca/jessibuca.js | 2 +- 4 files changed, 73 insertions(+), 132 deletions(-) diff --git a/web_src/src/components/common/jessibuca.vue b/web_src/src/components/common/jessibuca.vue index c02960e6..bdb5793e 100755 --- a/web_src/src/components/common/jessibuca.vue +++ b/web_src/src/components/common/jessibuca.vue @@ -47,10 +47,6 @@ export default { }, props: ['videoUrl', 'error', 'hasAudio', 'height'], mounted() { - window.onerror = (msg) => { - // console.error(msg) - }; - console.log(this._uid) let paramUrl = decodeURIComponent(this.$route.params.url) this.$nextTick(() => { this.updatePlayerDomSize() @@ -61,15 +57,12 @@ export default { this.videoUrl = paramUrl; } this.btnDom = document.getElementById("buttonsBox"); - console.log("初始化时的地址为: " + this.videoUrl) - this.play(this.videoUrl) }) }, watch: { - videoUrl(newData, oldData) { - this.play(newData) - }, - immediate: true + videoUrl(val, _) { + this.play(val); + } }, methods: { updatePlayerDomSize() { @@ -87,70 +80,54 @@ export default { dom.style.height = height + "px"; }, create() { - let options = {}; - console.log("hasAudio " + this.hasAudio) - - jessibucaPlayer[this._uid] = new window.Jessibuca(Object.assign( - { - container: this.$refs.container, - autoWasm: true, - background: "", - controlAutoHide: false, - debug: false, - decoder: "static/js/jessibuca/decoder.js", - forceNoOffscreen: true, - hasAudio: typeof (this.hasAudio) == "undefined" ? true : this.hasAudio, - hasVideo: true, - heartTimeout: 5, - heartTimeoutReplay: true, - heartTimeoutReplayTimes: 3, - hiddenAutoPause: false, - hotKey: false, - isFlv: false, - isFullResize: false, - isNotMute: this.isNotMute, - isResize: false, - keepScreenOn: false, - loadingText: "请稍等, 视频加载中......", - loadingTimeout: 10, - loadingTimeoutReplay: true, - loadingTimeoutReplayTimes: 3, - openWebglAlignment: false, - operateBtns: { - fullscreen: false, - screenshot: false, - play: false, - audio: false, - record: false - }, - recordType: "webm", - rotate: 0, - showBandwidth: false, - supportDblclickFullscreen: false, - timeout: 10, - useMSE: location.hostname !== "localhost" && location.protocol !== "https:", - useOffscreen: false, - useWCS: location.hostname === "localhost" || location.protocol === "https", - useWebFullScreen: false, - videoBuffer: 0, - wasmDecodeAudioSyncVideo: true, - wasmDecodeErrorReplay: true, - wcsUseVideoRender: true + let options = { + container: this.$refs.container, + autoWasm: true, + background: "", + controlAutoHide: false, + debug: false, + decoder: "static/js/jessibuca/decoder.js", + forceNoOffscreen: false, + hasAudio: typeof (this.hasAudio) == "undefined" ? true : this.hasAudio, + heartTimeout: 5, + heartTimeoutReplay: true, + heartTimeoutReplayTimes: 3, + hiddenAutoPause: false, + hotKey: true, + isFlv: false, + isFullResize: false, + isNotMute: this.isNotMute, + isResize: false, + keepScreenOn: true, + loadingText: "请稍等, 视频加载中......", + loadingTimeout: 10, + loadingTimeoutReplay: true, + loadingTimeoutReplayTimes: 3, + openWebglAlignment: false, + operateBtns: { + fullscreen: false, + screenshot: false, + play: false, + audio: false, + record: false }, - options - )); + recordType: "mp4", + rotate: 0, + showBandwidth: false, + supportDblclickFullscreen: false, + timeout: 10, + useMSE: true, + useWCS: location.hostname === "localhost" || location.protocol === "https:", + useWebFullScreen: true, + videoBuffer: 0.1, + wasmDecodeErrorReplay: true, + wcsUseVideoRender: true + }; + console.log("Jessibuca -> options: ", options); + jessibucaPlayer[this._uid] = new window.Jessibuca({...options}); + let jessibuca = jessibucaPlayer[this._uid]; let _this = this; - jessibuca.on("load", function () { - console.log("on load init"); - }); - - jessibuca.on("log", function (msg) { - console.log("on log", msg); - }); - jessibuca.on("record", function (msg) { - console.log("on record:", msg); - }); jessibuca.on("pause", function () { _this.playing = false; }); @@ -158,44 +135,11 @@ export default { _this.playing = true; }); jessibuca.on("fullscreen", function (msg) { - console.log("on fullscreen", msg); _this.fullscreen = msg }); - jessibuca.on("mute", function (msg) { - console.log("on mute", msg); _this.isNotMute = !msg; }); - jessibuca.on("audioInfo", function (msg) { - console.log("audioInfo", msg); - }); - - jessibuca.on("bps", function (bps) { - // console.log('bps', bps); - - }); - let _ts = 0; - jessibuca.on("timeUpdate", function (ts) { - // console.log('timeUpdate,old,new,timestamp', _ts, ts, ts - _ts); - _ts = ts; - }); - - jessibuca.on("videoInfo", function (info) { - console.log("videoInfo", info); - }); - - jessibuca.on("error", function (error) { - console.log("error", error); - }); - - jessibuca.on("timeout", function () { - console.log("timeout"); - }); - - jessibuca.on('start', function () { - console.log('start'); - }) - jessibuca.on("performance", function (performance) { let show = "卡顿"; if (performance === 2) { @@ -205,33 +149,36 @@ export default { } _this.performance = show; }); - jessibuca.on('buffer', function (buffer) { - // console.log('buffer', buffer); - }) - - jessibuca.on('stats', function (stats) { - // console.log('stats', stats); - }) - jessibuca.on('kBps', function (kBps) { _this.kBps = Math.round(kBps); }); - - // 显示时间戳 PTS - jessibuca.on('videoFrame', function () { - - }) - - // - jessibuca.on('metadata', function () { - + jessibuca.on("videoInfo", function (msg) { + console.log("Jessibuca -> videoInfo: ", msg); + }); + jessibuca.on("audioInfo", function (msg) { + console.log("Jessibuca -> audioInfo: ", msg); + }); + jessibuca.on("error", function (msg) { + console.log("Jessibuca -> error: ", msg); + }); + jessibuca.on("timeout", function (msg) { + console.log("Jessibuca -> timeout: ", msg); + }); + jessibuca.on("loadingTimeout", function (msg) { + console.log("Jessibuca -> timeout: ", msg); + }); + jessibuca.on("delayTimeout", function (msg) { + console.log("Jessibuca -> timeout: ", msg); + }); + jessibuca.on("playToRenderTimes", function (msg) { + console.log("Jessibuca -> playToRenderTimes: ", msg); }); }, playBtnClick: function (event) { this.play(this.videoUrl) }, play: function (url) { - console.log(url) + console.log("Jessibuca -> url: ", url); if (jessibucaPlayer[this._uid]) { this.destroy(); } @@ -245,7 +192,6 @@ export default { jessibucaPlayer[this._uid].play(url); } else { jessibucaPlayer[this._uid].on("load", () => { - console.log("load 播放") jessibucaPlayer[this._uid].play(url); }); } @@ -286,11 +232,6 @@ export default { this.performance = ""; }, - eventcallbacK: function (type, message) { - // console.log("player 事件回调") - // console.log(type) - // console.log(message) - }, fullscreenSwich: function () { let isFull = this.isFullscreen() jessibucaPlayer[this._uid].setFullscreen(!isFull) diff --git a/web_src/src/components/dialog/devicePlayer.vue b/web_src/src/components/dialog/devicePlayer.vue index 9e4eea00..a5cff5d3 100755 --- a/web_src/src/components/dialog/devicePlayer.vue +++ b/web_src/src/components/dialog/devicePlayer.vue @@ -1,7 +1,7 @@