File was renamed from src/main/java/com/genersoft/iot/vmp/vmanager/play/PlayController.java |
| | |
| | | package com.genersoft.iot.vmp.vmanager.play; |
| | | package com.genersoft.iot.vmp.vmanager.gb28181.play; |
| | | |
| | | import com.genersoft.iot.vmp.common.StreamInfo; |
| | | import com.genersoft.iot.vmp.conf.MediaServerConfig; |
| | |
| | | import com.genersoft.iot.vmp.gb28181.transmit.callback.RequestMessage; |
| | | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.vmanager.play.bean.PlayResult; |
| | | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| | | import com.genersoft.iot.vmp.service.IMediaService; |
| | | import com.genersoft.iot.vmp.service.IPlayService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.sip.message.Response; |
| | | |
| | | @Api(tags = "国标设备点播") |
| | | @CrossOrigin |
| | | @RestController |
| | | @RequestMapping("/api/play") |
| | |
| | | @Autowired |
| | | private IMediaService mediaService; |
| | | |
| | | @ApiOperation("开始点播") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "deviceId", value = "设备ID", dataTypeClass = String.class), |
| | | @ApiImplicitParam(name = "channelId", value = "通道ID", dataTypeClass = String.class), |
| | | }) |
| | | @GetMapping("/start/{deviceId}/{channelId}") |
| | | public DeferredResult<ResponseEntity<String>> play(@PathVariable String deviceId, |
| | | @PathVariable String channelId) { |
| | |
| | | return playResult.getResult(); |
| | | } |
| | | |
| | | @ApiOperation("停止点播") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping("/stop/{streamId}") |
| | | public DeferredResult<ResponseEntity<String>> playStop(@PathVariable String streamId) { |
| | | |
| | |
| | | * @param streamId 流ID |
| | | * @return |
| | | */ |
| | | @ApiOperation("将不是h264的视频通过ffmpeg 转码为h264 + aac") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "streamId", value = "视频流ID", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping("/convert/{streamId}") |
| | | public ResponseEntity<String> playConvert(@PathVariable String streamId) { |
| | | StreamInfo streamInfo = redisCatchStorage.queryPlayByStreamId(streamId); |
| | |
| | | * @param key |
| | | * @return |
| | | */ |
| | | @ApiOperation("结束转码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "key", value = "视频流key", dataTypeClass = String.class), |
| | | }) |
| | | @PostMapping("/convertStop/{key}") |
| | | public ResponseEntity<String> playConvertStop(@PathVariable String key) { |
| | | |
| | |
| | | return new ResponseEntity<String>( result.toJSONString(), HttpStatus.OK); |
| | | } |
| | | |
| | | /** |
| | | * 语音广播命令API接口 |
| | | * |
| | | * @param deviceId |
| | | */ |
| | | @ApiOperation("语音广播命令") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "deviceId", value = "设备Id", dataTypeClass = String.class), |
| | | }) |
| | | @GetMapping("/broadcast/{deviceId}") |
| | | @PostMapping("/broadcast/{deviceId}") |
| | | public DeferredResult<ResponseEntity<String>> broadcastApi(@PathVariable String deviceId) { |