panlinlin
2021-01-05 730a64be077b51add311b9d880bb23f5162253ec
src/main/java/com/genersoft/iot/vmp/web/ApiStreamController.java
@@ -8,6 +8,7 @@
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.transmit.cmd.impl.SIPCommander;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
import com.genersoft.iot.vmp.storager.IVideoManagerStorager;
import com.genersoft.iot.vmp.vmanager.play.PlayController;
import org.slf4j.Logger;
@@ -34,6 +35,9 @@
    @Autowired
    private IVideoManagerStorager storager;
    @Autowired
    private IRedisCatchStorage redisCatchStorage;
    private boolean closeWaitRTPInfo = false;
@@ -86,6 +90,8 @@
            JSONObject result = new JSONObject();
            result.put("error","timeout");
            resultDeferredResult.setResult(result);
             // 清理RTP server
        });
        DeviceChannel deviceChannel = storager.queryChannel(serial, code);
@@ -156,14 +162,14 @@
    ){
        StreamInfo streamInfo = storager.queryPlayByDevice(serial, code);
        StreamInfo streamInfo = redisCatchStorage.queryPlayByDevice(serial, code);
        if (streamInfo == null) {
            JSONObject result = new JSONObject();
            result.put("error","未找到流信息");
            return result;
        }
        cmder.streamByeCmd(streamInfo.getStreamId());
        storager.stopPlay(streamInfo);
        redisCatchStorage.stopPlay(streamInfo);
        return null;
    }