648540858
2021-11-29 019827fd35f84465ee503fcc248b12a045da44d2
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/cmd/impl/SIPCommander.java
@@ -1196,14 +1196,15 @@
    * @param endTime 结束时间,格式要求:yyyy-MM-dd HH:mm:ss
    */  
   @Override
   public boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime) {
   public boolean recordInfoQuery(Device device, String channelId, String startTime, String endTime, int sn, SipSubscribe.Event errorEvent) {
      try {
         StringBuffer recordInfoXml = new StringBuffer(200);
         recordInfoXml.append("<?xml version=\"1.0\" encoding=\"GB2312\"?>\r\n");
         recordInfoXml.append("<Query>\r\n");
         recordInfoXml.append("<CmdType>RecordInfo</CmdType>\r\n");
         recordInfoXml.append("<SN>" + (int)((Math.random()*9+1)*100000) + "</SN>\r\n");
         recordInfoXml.append("<SN>" + sn + "</SN>\r\n");
         recordInfoXml.append("<DeviceID>" + channelId + "</DeviceID>\r\n");
         recordInfoXml.append("<StartTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(startTime) + "</StartTime>\r\n");
         recordInfoXml.append("<EndTime>" + DateUtil.yyyy_MM_dd_HH_mm_ssToISO8601(endTime) + "</EndTime>\r\n");
@@ -1220,7 +1221,7 @@
         Request request = headerProvider.createMessageRequest(device, recordInfoXml.toString(),
               "z9hG4bK-ViaRecordInfo-" + tm, "fromRec" + tm, null, callIdHeader);
         transmitRequest(device, request);
         transmitRequest(device, request, errorEvent);
      } catch (SipException | ParseException | InvalidArgumentException e) {
         e.printStackTrace();
         return false;
@@ -1609,7 +1610,8 @@
         StringBuffer content = new StringBuffer(200);
         content.append("PLAY RTSP/1.0\r\n");
         content.append("CSeq: " + InfoCseqCache.CSEQCACHE.get(streamInfo.getStreamId()) + "\r\n");
         content.append("Range: npt=" + seekTime + "-\r\n");
         content.append("Range: npt=" + Math.abs(seekTime) + "-\r\n");
         Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString());
         logger.info(request.toString());
         ClientTransaction clientTransaction = null;
@@ -1630,12 +1632,12 @@
    * 回放倍速播放
    */
   @Override
   public void playSpeedCmd(Device device, StreamInfo streamInfo, String speed) {
   public void playSpeedCmd(Device device, StreamInfo streamInfo, Double speed) {
      try {
         StringBuffer content = new StringBuffer(200);
         content.append("PLAY RTSP/1.0\r\n");
         content.append("CSeq: " + InfoCseqCache.CSEQCACHE.get(streamInfo.getStreamId()) + "\r\n");
         content.append("Scale: " + speed + ".000000\r\n");
         content.append("Scale: " + String.format("%.1f",speed) + "\r\n");
         Request request = headerProvider.createInfoRequest(device, streamInfo, content.toString());
         logger.info(request.toString());
         ClientTransaction clientTransaction = null;