支持点播、停止点播和云台控制
This commit is contained in:
@@ -612,4 +612,5 @@ public interface CommonGBChannelMapper {
|
||||
|
||||
|
||||
CommonGBChannel queryByDataIdAndDeviceID(Integer deviceDbId, String deviceId);
|
||||
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ public interface IGbChannelPlayService {
|
||||
void download(CommonGBChannel channel, Long startTime, Long stopTime, Integer downloadSpeed,
|
||||
ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void stopPlay(CommonGBChannel channel, String stream);
|
||||
void stopPlay(CommonGBChannel channel);
|
||||
|
||||
void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ public interface IPlayService {
|
||||
|
||||
void play(CommonGBChannel channel, Boolean record, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void stopPlay(InviteSessionType inviteSessionType, CommonGBChannel channel);
|
||||
|
||||
void stop(InviteSessionType inviteSessionType, CommonGBChannel channel, String stream);
|
||||
|
||||
void playBack(CommonGBChannel channel, Long startTime, Long stopTime, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
@@ -12,6 +12,6 @@ public interface ISourcePlayService {
|
||||
|
||||
void play(CommonGBChannel channel, Platform platform, Boolean record, ErrorCallback<StreamInfo> callback);
|
||||
|
||||
void stopPlay(CommonGBChannel channel, String stream);
|
||||
void stopPlay(CommonGBChannel channel);
|
||||
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||
public void stopInvite(InviteSessionType type, CommonGBChannel channel, String stream) {
|
||||
switch (type) {
|
||||
case PLAY:
|
||||
stopPlay(channel, stream);
|
||||
stopPlay(channel);
|
||||
break;
|
||||
case PLAYBACK:
|
||||
stopPlayback(channel, stream);
|
||||
@@ -135,7 +135,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopPlay(CommonGBChannel channel, String stream) {
|
||||
public void stopPlay(CommonGBChannel channel) {
|
||||
Integer dataType = channel.getDataType();
|
||||
ISourcePlayService sourceChannelPlayService = sourcePlayServiceMap.get(ChannelDataType.PLAY_SERVICE + dataType);
|
||||
if (sourceChannelPlayService == null) {
|
||||
@@ -143,7 +143,7 @@ public class GbChannelPlayServiceImpl implements IGbChannelPlayService {
|
||||
log.error("[点播通用通道] 类型编号: {} 不支持停止实时流", dataType);
|
||||
throw new PlayException(Response.BUSY_HERE, "channel not support");
|
||||
}
|
||||
sourceChannelPlayService.stopPlay(channel, stream);
|
||||
sourceChannelPlayService.stopPlay(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1741,6 +1741,18 @@ public class PlayServiceImpl implements IPlayService {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopPlay(InviteSessionType inviteSessionType, CommonGBChannel channel) {
|
||||
Device device = deviceService.getDevice(channel.getDataDeviceId());
|
||||
if (device == null) {
|
||||
log.warn("[停止播放] 未找到通道{}的设备信息", channel);
|
||||
throw new PlayException(Response.SERVER_INTERNAL_ERROR, "server internal error");
|
||||
}
|
||||
DeviceChannel deviceChannel = deviceChannelService.getOneForSourceById(channel.getGbId());
|
||||
String stream = String.format("%s_%s", device.getDeviceId(), deviceChannel.getDeviceId());
|
||||
stop(inviteSessionType, device, deviceChannel, stream);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop(InviteSessionType inviteSessionType, CommonGBChannel channel, String stream) {
|
||||
Device device = deviceService.getDevice(channel.getDataDeviceId());
|
||||
|
||||
@@ -40,10 +40,10 @@ public class SourcePlayServiceForGbImpl implements ISourcePlayService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopPlay(CommonGBChannel channel, String stream) {
|
||||
public void stopPlay(CommonGBChannel channel) {
|
||||
// 国标通道
|
||||
try {
|
||||
deviceChannelPlayService.stop(InviteSessionType.PLAY, channel, stream);
|
||||
deviceChannelPlayService.stopPlay(InviteSessionType.PLAY, channel);
|
||||
} catch (Exception e) {
|
||||
log.error("[停止点播失败] {}({})", channel.getGbName(), channel.getGbDeviceId(), e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user