优化拉流代理国标级联点播
parent
afe80a7be1
commit
45410d8091
|
@ -623,7 +623,8 @@ public class InviteRequestProcessor extends SIPRequestProcessorParent implements
|
|||
String ssrc = "Play".equalsIgnoreCase(sessionName) ? ssrcFactory.getPlaySsrc(mediaServerItem.getId()) : ssrcFactory.getPlayBackSsrc(mediaServerItem.getId());
|
||||
sendRtpItem.setSsrc(ssrc);
|
||||
}
|
||||
if (proxyByAppAndStream.isStatus()) {
|
||||
MediaInfo mediaInfo = redisCatchStorage.getProxyStream(gbStream.getApp(), gbStream.getStream());
|
||||
if (mediaInfo != null) {
|
||||
sendProxyStream(sendRtpItem, mediaServerItem, platform, request);
|
||||
} else {
|
||||
//开启代理拉流
|
||||
|
|
|
@ -114,6 +114,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen
|
|||
device.setIp(remoteAddressInfo.getIp());
|
||||
device.setPort(remoteAddressInfo.getPort());
|
||||
device.setHostAddress(remoteAddressInfo.getIp().concat(":").concat(String.valueOf(remoteAddressInfo.getPort())));
|
||||
|
||||
device.setLocalIp(request.getLocalAddress().getHostAddress());
|
||||
Response registerOkResponse = getRegisterOkResponse(request);
|
||||
// 判断TCP还是UDP
|
||||
|
|
|
@ -135,6 +135,8 @@ public interface IRedisCatchStorage {
|
|||
|
||||
MediaInfo getStreamInfo(String app, String streamId, String mediaServerId);
|
||||
|
||||
MediaInfo getProxyStream(String app, String streamId);
|
||||
|
||||
void addCpuInfo(double cpuInfo);
|
||||
|
||||
void addMemInfo(double memInfo);
|
||||
|
|
|
@ -496,6 +496,20 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaInfo getProxyStream(String app, String streamId) {
|
||||
String scanKey = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_PULL_" + app + "_" + streamId + "_*";
|
||||
|
||||
MediaInfo result = null;
|
||||
List<Object> keys = RedisUtil.scan(redisTemplate, scanKey);
|
||||
if (keys.size() > 0) {
|
||||
String key = (String) keys.get(0);
|
||||
result = JsonUtil.redisJsonToObject(redisTemplate, key, MediaInfo.class);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCpuInfo(double cpuInfo) {
|
||||
String key = VideoManagerConstants.SYSTEM_INFO_CPU_PREFIX + userSetting.getServerId();
|
||||
|
|
Loading…
Reference in New Issue