通用通道支持云台控制
This commit is contained in:
@@ -79,7 +79,7 @@ public class StreamProxy extends CommonGBChannel {
|
||||
if (ObjectUtils.isEmpty(this.getGbName())) {
|
||||
this.setGbName( app+ "-" +stream);
|
||||
}
|
||||
this.setDataType(ChannelDataType.STREAM_PROXY.value);
|
||||
this.setDataType(ChannelDataType.STREAM_PROXY);
|
||||
this.setDataDeviceId(this.getId());
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class StreamProxyProvider {
|
||||
public String getBaseSelectSql(){
|
||||
return "SELECT " +
|
||||
" st.*, " +
|
||||
ChannelDataType.STREAM_PROXY.value + " as data_type, " +
|
||||
ChannelDataType.STREAM_PROXY + " as data_type, " +
|
||||
" st.id as data_device_id, " +
|
||||
" wdc.*, " +
|
||||
" wdc.id as gb_id" +
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.genersoft.iot.vmp.streamProxy.service.impl;
|
||||
|
||||
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.Platform;
|
||||
import com.genersoft.iot.vmp.gb28181.service.ISourcePlayService;
|
||||
import com.genersoft.iot.vmp.service.bean.ErrorCallback;
|
||||
import com.genersoft.iot.vmp.streamProxy.service.IStreamProxyPlayService;
|
||||
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.STREAM_PROXY)
|
||||
public class SourcePlayServiceForStreamProxyImpl implements ISourcePlayService {
|
||||
|
||||
@Autowired
|
||||
private IStreamProxyPlayService playService;
|
||||
|
||||
@Override
|
||||
public void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback<StreamInfo> callback) {
|
||||
// 拉流代理通道
|
||||
try {
|
||||
playService.start(channel.getDataDeviceId(), record, callback);
|
||||
}catch (Exception e) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -179,7 +179,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
|
||||
streamProxy.setCreateTime(DateUtil.getNow());
|
||||
streamProxy.setUpdateTime(DateUtil.getNow());
|
||||
streamProxyMapper.add(streamProxy);
|
||||
streamProxy.setDataType(ChannelDataType.STREAM_PROXY.value);
|
||||
streamProxy.setDataType(ChannelDataType.STREAM_PROXY);
|
||||
streamProxy.setDataDeviceId(streamProxy.getId());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user