[+] 优化房间创建、关闭、广播、终端列表逻辑

现在已经能够拉出视频
This commit is contained in:
acgist
2023-03-04 23:33:40 +08:00
parent 07678b3297
commit 0f23156df1
21 changed files with 317 additions and 140 deletions

View File

@@ -143,10 +143,6 @@ public interface Constant {
* 房间ID
*/
String ROOM_ID = "roomId";
/**
* 媒体服务ID
*/
String MEDIA_ID = "mediaId";
/**
* 媒体流ID
*/
@@ -179,6 +175,10 @@ public interface Constant {
* 数据消费者ID
*/
String DATA_CONSUMER_ID = "dataConsumerId";
/**
* 媒体服务ID
*/
String MEDIA_CLIENT_ID = "mediaClientId";
/**
* ICE服务
*/

View File

@@ -162,11 +162,11 @@ public class BootAutoConfiguration {
public void init() {
final Runtime runtime = Runtime.getRuntime();
final RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
final String maxMemory = FileUtils.formatSize(runtime.maxMemory());
final String freeMemory = FileUtils.formatSize(runtime.freeMemory());
final String totalMemory = FileUtils.formatSize(runtime.totalMemory());
final String maxMemory = FileUtils.formatSize(runtime.maxMemory());
log.info("操作系统名称:{}", System.getProperty("os.name"));
log.info("操作系统架构:{}", System.getProperty("os.arch"));
log.info("操作系统名称:{}", System.getProperty("os.name"));
log.info("操作系统版本:{}", System.getProperty("os.version"));
log.info("可用的处理器数量:{}", runtime.availableProcessors());
log.info("Java版本{}", System.getProperty("java.version"));
@@ -175,9 +175,9 @@ public class BootAutoConfiguration {
log.info("ClassPath{}", System.getProperty("java.class.path"));
log.info("虚拟机名称:{}", System.getProperty("java.vm.name"));
log.info("虚拟机参数:{}", runtimeMXBean.getInputArguments().stream().collect(Collectors.joining(" ")));
log.info("虚拟机最大内存:{}", maxMemory);
log.info("虚拟机空闲内存:{}", freeMemory);
log.info("虚拟机已用内存:{}", totalMemory);
log.info("虚拟机最大内存:{}", maxMemory);
log.info("工作目录:{}", System.getProperty("user.dir"));
log.info("用户目录:{}", System.getProperty("user.home"));
log.info("临时目录:{}", System.getProperty("java.io.tmpdir"));

View File

@@ -1,5 +1,6 @@
package com.acgist.taoyao.boot.utils;
import java.math.BigDecimal;
import java.util.Map;
/**
@@ -61,8 +62,35 @@ public final class MapUtils {
return null;
} else if(object instanceof Long value) {
return value;
} else if(object instanceof Integer value) {
return value.longValue();
} else if(object instanceof Double value) {
return value.longValue();
}
return Long.valueOf(object.toString());
return new BigDecimal(object.toString()).longValue();
}
/**
* @param body 消息主体
* @param key 参数名称
*
* @return 参数值
*/
public static final Double getDouble(Map<?, ?> body, String key) {
if(body == null) {
return null;
}
final Object object = body.get(key);
if(object == null) {
return null;
} else if(object instanceof Long value) {
return value.doubleValue();
} else if(object instanceof Integer value) {
return value.doubleValue();
} else if(object instanceof Double value) {
return value;
}
return new BigDecimal(object.toString()).doubleValue();
}
/**
@@ -78,10 +106,14 @@ public final class MapUtils {
final Object object = body.get(key);
if(object == null) {
return null;
} else if(object instanceof Long value) {
return value.intValue();
} else if(object instanceof Integer value) {
return value;
} else if(object instanceof Double value) {
return value.intValue();
}
return Integer.valueOf(object.toString());
return new BigDecimal(object.toString()).intValue();
}
/**