diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java index 94aab104f..9124ba1ec 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/service/impl/GbChannelPlayServiceImpl.java @@ -123,17 +123,6 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService { downloadService.download(channel, startTime, stopTime, downloadSpeed, callback); } - @Override - public void playJt1078(CommonGBChannel channel, Boolean record, ErrorCallback callback){ - // 部标设备通道 - try { - jt1078PlayService.start(channel.getDataDeviceId(), record, callback); - }catch (Exception e) { - log.info("[通用通道] 部标设备点播异常 {}", e.getMessage()); - callback.run(Response.BUSY_HERE, "busy here", null); - } - } - @Override public void stopPlay(CommonGBChannel channel, String stream) { Integer dataType = channel.getDataType(); @@ -172,36 +161,6 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService { downloadService.stopDownload(channel, stream); } - @Override - public void stopPlayJt1078(CommonGBChannel channel) { - // 推流 - try { - jt1078PlayService.stop(channel.getDataDeviceId()); - }catch (Exception e) { - log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e); - } - } - - private void playbackGbDeviceChannel(CommonGBChannel channel, Long startTime, Long stopTime, ErrorCallback callback){ - try { - deviceChannelPlayService.playBack(channel, startTime, stopTime, callback); - } catch (PlayException e) { - callback.run(e.getCode(), e.getMsg(), null); - } catch (Exception e) { - callback.run(Response.BUSY_HERE, "busy here", null); - } - } - - private void playbackJtDeviceChannel(CommonGBChannel channel, Long startTime, Long stopTime, ErrorCallback callback){ - try { - jt1078PlayService.playBack(channel.getDataDeviceId(), startTime, stopTime, callback); - } catch (PlayException e) { - callback.run(e.getCode(), e.getMsg(), null); - } catch (Exception e) { - callback.run(Response.BUSY_HERE, "busy here", null); - } - } - @Override public void playbackPause(CommonGBChannel channel, String stream) { log.info("[通用通道] 回放暂停, 类型: {}, 编号:{} stream:{}", channel.getDataType(), channel.getGbDeviceId(), stream); diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTChannel.java b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTChannel.java index 79601eceb..2d4e0226a 100644 --- a/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTChannel.java +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/bean/JTChannel.java @@ -39,7 +39,7 @@ public class JTChannel extends CommonGBChannel { @Schema(description = "流信息") private String stream; - private Integer dataType = ChannelDataType.JT_1078.value; + private Integer dataType = ChannelDataType.JT_1078; @Override public String toString() { diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourceDownloadServiceForJTImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourceDownloadServiceForJTImpl.java new file mode 100644 index 000000000..7b7418505 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourceDownloadServiceForJTImpl.java @@ -0,0 +1,28 @@ +package com.genersoft.iot.vmp.jt1078.service.impl; + +import com.genersoft.iot.vmp.common.InviteSessionType; +import com.genersoft.iot.vmp.common.StreamInfo; +import com.genersoft.iot.vmp.common.enums.ChannelDataType; +import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; +import com.genersoft.iot.vmp.gb28181.service.IPlayService; +import com.genersoft.iot.vmp.gb28181.service.ISourceDownloadService; +import com.genersoft.iot.vmp.service.bean.ErrorCallback; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Slf4j +@Service(ChannelDataType.DOWNLOAD_SERVICE + ChannelDataType.JT_1078) +public class SourceDownloadServiceForJTImpl implements ISourceDownloadService { + + + @Override + public void download(CommonGBChannel channel, Long startTime, Long stopTime, Integer downloadSpeed, ErrorCallback callback) { + + } + + @Override + public void stopDownload(CommonGBChannel channel, String stream) { + + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePTZServiceForJTImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePTZServiceForJTImpl.java new file mode 100644 index 000000000..c1807b603 --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePTZServiceForJTImpl.java @@ -0,0 +1,59 @@ +package com.genersoft.iot.vmp.jt1078.service.impl; + +import com.genersoft.iot.vmp.common.enums.ChannelDataType; +import com.genersoft.iot.vmp.gb28181.bean.*; +import com.genersoft.iot.vmp.gb28181.service.IPTZService; +import com.genersoft.iot.vmp.gb28181.service.ISourcePTZService; +import com.genersoft.iot.vmp.service.bean.ErrorCallback; +import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service(ChannelDataType.PTZ_SERVICE + ChannelDataType.JT_1078) +public class SourcePTZServiceForJTImpl implements ISourcePTZService { + + + @Override + public void ptz(CommonGBChannel channel, FrontEndControlCodeForPTZ frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void preset(CommonGBChannel channel, FrontEndControlCodeForPreset frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void fi(CommonGBChannel channel, FrontEndControlCodeForFI frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void tour(CommonGBChannel channel, FrontEndControlCodeForTour frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void scan(CommonGBChannel channel, FrontEndControlCodeForScan frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void auxiliary(CommonGBChannel channel, FrontEndControlCodeForAuxiliary frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void wiper(CommonGBChannel channel, FrontEndControlCodeForWiper frontEndControlCode, ErrorCallback callback) { + + } + + @Override + public void queryPreset(CommonGBChannel channel, ErrorCallback> callback) { + + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlayServiceForJTImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlayServiceForJTImpl.java new file mode 100644 index 000000000..9c4ad082a --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlayServiceForJTImpl.java @@ -0,0 +1,47 @@ +package com.genersoft.iot.vmp.jt1078.service.impl; + +import com.genersoft.iot.vmp.common.InviteSessionType; +import com.genersoft.iot.vmp.common.StreamInfo; +import com.genersoft.iot.vmp.common.enums.ChannelDataType; +import com.genersoft.iot.vmp.conf.exception.ControllerException; +import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; +import com.genersoft.iot.vmp.gb28181.bean.Platform; +import com.genersoft.iot.vmp.gb28181.bean.PlayException; +import com.genersoft.iot.vmp.gb28181.service.IPlayService; +import com.genersoft.iot.vmp.gb28181.service.ISourcePlayService; +import com.genersoft.iot.vmp.jt1078.service.Ijt1078PlayService; +import com.genersoft.iot.vmp.service.bean.ErrorCallback; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.sip.message.Response; + +@Slf4j +@Service(ChannelDataType.PLAY_SERVICE + ChannelDataType.JT_1078) +public class SourcePlayServiceForJTImpl implements ISourcePlayService { + + @Autowired + private Ijt1078PlayService playService; + + @Override + public void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback callback) { + // 部标设备通道 + try { + playService.start(channel.getDataDeviceId(), record, callback); + }catch (Exception e) { + log.info("[通用通道] 部标设备点播异常 {}", e.getMessage()); + callback.run(Response.BUSY_HERE, "busy here", null); + } + } + + @Override + public void stopPlay(CommonGBChannel channel, String stream) { + // 推流 + try { + playService.stop(channel.getDataDeviceId()); + }catch (Exception e) { + log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e); + } + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlaybackServiceForJTImpl.java b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlaybackServiceForJTImpl.java new file mode 100644 index 000000000..8ed322a4d --- /dev/null +++ b/src/main/java/com/genersoft/iot/vmp/jt1078/service/impl/SourcePlaybackServiceForJTImpl.java @@ -0,0 +1,36 @@ +package com.genersoft.iot.vmp.jt1078.service.impl; + +import com.genersoft.iot.vmp.common.InviteSessionType; +import com.genersoft.iot.vmp.common.StreamInfo; +import com.genersoft.iot.vmp.common.enums.ChannelDataType; +import com.genersoft.iot.vmp.gb28181.bean.CommonGBChannel; +import com.genersoft.iot.vmp.gb28181.bean.PlayException; +import com.genersoft.iot.vmp.gb28181.service.IPlayService; +import com.genersoft.iot.vmp.gb28181.service.ISourcePlaybackService; +import com.genersoft.iot.vmp.service.bean.ErrorCallback; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.sip.message.Response; + +@Slf4j +@Service(ChannelDataType.PLAYBACK_SERVICE + ChannelDataType.JT_1078) +public class SourcePlaybackServiceForJTImpl implements ISourcePlaybackService { + + + @Override + public void playback(CommonGBChannel channel, Long startTime, Long stopTime, ErrorCallback callback) { + + } + + @Override + public void stopPlayback(CommonGBChannel channel, String stream) { + + } + + @Override + public void playbackPause(CommonGBChannel channel, String stream) { + + } +} diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/IRedisRpcPlayService.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/IRedisRpcPlayService.java index e5ae2bc48..69ed485a3 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/IRedisRpcPlayService.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/IRedisRpcPlayService.java @@ -16,14 +16,14 @@ public interface IRedisRpcPlayService { void playback(String serverId, Integer channelId, String startTime, String endTime, ErrorCallback callback); - void download(String serverId, Integer channelId, String startTime, String endTime, int downloadSpeed, ErrorCallback callback); - - void queryRecordInfo(String serverId, Integer channelId, String startTime, String endTime, ErrorCallback callback); - void playbackPause(String serverId, String streamId); void playbackResume(String serverId, String streamId); + void download(String serverId, Integer channelId, String startTime, String endTime, int downloadSpeed, ErrorCallback callback); + + void queryRecordInfo(String serverId, Integer channelId, String startTime, String endTime, ErrorCallback callback); + String frontEndCommand(String serverId, Integer channelId, int cmdCode, int parameter1, int parameter2, int combindCode2); void playPush(String serverId, Integer id, ErrorCallback callback); @@ -34,6 +34,5 @@ public interface IRedisRpcPlayService { DownloadFileInfo getRecordPlayUrl(String serverId, Integer recordId); - AudioBroadcastResult audioBroadcast(String serverId, String deviceId, String channelDeviceId, Boolean broadcastMode); } diff --git a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcPlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcPlayServiceImpl.java index 0e2e2e8ce..54653bbc8 100644 --- a/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcPlayServiceImpl.java +++ b/src/main/java/com/genersoft/iot/vmp/service/redisMsg/service/RedisRpcPlayServiceImpl.java @@ -134,6 +134,7 @@ public class RedisRpcPlayServiceImpl implements IRedisRpcPlayService { } } + @Override public void playbackResume(String serverId, String streamId) { RedisRpcRequest request = buildRequest("channel/playbackResume", streamId);