国标级联推送推流 支持多wvp间自动选择与推送
This commit is contained in:
@@ -356,6 +356,15 @@ public interface IVideoManagerStorage {
|
||||
int removeMedia(String app, String stream);
|
||||
|
||||
|
||||
/**
|
||||
* 获取但个推流
|
||||
* @param app
|
||||
* @param stream
|
||||
* @return
|
||||
*/
|
||||
StreamPushItem getMedia(String app, String stream);
|
||||
|
||||
|
||||
/**
|
||||
* 清空推流列表
|
||||
*/
|
||||
|
||||
@@ -14,9 +14,9 @@ import java.util.List;
|
||||
public interface StreamPushMapper {
|
||||
|
||||
@Insert("INSERT INTO stream_push (app, stream, totalReaderCount, originType, originTypeStr, " +
|
||||
"createStamp, aliveSecond, mediaServerId) VALUES" +
|
||||
"createStamp, aliveSecond, mediaServerId, serverId) VALUES" +
|
||||
"('${app}', '${stream}', '${totalReaderCount}', '${originType}', '${originTypeStr}', " +
|
||||
"'${createStamp}', '${aliveSecond}', '${mediaServerId}' )")
|
||||
"'${createStamp}', '${aliveSecond}', '${mediaServerId}' , '${serverId}' )")
|
||||
int add(StreamPushItem streamPushItem);
|
||||
|
||||
@Update("UPDATE stream_push " +
|
||||
|
||||
@@ -587,11 +587,11 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
String scanKey = VideoManagerConstants.WVP_STREAM_GPS_MSG_PREFIX + userSetting.getServerId() + "_*";
|
||||
List<GPSMsgInfo> result = new ArrayList<>();
|
||||
List<Object> keys = redis.scan(scanKey);
|
||||
for (int i = 0; i < keys.size(); i++) {
|
||||
String key = (String) keys.get(i);
|
||||
for (Object o : keys) {
|
||||
String key = (String) o;
|
||||
GPSMsgInfo gpsMsgInfo = (GPSMsgInfo) redis.get(key);
|
||||
if (!gpsMsgInfo.isStored()) { // 只取没有存过得
|
||||
result.add((GPSMsgInfo)redis.get(key));
|
||||
result.add((GPSMsgInfo) redis.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,7 +667,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
@Override
|
||||
public void sendStreamPushRequestedMsg(MessageForPushChannel msg) {
|
||||
String key = VideoManagerConstants.VM_MSG_STREAM_PUSH_REQUESTED;
|
||||
logger.info("[redis 推流被请求通知] {}: {}-{}", key, msg.getApp(), msg.getStream());
|
||||
logger.info("[redis 推流被请求通知] {}: {}/{}", key, msg.getApp(), msg.getStream());
|
||||
redis.convertAndSend(key, (JSONObject)JSON.toJSON(msg));
|
||||
}
|
||||
|
||||
|
||||
@@ -884,6 +884,11 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
|
||||
return streamPushMapper.del(app, stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamPushItem getMedia(String app, String stream) {
|
||||
return streamPushMapper.selectOne(app, stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clearMediaList() {
|
||||
streamPushMapper.clear();
|
||||
|
||||
Reference in New Issue
Block a user