Merge branch 'wvp-28181-2.0' into wvp-pro-record
# Conflicts: # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/AckRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/ByeRequestProcessor.java # src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookSubscribe.java # src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
This commit is contained in:
@@ -7,6 +7,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.ThirdPartyGB;
|
||||
|
||||
import java.util.List;
|
||||
@@ -220,4 +221,5 @@ public interface IRedisCatchStorage {
|
||||
void addMemInfo(double memInfo);
|
||||
|
||||
void addNetInfo(Map<String, String> networkInterfaces);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,15 +10,16 @@ import java.util.List;
|
||||
@Repository
|
||||
public interface StreamProxyMapper {
|
||||
|
||||
@Insert("INSERT INTO stream_proxy (type, app, stream,mediaServerId, url, src_url, dst_url, " +
|
||||
@Insert("INSERT INTO stream_proxy (type, name, app, stream,mediaServerId, url, src_url, dst_url, " +
|
||||
"timeout_ms, ffmpeg_cmd_key, rtp_type, enable_hls, enable_mp4, enable, status, enable_remove_none_reader, createTime) VALUES" +
|
||||
"('${type}','${app}', '${stream}', '${mediaServerId}','${url}', '${src_url}', '${dst_url}', " +
|
||||
"('${type}','${name}', '${app}', '${stream}', '${mediaServerId}','${url}', '${src_url}', '${dst_url}', " +
|
||||
"'${timeout_ms}', '${ffmpeg_cmd_key}', '${rtp_type}', ${enable_hls}, ${enable_mp4}, ${enable}, ${status}, " +
|
||||
"${enable_remove_none_reader}, '${createTime}' )")
|
||||
int add(StreamProxyItem streamProxyDto);
|
||||
|
||||
@Update("UPDATE stream_proxy " +
|
||||
"SET type=#{type}, " +
|
||||
"name=#{name}," +
|
||||
"app=#{app}," +
|
||||
"stream=#{stream}," +
|
||||
"url=#{url}, " +
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
|
||||
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
|
||||
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.SSRCInfo;
|
||||
import com.genersoft.iot.vmp.service.bean.ThirdPartyGB;
|
||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
||||
import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
|
||||
@@ -91,7 +92,8 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
*/
|
||||
@Override
|
||||
public boolean startPlay(StreamInfo stream) {
|
||||
return redis.set(String.format("%S_%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, userSetup.getServerId(), stream.getStreamId(),stream.getDeviceID(), stream.getChannelId()),
|
||||
return redis.set(String.format("%S_%S_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX, userSetup.getServerId(),
|
||||
stream.getStream(), stream.getDeviceID(), stream.getChannelId()),
|
||||
stream);
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
if (streamInfo == null) return false;
|
||||
return redis.del(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.PLAYER_PREFIX,
|
||||
userSetup.getServerId(),
|
||||
streamInfo.getStreamId(),
|
||||
streamInfo.getStream(),
|
||||
streamInfo.getDeviceID(),
|
||||
streamInfo.getChannelId()));
|
||||
}
|
||||
@@ -119,7 +121,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
return (StreamInfo)redis.get(String.format("%S_%s_%s_%s_%s",
|
||||
VideoManagerConstants.PLAYER_PREFIX,
|
||||
userSetup.getServerId(),
|
||||
streamInfo.getStreamId(),
|
||||
streamInfo.getStream(),
|
||||
streamInfo.getDeviceID(),
|
||||
streamInfo.getChannelId()));
|
||||
}
|
||||
@@ -164,14 +166,14 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
|
||||
@Override
|
||||
public boolean startPlayback(StreamInfo stream) {
|
||||
return redis.set(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX, userSetup.getServerId(),stream.getStreamId(),
|
||||
stream.getDeviceID(), stream.getChannelId()), stream);
|
||||
return redis.set(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
|
||||
userSetup.getServerId(), stream.getStream(), stream.getDeviceID(), stream.getChannelId()), stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startDownload(StreamInfo streamInfo) {
|
||||
return redis.set(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.DOWNLOAD_PREFIX, userSetup.getServerId(),streamInfo.getStreamId(),
|
||||
streamInfo.getDeviceID(), streamInfo.getChannelId()), streamInfo);
|
||||
return redis.set(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.DOWNLOAD_PREFIX, userSetup.getServerId(),
|
||||
streamInfo.getStream(), streamInfo.getDeviceID(), streamInfo.getChannelId()), streamInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -185,7 +187,7 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
|
||||
}
|
||||
return redis.del(String.format("%S_%s_%s_%s_%s", VideoManagerConstants.PLAY_BLACK_PREFIX,
|
||||
userSetup.getServerId(),
|
||||
streamInfo.getStreamId(),
|
||||
streamInfo.getStream(),
|
||||
streamInfo.getDeviceID(),
|
||||
streamInfo.getChannelId()));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.genersoft.iot.vmp.storager.impl;
|
||||
|
||||
import com.genersoft.iot.vmp.common.StreamInfo;
|
||||
import com.genersoft.iot.vmp.conf.SipConfig;
|
||||
import com.genersoft.iot.vmp.gb28181.bean.*;
|
||||
import com.genersoft.iot.vmp.gb28181.event.EventPublisher;
|
||||
@@ -157,7 +158,10 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
public synchronized void updateChannel(String deviceId, DeviceChannel channel) {
|
||||
String channelId = channel.getChannelId();
|
||||
channel.setDeviceId(deviceId);
|
||||
channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId()));
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(deviceId, channelId);
|
||||
if (streamInfo != null) {
|
||||
channel.setStreamId(streamInfo.getStream());
|
||||
}
|
||||
String now = this.format.format(System.currentTimeMillis());
|
||||
channel.setUpdateTime(now);
|
||||
DeviceChannel deviceChannel = deviceChannelMapper.queryChannel(deviceId, channelId);
|
||||
@@ -179,7 +183,10 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
if (channelList.size() == 0) {
|
||||
for (DeviceChannel channel : channels) {
|
||||
channel.setDeviceId(deviceId);
|
||||
channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId()));
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(deviceId, channel.getChannelId());
|
||||
if (streamInfo != null) {
|
||||
channel.setStreamId(streamInfo.getStream());
|
||||
}
|
||||
String now = this.format.format(System.currentTimeMillis());
|
||||
channel.setUpdateTime(now);
|
||||
channel.setCreateTime(now);
|
||||
@@ -190,9 +197,11 @@ public class VideoManagerStoragerImpl implements IVideoManagerStorager {
|
||||
channelsInStore.put(deviceChannel.getChannelId(), deviceChannel);
|
||||
}
|
||||
for (DeviceChannel channel : channels) {
|
||||
String channelId = channel.getChannelId();
|
||||
channel.setDeviceId(deviceId);
|
||||
channel.setStreamId(streamSession.getStreamId(deviceId, channel.getChannelId()));
|
||||
StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(deviceId, channel.getChannelId());
|
||||
if (streamInfo != null) {
|
||||
channel.setStreamId(streamInfo.getStream());
|
||||
}
|
||||
String now = this.format.format(System.currentTimeMillis());
|
||||
channel.setUpdateTime(now);
|
||||
if (channelsInStore.get(channel.getChannelId()) != null) {
|
||||
|
||||
Reference in New Issue
Block a user