离在线状态样式修改
修复未回复200ok导致catalog一直发送的bug 修改点播接口未收到视频后回复
This commit is contained in:
@@ -136,30 +136,24 @@ public interface IVideoManagerStorager {
|
||||
/**
|
||||
* 开始播放时将流存入
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @param stream 流信息
|
||||
* @return
|
||||
*/
|
||||
public boolean startPlay(String deviceId, String channelId, StreamInfo stream);
|
||||
public boolean startPlay(StreamInfo stream);
|
||||
|
||||
/**
|
||||
* 停止播放时删除
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
public boolean stopPlay(String deviceId, String channelId);
|
||||
public boolean stopPlay(StreamInfo streamInfo);
|
||||
|
||||
/**
|
||||
* 查找视频流
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
public StreamInfo queryPlay(String deviceId, String channelId);
|
||||
public StreamInfo queryPlay(StreamInfo streamInfo);
|
||||
|
||||
/**
|
||||
* 查询子设备
|
||||
@@ -182,4 +176,8 @@ public interface IVideoManagerStorager {
|
||||
* @param deviceId
|
||||
*/
|
||||
void cleanChannelsForDevice(String deviceId);
|
||||
|
||||
StreamInfo queryPlayBySSRC(String ssrc);
|
||||
|
||||
StreamInfo queryPlayByDevice(String deviceId, String code);
|
||||
}
|
||||
|
||||
@@ -148,17 +148,12 @@ public class VideoManagerJdbcStoragerImpl implements IVideoManagerStorager {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startPlay(String deviceId, String channelId, StreamInfo stream) {
|
||||
public boolean stopPlay(StreamInfo streamInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean stopPlay(String deviceId, String channelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamInfo queryPlay(String deviceId, String channelId) {
|
||||
public StreamInfo queryPlay(StreamInfo streamInfo) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -176,4 +171,19 @@ public class VideoManagerJdbcStoragerImpl implements IVideoManagerStorager {
|
||||
public void cleanChannelsForDevice(String deviceId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startPlay(StreamInfo stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamInfo queryPlayBySSRC(String ssrc) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StreamInfo queryPlayByDevice(String deviceId, String code) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -329,40 +329,53 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
|
||||
/**
|
||||
* 开始播放时将流存入redis
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean startPlay(String deviceId, String channelId, StreamInfo stream) {
|
||||
return redis.set(String.format("%S_%s_%s", VideoManagerConstants.PLAYER_PREFIX, deviceId, channelId),
|
||||
public boolean startPlay(StreamInfo stream) {
|
||||
return redis.set(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, stream.getSsrc(),stream.getDeviceID(), stream.getCahnnelId()),
|
||||
stream);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止播放时从redis删除
|
||||
*
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean stopPlay(String deviceId, String channelId) {
|
||||
return redis.del(String.format("%S_%s_%s", VideoManagerConstants.PLAYER_PREFIX, deviceId, channelId));
|
||||
public boolean stopPlay(StreamInfo streamInfo) {
|
||||
return redis.del(String.format("%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
|
||||
streamInfo.getSsrc(),
|
||||
streamInfo.getDeviceID(),
|
||||
streamInfo.getCahnnelId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询播放列表
|
||||
* @param deviceId 设备ID
|
||||
* @param channelId 通道ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public StreamInfo queryPlay(String deviceId, String channelId) {
|
||||
return (StreamInfo)redis.get(String.format("%S_%s_%s", VideoManagerConstants.PLAYER_PREFIX, deviceId, channelId));
|
||||
public StreamInfo queryPlay(StreamInfo streamInfo) {
|
||||
return (StreamInfo)redis.get(String.format("%S_%s_%s_%s",
|
||||
VideoManagerConstants.PLAYER_PREFIX,
|
||||
streamInfo.getSsrc(),
|
||||
streamInfo.getDeviceID(),
|
||||
streamInfo.getCahnnelId()));
|
||||
}
|
||||
@Override
|
||||
public StreamInfo queryPlayBySSRC(String ssrc) {
|
||||
List<Object> playLeys = redis.keys(String.format("%S_%s_*", VideoManagerConstants.PLAYER_PREFIX, ssrc));
|
||||
if (playLeys.size() == 0) return null;
|
||||
return (StreamInfo)redis.get(playLeys.get(0).toString());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public StreamInfo queryPlayByDevice(String deviceId, String code) {
|
||||
List<Object> playLeys = redis.keys(String.format("%S_*_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
|
||||
deviceId,
|
||||
code));
|
||||
return (StreamInfo)redis.get(playLeys.get(0).toString());
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新流媒体信息
|
||||
@@ -423,4 +436,7 @@ public class VideoManagerRedisStoragerImpl implements IVideoManagerStorager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user