修改错别字

This commit is contained in:
648540858 2021-10-18 17:31:28 +08:00
parent 2f2958ba74
commit 670d18f688
7 changed files with 22 additions and 22 deletions

View File

@ -31,7 +31,7 @@ public class DeferredResultHolder {
public static final String CALLBACK_CMD_RECORDINFO = "CALLBACK_RECORDINFO";
public static final String CALLBACK_CMD_PlAY = "CALLBACK_PLAY";
public static final String CALLBACK_CMD_PLAY = "CALLBACK_PLAY";
public static final String CALLBACK_CMD_STOP = "CALLBACK_STOP";
@ -47,6 +47,7 @@ public class DeferredResultHolder {
private Map<String, DeferredResult> map = new ConcurrentHashMap<String, DeferredResult>();
public void put(String key, DeferredResult result) {
map.put(key, result);
}

View File

@ -80,7 +80,7 @@ public class PlayServiceImpl implements IPlayService {
PlayResult playResult = new PlayResult();
if (mediaServerItem == null) {
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + playResult.getUuid());
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + playResult.getUuid());
WVPResult wvpResult = new WVPResult();
wvpResult.setCode(-1);
wvpResult.setMsg("未找到可用的zlm");
@ -96,12 +96,12 @@ public class PlayServiceImpl implements IPlayService {
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(userSetup.getPlayTimeout());
playResult.setResult(result);
// 录像查询以channelId作为deviceId查询
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result);
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result);
// 超时处理
result.onTimeout(()->{
logger.warn(String.format("设备点播超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + playResult.getUuid());
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + playResult.getUuid());
WVPResult wvpResult = new WVPResult();
wvpResult.setCode(-1);
SIPDialog dialog = streamSession.getDialog(deviceId, channelId);
@ -170,7 +170,7 @@ public class PlayServiceImpl implements IPlayService {
}, (event) -> {
// 点播返回sip错误
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
Response response = event.getResponse();
mediaServerService.closeRTPServer(playResult.getDevice(), channelId);
WVPResult wvpResult = new WVPResult();
@ -187,7 +187,7 @@ public class PlayServiceImpl implements IPlayService {
String streamId = streamInfo.getStreamId();
if (streamId == null) {
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
WVPResult wvpResult = new WVPResult();
wvpResult.setCode(-1);
wvpResult.setMsg(String.format("点播失败, redis缓存streamId等于null"));
@ -201,7 +201,7 @@ public class PlayServiceImpl implements IPlayService {
JSONObject rtpInfo = zlmresTfulUtils.getRtpInfo(mediaInfo, streamId);
if (rtpInfo != null && rtpInfo.getBoolean("exist")) {
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
WVPResult wvpResult = new WVPResult();
wvpResult.setCode(0);
@ -230,7 +230,7 @@ public class PlayServiceImpl implements IPlayService {
}, (event) -> {
mediaServerService.closeRTPServer(playResult.getDevice(), channelId);
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
Response response = event.getResponse();
WVPResult wvpResult = new WVPResult();
@ -248,7 +248,7 @@ public class PlayServiceImpl implements IPlayService {
@Override
public void onPublishHandlerForPlay(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid) {
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
StreamInfo streamInfo = onPublishHandler(mediaServerItem, resonse, deviceId, channelId, uuid);
if (streamInfo != null) {
DeviceChannel deviceChannel = storager.queryChannel(deviceId, channelId);
@ -292,7 +292,7 @@ public class PlayServiceImpl implements IPlayService {
@Override
public void onPublishHandlerForPlayBack(MediaServerItem mediaServerItem, JSONObject resonse, String deviceId, String channelId, String uuid) {
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
StreamInfo streamInfo = onPublishHandler(mediaServerItem, resonse, deviceId, channelId, uuid);
if (streamInfo != null) {
redisCatchStorage.startPlayback(streamInfo);

View File

@ -134,13 +134,13 @@ public class PlayController {
json.put("deviceId", deviceId);
json.put("channelId", channelId);
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData(json.toString());
resultHolder.invokeResult(msg);
} else {
logger.warn("设备预览/回放停止API调用失败");
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData("streamId null");
resultHolder.invokeResult(msg);
}

View File

@ -82,7 +82,7 @@ public class DownloadController {
result.onTimeout(()->{
logger.warn(String.format("设备下载响应超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData("Timeout");
resultHolder.invokeResult(msg);
});
@ -92,12 +92,12 @@ public class DownloadController {
// 停止之前的下载
cmder.streamByeCmd(deviceId, channelId);
}
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result);
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result);
MediaServerItem newMediaServerItem = playService.getNewMediaServerItem(device);
if (newMediaServerItem == null) {
logger.warn(String.format("设备下载响应超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData("Timeout");
resultHolder.invokeResult(msg);
return result;
@ -111,7 +111,7 @@ public class DownloadController {
}, event -> {
Response response = event.getResponse();
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
resultHolder.invokeResult(msg);
});

View File

@ -91,7 +91,7 @@ public class PlaybackController {
result.onTimeout(()->{
logger.warn(String.format("设备回放超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData("Timeout");
resultHolder.invokeResult(msg);
});
@ -101,12 +101,12 @@ public class PlaybackController {
// 停止之前的回放
cmder.streamByeCmd(deviceId, channelId);
}
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid, result);
resultHolder.put(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid, result);
if (newMediaServerItem == null) {
logger.warn(String.format("设备回放超时deviceId%s channelId%s", deviceId, channelId));
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData("Timeout");
resultHolder.invokeResult(msg);
return result;
@ -118,7 +118,7 @@ public class PlaybackController {
}, event -> {
Response response = event.getResponse();
RequestMessage msg = new RequestMessage();
msg.setId(DeferredResultHolder.CALLBACK_CMD_PlAY + uuid);
msg.setId(DeferredResultHolder.CALLBACK_CMD_PLAY + uuid);
msg.setData(String.format("回放失败, 错误码: %s, %s", response.getStatusCode(), response.getReasonPhrase()));
resultHolder.invokeResult(msg);
});

View File

@ -53,8 +53,6 @@ public class ApiDeviceController {
if (logger.isDebugEnabled()) {
logger.debug("查询所有视频设备API调用");
}
logger.debug("查询所有视频设备API调用");
JSONObject result = new JSONObject();
List<Device> devices;
if (start == null || limit ==null) {

View File

@ -80,6 +80,7 @@ export default {
container: this.$refs.container,
videoBuffer: 0.5, //
isResize: true,
isFlv: true,
decoder: "./static/js/jessibuca/index.js",
// text: "WVP-PRO",
// background: "bg.jpg",