old mode 100644
new mode 100755
|  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.exception.ControllerException; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.exception.ServiceException; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.exception.SsrcTransactionNotFoundException; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.security.JwtUtils; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.bean.Device; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.transmit.callback.DeferredResultHolder; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMRTPServerFactory; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IInviteStreamService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IPlayService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.bean.InviteErrorCode; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.StreamContent; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Operation; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.Parameter; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.security.SecurityRequirement; | 
|---|
|  |  |  | import io.swagger.v3.oas.annotations.tags.Tag; | 
|---|
|  |  |  | import org.slf4j.Logger; | 
|---|
|  |  |  | import org.slf4j.LoggerFactory; | 
|---|
|  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import javax.sip.InvalidArgumentException; | 
|---|
|  |  |  | import javax.sip.SipException; | 
|---|
|  |  |  | import java.net.MalformedURLException; | 
|---|
|  |  |  | import java.net.URL; | 
|---|
|  |  |  | import java.text.ParseException; | 
|---|
|  |  |  | import java.util.UUID; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | private SIPCommander cmder; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private ZLMRTPServerFactory zlmrtpServerFactory; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IVideoManagerStorage storager; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IRedisCatchStorage redisCatchStorage; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IInviteStreamService inviteStreamService; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserSetting userSetting; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "开始视频回放") | 
|---|
|  |  |  | @Operation(summary = "开始视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 
|---|
|  |  |  | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 
|---|
|  |  |  | @Parameter(name = "startTime", description = "开始时间", required = true) | 
|---|
|  |  |  | 
|---|
|  |  |  | if (data != null) { | 
|---|
|  |  |  | StreamInfo streamInfo = (StreamInfo)data; | 
|---|
|  |  |  | if (userSetting.getUseSourceIpAsStreamIp()) { | 
|---|
|  |  |  | streamInfo.channgeStreamIp(request.getLocalName()); | 
|---|
|  |  |  | streamInfo=streamInfo.clone();//深拷贝 | 
|---|
|  |  |  | String host; | 
|---|
|  |  |  | try { | 
|---|
|  |  |  | URL url=new URL(request.getRequestURL().toString()); | 
|---|
|  |  |  | host=url.getHost(); | 
|---|
|  |  |  | } catch (MalformedURLException e) { | 
|---|
|  |  |  | host=request.getLocalAddr(); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | streamInfo.channgeStreamIp(host); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | wvpResult.setData(new StreamContent(streamInfo)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "停止视频回放") | 
|---|
|  |  |  | @Operation(summary = "停止视频回放", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "deviceId", description = "设备国标编号", required = true) | 
|---|
|  |  |  | @Parameter(name = "channelId", description = "通道国标编号", required = true) | 
|---|
|  |  |  | @Parameter(name = "stream", description = "流ID", required = true) | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "回放暂停") | 
|---|
|  |  |  | @Operation(summary = "回放暂停", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "streamId", description = "回放流ID", required = true) | 
|---|
|  |  |  | @GetMapping("/pause/{streamId}") | 
|---|
|  |  |  | public void playPause(@PathVariable String streamId) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "回放恢复") | 
|---|
|  |  |  | @Operation(summary = "回放恢复", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "streamId", description = "回放流ID", required = true) | 
|---|
|  |  |  | @GetMapping("/resume/{streamId}") | 
|---|
|  |  |  | public void playResume(@PathVariable String streamId) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "回放拖动播放") | 
|---|
|  |  |  | @Operation(summary = "回放拖动播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "streamId", description = "回放流ID", required = true) | 
|---|
|  |  |  | @Parameter(name = "seekTime", description = "拖动偏移量,单位s", required = true) | 
|---|
|  |  |  | @GetMapping("/seek/{streamId}/{seekTime}") | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Operation(summary = "回放倍速播放") | 
|---|
|  |  |  | @Operation(summary = "回放倍速播放", security = @SecurityRequirement(name = JwtUtils.HEADER)) | 
|---|
|  |  |  | @Parameter(name = "streamId", description = "回放流ID", required = true) | 
|---|
|  |  |  | @Parameter(name = "speed", description = "倍速0.25 0.5 1、2、4", required = true) | 
|---|
|  |  |  | @GetMapping("/speed/{streamId}/{speed}") | 
|---|