mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-05-06 14:07:49 +08:00
Compare commits
10 Commits
fc8d4ddb1f
...
0574b8ba07
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0574b8ba07 | ||
|
|
c3b66fc475 | ||
|
|
2c494bcc7d | ||
|
|
6ccccb1bbd | ||
|
|
d17f521b86 | ||
|
|
a5c455ca10 | ||
|
|
63100f3b90 | ||
|
|
40a95c70e8 | ||
|
|
481609ef72 | ||
|
|
ed7ff6db55 |
@ -9,6 +9,16 @@ services:
|
||||
environment:
|
||||
TZ: "Asia/Shanghai"
|
||||
command: redis-server /etc/redis/redis_default.conf --appendonly yes
|
||||
mysql:
|
||||
image: mysql:5.7
|
||||
volumes:
|
||||
- ./mysql:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: mysql@tafei
|
||||
MYSQL_DATABASE: wvp2
|
||||
LANG: C.UTF-8
|
||||
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
|
||||
wvp:
|
||||
build:
|
||||
context: ./wvp
|
||||
@ -33,7 +43,7 @@ services:
|
||||
environment:
|
||||
TZ: "Asia/Shanghai"
|
||||
# [必须修改] 本机的IP
|
||||
WVP_HOST: 172.18.0.61
|
||||
WVP_HOST: 111.67.197.136
|
||||
WVP_PWD: aseqw_+hiy123
|
||||
WVP_DOMAIN: 6101130049
|
||||
WVP_ID: 61011300490000000001
|
||||
@ -45,5 +55,8 @@ services:
|
||||
WVP_JVM_CONFIG: -Xms128m -Xmx256m
|
||||
ASSIST_CONFIG:
|
||||
WVP_CONFIG:
|
||||
DB_HOST: mysql
|
||||
DB_PASSWORD: mysql@tafei
|
||||
depends_on:
|
||||
- redis
|
||||
- mysql
|
||||
|
||||
@ -18,7 +18,6 @@ import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.sip.message.Response;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashMap;
|
||||
|
||||
@ -2,10 +2,12 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 业务分组
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Schema(description = "业务分组树")
|
||||
public class GroupTree extends Group{
|
||||
|
||||
@ -2,10 +2,12 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Schema(description = "区域树")
|
||||
public class RegionTree extends Region {
|
||||
|
||||
@ -381,7 +381,7 @@ public interface DeviceMapper {
|
||||
" OR device_id LIKE concat('%',#{query},'%') escape '/' " +
|
||||
" OR ip LIKE concat('%',#{query},'%') escape '/')" +
|
||||
"</if> " +
|
||||
" order by create_time desc "+
|
||||
" order by create_time desc, device_id " +
|
||||
" </script>")
|
||||
List<Device> getDeviceList(@Param("dataType") Integer dataType, @Param("query") String query, @Param("status") Boolean status);
|
||||
|
||||
|
||||
@ -101,6 +101,7 @@ public class DeviceChannelProvider {
|
||||
}
|
||||
sqlBuild.append(" )");
|
||||
}
|
||||
sqlBuild.append("ORDER BY device_id");
|
||||
return sqlBuild.toString();
|
||||
}
|
||||
|
||||
|
||||
@ -1723,7 +1723,14 @@ public class PlayServiceImpl implements IPlayService {
|
||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||
}
|
||||
DeviceChannel deviceChannel = deviceChannelService.getOneForSourceById(channel.getGbId());
|
||||
play(device, deviceChannel, callback);
|
||||
|
||||
MediaServer mediaServerItem = getNewMediaServerItem(device);
|
||||
if (mediaServerItem == null) {
|
||||
log.warn("[点播] 未找到可用的zlm deviceId: {},channelId:{}", device.getDeviceId(), deviceChannel.getDeviceId());
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未找到可用的zlm");
|
||||
}
|
||||
play(mediaServerItem, device, deviceChannel, null, record, callback);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -51,6 +51,7 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
private UserSetting userSetting;
|
||||
|
||||
@Autowired
|
||||
|
||||
private IMediaServerService mediaServerService;
|
||||
|
||||
@Autowired
|
||||
@ -123,25 +124,21 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
public void onApplicationEvent(MediaDepartureEvent event) {
|
||||
|
||||
// 兼容流注销时类型从redis记录获取
|
||||
MediaInfo mediaInfo = redisCatchStorage.getStreamInfo(
|
||||
event.getApp(), event.getStream(), event.getMediaServer().getId());
|
||||
MediaInfo mediaInfo = redisCatchStorage.getPushListItem(event.getApp(), event.getStream());
|
||||
|
||||
if (mediaInfo != null) {
|
||||
log.info("[推流信息] 查询到redis存在推流缓存, 开始清理,{}/{}", event.getApp(), event.getStream());
|
||||
String type = OriginType.values()[mediaInfo.getOriginType()].getType();
|
||||
redisCatchStorage.removeStream(event.getMediaServer().getId(), type, event.getApp(), event.getStream());
|
||||
if ("PUSH".equalsIgnoreCase(type)) {
|
||||
// 冗余数据,自己系统中自用
|
||||
redisCatchStorage.removePushListItem(event.getApp(), event.getStream(), event.getMediaServer().getId());
|
||||
}
|
||||
if (type != null) {
|
||||
// 发送流变化redis消息
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("serverId", userSetting.getServerId());
|
||||
jsonObject.put("app", event.getApp());
|
||||
jsonObject.put("stream", event.getStream());
|
||||
jsonObject.put("register", false);
|
||||
jsonObject.put("mediaServerId", event.getMediaServer().getId());
|
||||
redisCatchStorage.sendStreamChangeMsg(type, jsonObject);
|
||||
}
|
||||
// 冗余数据,自己系统中自用
|
||||
redisCatchStorage.removePushListItem(event.getApp(), event.getStream(), event.getMediaServer().getId());
|
||||
// 发送流变化redis消息
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("serverId", userSetting.getServerId());
|
||||
jsonObject.put("app", event.getApp());
|
||||
jsonObject.put("stream", event.getStream());
|
||||
jsonObject.put("register", false);
|
||||
jsonObject.put("mediaServerId", event.getMediaServer().getId());
|
||||
redisCatchStorage.sendStreamChangeMsg(type, jsonObject);
|
||||
}
|
||||
StreamPush streamPush = getPush(event.getApp(), event.getStream());
|
||||
if (streamPush == null) {
|
||||
@ -576,13 +573,13 @@ public class StreamPushServiceImpl implements IStreamPushService {
|
||||
if (streamPushList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
List<CommonGBChannel> commonGBChannelList = new ArrayList<>();
|
||||
Set<Integer> channelIds = new HashSet<>();
|
||||
streamPushList.stream().forEach(streamPush -> {
|
||||
if (streamPush.getGbDeviceId() != null) {
|
||||
commonGBChannelList.add(streamPush.buildCommonGBChannel());
|
||||
channelIds.add(streamPush.getGbId());
|
||||
}
|
||||
});
|
||||
streamPushMapper.batchDel(streamPushList);
|
||||
gbChannelService.delete(ids);
|
||||
gbChannelService.delete(channelIds);
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,7 +55,12 @@ public class CloudRecordController {
|
||||
@Parameter(name = "year", description = "年,置空则查询当年", required = false)
|
||||
@Parameter(name = "month", description = "月,置空则查询当月", required = false)
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID,置空则查询全部", required = false)
|
||||
public List<String> openRtpServer(@RequestParam(required = true) String app, @RequestParam(required = true) String stream, @RequestParam(required = false) Integer year, @RequestParam(required = false) Integer month, @RequestParam(required = false) String mediaServerId
|
||||
public List<String> openRtpServer(
|
||||
@RequestParam(required = true) String app,
|
||||
@RequestParam(required = true) String stream,
|
||||
@RequestParam(required = false) Integer year,
|
||||
@RequestParam(required = false) Integer month,
|
||||
@RequestParam(required = false) String mediaServerId
|
||||
|
||||
) {
|
||||
log.info("[云端录像] 查询存在云端录像的日期 app->{}, stream->{}, mediaServerId->{}, year->{}, month->{}", app, stream, mediaServerId, year, month);
|
||||
@ -96,7 +101,15 @@ public class CloudRecordController {
|
||||
@Parameter(name = "endTime", description = "结束时间(yyyy-MM-dd HH:mm:ss)", required = false)
|
||||
@Parameter(name = "mediaServerId", description = "流媒体ID,置空则查询全部流媒体", required = false)
|
||||
@Parameter(name = "callId", description = "每次录像的唯一标识,置空则查询全部流媒体", required = false)
|
||||
public PageInfo<CloudRecordItem> openRtpServer(@RequestParam(required = false) String query, @RequestParam(required = false) String app, @RequestParam(required = false) String stream, @RequestParam int page, @RequestParam int count, @RequestParam(required = false) String startTime, @RequestParam(required = false) String endTime, @RequestParam(required = false) String mediaServerId, @RequestParam(required = false) String callId
|
||||
public PageInfo<CloudRecordItem> openRtpServer(@RequestParam(required = false) String query,
|
||||
@RequestParam(required = false) String app,
|
||||
@RequestParam(required = false) String stream,
|
||||
@RequestParam int page,
|
||||
@RequestParam int count,
|
||||
@RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime,
|
||||
@RequestParam(required = false) String mediaServerId,
|
||||
@RequestParam(required = false) String callId
|
||||
|
||||
) {
|
||||
log.info("[云端录像] 查询 app->{}, stream->{}, mediaServerId->{}, page->{}, count->{}, startTime->{}, endTime->{}, callId->{}", app, stream, mediaServerId, page, count, startTime, endTime, callId);
|
||||
|
||||
@ -37,10 +37,9 @@ public class ApiControlController {
|
||||
* @param channel 通道序号
|
||||
* @param code 通道编号
|
||||
* @param speed 速度(0~255) 默认值: 129
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/ptz")
|
||||
private void list(String serial,String command,
|
||||
private void ptz(String serial,String command,
|
||||
@RequestParam(required = false)Integer channel,
|
||||
@RequestParam(required = false)String code,
|
||||
@RequestParam(required = false)Integer speed){
|
||||
@ -55,7 +54,7 @@ public class ApiControlController {
|
||||
if (device == null) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "device[ " + serial + " ]未找到");
|
||||
}
|
||||
int cmdCode = 0;
|
||||
int cmdCode = -1;
|
||||
switch (command){
|
||||
case "left":
|
||||
cmdCode = 2;
|
||||
@ -93,6 +92,9 @@ public class ApiControlController {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (cmdCode == -1) {
|
||||
throw new ControllerException(ErrorCode.ERROR100.getCode(), "未识别的指令:" + command);
|
||||
}
|
||||
// 默认值 50
|
||||
try {
|
||||
cmder.frontEndCmd(device, code, cmdCode, speed, speed, speed);
|
||||
@ -110,7 +112,6 @@ public class ApiControlController {
|
||||
* @param command 控制指令 允许值: set, goto, remove
|
||||
* @param preset 预置位编号(1~255)
|
||||
* @param name 预置位名称, command=set 时有效
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/preset")
|
||||
private void list(String serial,String command,
|
||||
|
||||
@ -6560,7 +6560,7 @@ var ZLMRTCClient = (function (exports) {
|
||||
resolve(response);
|
||||
} else {
|
||||
reject(new AxiosError_1(
|
||||
'Request failed with status code ' + response.status,
|
||||
'请求失败, 状态码:' + response.status,
|
||||
[AxiosError_1.ERR_BAD_REQUEST, AxiosError_1.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
||||
response.config,
|
||||
response.request,
|
||||
@ -7885,7 +7885,7 @@ var ZLMRTCClient = (function (exports) {
|
||||
}).then(response => {
|
||||
let ret = response.data; //JSON.parse(response.data);
|
||||
if (ret.code != 0) {
|
||||
// mean failed for offer/anwser exchange
|
||||
// mean failed for offer/anwser exchange
|
||||
this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret);
|
||||
return;
|
||||
}
|
||||
@ -7989,7 +7989,7 @@ var ZLMRTCClient = (function (exports) {
|
||||
}).then(response => {
|
||||
let ret = response.data; //JSON.parse(response.data);
|
||||
if (ret.code != 0) {
|
||||
// mean failed for offer/anwser exchange
|
||||
// mean failed for offer/anwser exchange
|
||||
this.dispatch(Events$1.WEBRTC_OFFER_ANWSER_EXCHANGE_FAILED, ret);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -159,11 +159,12 @@ create table IF NOT EXISTS wvp_device_channel
|
||||
gps_speed double precision,
|
||||
gps_altitude double precision,
|
||||
gps_direction double precision,
|
||||
index (data_type),
|
||||
index (data_device_id),
|
||||
constraint uk_wvp_unique_channel unique (gb_device_id)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_data_type ON wvp_device_channel (data_type);
|
||||
CREATE INDEX idx_data_device_id ON wvp_device_channel (data_device_id);
|
||||
|
||||
drop table IF EXISTS wvp_media_server;
|
||||
create table IF NOT EXISTS wvp_media_server
|
||||
(
|
||||
|
||||
@ -137,11 +137,12 @@ create table IF NOT EXISTS wvp_device_channel
|
||||
gps_speed double precision,
|
||||
gps_altitude double precision,
|
||||
gps_direction double precision,
|
||||
index (data_type),
|
||||
index (data_device_id),
|
||||
constraint uk_wvp_unique_channel unique (gb_device_id)
|
||||
);
|
||||
|
||||
create index if not exists data_type on wvp_device_channel (data_type);
|
||||
create index if not exists data_device_id on wvp_device_channel (data_device_id);
|
||||
|
||||
create table IF NOT EXISTS wvp_device_mobile_position
|
||||
(
|
||||
id serial primary key,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user