优化多wvp国标级联推流

This commit is contained in:
648540858
2024-04-16 00:10:38 +08:00
parent f9abfca003
commit b4168c02cb
17 changed files with 335 additions and 408 deletions

View File

@@ -219,5 +219,9 @@ public interface IRedisCatchStorage {
void addWaiteSendRtpItem(SendRtpItem sendRtpItem, int platformPlayTimeout);
SendRtpItem getWaiteSendRtpItem(String app, String stream);
void sendStartSendRtp(SendRtpItem sendRtpItem);
void sendPushStreamOnline(SendRtpItem sendRtpItem);
}

View File

@@ -685,9 +685,22 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
redisTemplate.opsForValue().set(key, platformPlayTimeout);
}
@Override
public SendRtpItem getWaiteSendRtpItem(String app, String stream) {
String key = VideoManagerConstants.WAITE_SEND_PUSH_STREAM + app + "_" + stream;
return (SendRtpItem)redisTemplate.opsForValue().get(key);
}
@Override
public void sendStartSendRtp(SendRtpItem sendRtpItem) {
String key = VideoManagerConstants.START_SEND_PUSH_STREAM + sendRtpItem.getApp() + "_" + sendRtpItem.getStream();
redisTemplate.opsForValue().set(key, JSON.toJSONString(sendRtpItem));
}
@Override
public void sendPushStreamOnline(SendRtpItem sendRtpItem) {
String key = VideoManagerConstants.VM_MSG_STREAM_PUSH_CLOSE_REQUESTED;
logger.info("[redis发送通知] 流上线 {}: {}/{}->{}", key, sendRtpItem.getApp(), sendRtpItem.getStream(), sendRtpItem.getPlatformId());
redisTemplate.convertAndSend(key, JSON.toJSON(sendRtpItem));
}
}