添加语音发送通道和语音接收通道字段

This commit is contained in:
648540858
2022-05-07 09:52:02 +08:00
parent ee2dda21f0
commit ca16a79255
7 changed files with 50 additions and 16 deletions

View File

@@ -251,20 +251,32 @@ public class PlayController {
@ApiOperation("语音广播命令")
@ApiImplicitParams({
@ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelForSend", value = "设备用于发送语音数据的通道", dataTypeClass = String.class),
@ApiImplicitParam(name = "channelForReceive", value = "设备用于接收语音数据的通道", dataTypeClass = String.class),
})
@GetMapping("/broadcast/{deviceId}")
@PostMapping("/broadcast/{deviceId}")
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) {
public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId,
String channelForSend,
String channelForReceive) {
if (logger.isDebugEnabled()) {
logger.debug("语音广播API调用");
}
Device device = storager.queryVideoDevice(deviceId);
DeferredResult<ResponseEntity<String>> result = new DeferredResult<ResponseEntity<String>>(3 * 1000L);
DeferredResult<ResponseEntity<String>> result = new DeferredResult<>(3 * 1000L);
String key = DeferredResultHolder.CALLBACK_CMD_BROADCAST + deviceId;
if (resultHolder.exist(key, null)) {
result.setResult(new ResponseEntity<>("设备使用中",HttpStatus.OK));
return result;
}
// playService.audioBroadcast(deviceId, channelForSend, channelForReceive);
String uuid = UUID.randomUUID().toString();
if (device == null) {