Commit 72852799fc4f32dcdb504e0da7523eb7364638c6
Committed by
GitHub
Merge pull request #486 from hotcoffie/wvp-28181-2.0
一些细节修复
Showing
3 changed files
with
7 additions
and
23 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/RegisterRequestProcessor.java
| 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; | 1 | package com.genersoft.iot.vmp.gb28181.transmit.event.request.impl; |
| 2 | 2 | ||
| 3 | -import com.genersoft.iot.vmp.common.VideoManagerConstants; | ||
| 4 | import com.genersoft.iot.vmp.conf.SipConfig; | 3 | import com.genersoft.iot.vmp.conf.SipConfig; |
| 5 | -import com.genersoft.iot.vmp.gb28181.auth.DigestServerAuthenticationHelper; | ||
| 6 | import com.genersoft.iot.vmp.gb28181.bean.Device; | 4 | import com.genersoft.iot.vmp.gb28181.bean.Device; |
| 7 | import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; | 5 | import com.genersoft.iot.vmp.gb28181.bean.WvpSipDate; |
| 8 | -import com.genersoft.iot.vmp.gb28181.event.EventPublisher; | ||
| 9 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; | 6 | import com.genersoft.iot.vmp.gb28181.transmit.SIPProcessorObserver; |
| 10 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; | 7 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.ISIPRequestProcessor; |
| 11 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; | 8 | import com.genersoft.iot.vmp.gb28181.transmit.event.request.SIPRequestProcessorParent; |
| 12 | import com.genersoft.iot.vmp.service.IDeviceService; | 9 | import com.genersoft.iot.vmp.service.IDeviceService; |
| 13 | -import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | ||
| 14 | -import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | ||
| 15 | import com.genersoft.iot.vmp.utils.DateUtil; | 10 | import com.genersoft.iot.vmp.utils.DateUtil; |
| 16 | import gov.nist.javax.sip.RequestEventExt; | 11 | import gov.nist.javax.sip.RequestEventExt; |
| 17 | import gov.nist.javax.sip.address.AddressImpl; | 12 | import gov.nist.javax.sip.address.AddressImpl; |
| 18 | import gov.nist.javax.sip.address.SipUri; | 13 | import gov.nist.javax.sip.address.SipUri; |
| 14 | +import gov.nist.javax.sip.clientauthutils.DigestServerAuthenticationHelper; | ||
| 19 | import gov.nist.javax.sip.header.Expires; | 15 | import gov.nist.javax.sip.header.Expires; |
| 20 | import gov.nist.javax.sip.header.SIPDateHeader; | 16 | import gov.nist.javax.sip.header.SIPDateHeader; |
| 21 | import org.slf4j.Logger; | 17 | import org.slf4j.Logger; |
| @@ -51,15 +47,6 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -51,15 +47,6 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 51 | private SipConfig sipConfig; | 47 | private SipConfig sipConfig; |
| 52 | 48 | ||
| 53 | @Autowired | 49 | @Autowired |
| 54 | - private IRedisCatchStorage redisCatchStorage; | ||
| 55 | - | ||
| 56 | - @Autowired | ||
| 57 | - private IVideoManagerStorage storager; | ||
| 58 | - | ||
| 59 | - @Autowired | ||
| 60 | - private EventPublisher publisher; | ||
| 61 | - | ||
| 62 | - @Autowired | ||
| 63 | private SIPProcessorObserver sipProcessorObserver; | 50 | private SIPProcessorObserver sipProcessorObserver; |
| 64 | 51 | ||
| 65 | @Autowired | 52 | @Autowired |
| @@ -86,7 +73,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | @@ -86,7 +73,7 @@ public class RegisterRequestProcessor extends SIPRequestProcessorParent implemen | ||
| 86 | ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME); | 73 | ExpiresHeader expiresHeader = (ExpiresHeader) request.getHeader(Expires.NAME); |
| 87 | Response response = null; | 74 | Response response = null; |
| 88 | boolean passwordCorrect = false; | 75 | boolean passwordCorrect = false; |
| 89 | - // 注册标志 0:未携带授权头或者密码错误 1:注册成功 2:注销成功 | 76 | + // 注册标志 |
| 90 | boolean registerFlag = false; | 77 | boolean registerFlag = false; |
| 91 | FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME); | 78 | FromHeader fromHeader = (FromHeader) request.getHeader(FromHeader.NAME); |
| 92 | AddressImpl address = (AddressImpl) fromHeader.getAddress(); | 79 | AddressImpl address = (AddressImpl) fromHeader.getAddress(); |
src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
| @@ -19,17 +19,16 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | @@ -19,17 +19,16 @@ import com.genersoft.iot.vmp.media.zlm.ZLMHttpHookSubscribe; | ||
| 19 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 19 | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; |
| 20 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 20 | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| 21 | import com.genersoft.iot.vmp.service.IMediaServerService; | 21 | import com.genersoft.iot.vmp.service.IMediaServerService; |
| 22 | +import com.genersoft.iot.vmp.service.IMediaService; | ||
| 23 | +import com.genersoft.iot.vmp.service.IPlayService; | ||
| 22 | import com.genersoft.iot.vmp.service.bean.InviteTimeOutCallback; | 24 | import com.genersoft.iot.vmp.service.bean.InviteTimeOutCallback; |
| 23 | import com.genersoft.iot.vmp.service.bean.PlayBackCallback; | 25 | import com.genersoft.iot.vmp.service.bean.PlayBackCallback; |
| 24 | import com.genersoft.iot.vmp.service.bean.PlayBackResult; | 26 | import com.genersoft.iot.vmp.service.bean.PlayBackResult; |
| 25 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; | 27 | import com.genersoft.iot.vmp.service.bean.SSRCInfo; |
| 26 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 28 | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| 27 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 29 | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; |
| 28 | -import com.genersoft.iot.vmp.utils.redis.RedisUtil; | ||
| 29 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; | 30 | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| 30 | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; | 31 | import com.genersoft.iot.vmp.vmanager.gb28181.play.bean.PlayResult; |
| 31 | -import com.genersoft.iot.vmp.service.IMediaService; | ||
| 32 | -import com.genersoft.iot.vmp.service.IPlayService; | ||
| 33 | import gov.nist.javax.sip.stack.SIPDialog; | 32 | import gov.nist.javax.sip.stack.SIPDialog; |
| 34 | import org.slf4j.Logger; | 33 | import org.slf4j.Logger; |
| 35 | import org.slf4j.LoggerFactory; | 34 | import org.slf4j.LoggerFactory; |
| @@ -43,6 +42,7 @@ import org.springframework.web.context.request.async.DeferredResult; | @@ -43,6 +42,7 @@ import org.springframework.web.context.request.async.DeferredResult; | ||
| 43 | import javax.sip.ResponseEvent; | 42 | import javax.sip.ResponseEvent; |
| 44 | import java.io.FileNotFoundException; | 43 | import java.io.FileNotFoundException; |
| 45 | import java.math.BigDecimal; | 44 | import java.math.BigDecimal; |
| 45 | +import java.math.RoundingMode; | ||
| 46 | import java.util.*; | 46 | import java.util.*; |
| 47 | 47 | ||
| 48 | @SuppressWarnings(value = {"rawtypes", "unchecked"}) | 48 | @SuppressWarnings(value = {"rawtypes", "unchecked"}) |
| @@ -64,9 +64,6 @@ public class PlayServiceImpl implements IPlayService { | @@ -64,9 +64,6 @@ public class PlayServiceImpl implements IPlayService { | ||
| 64 | private IRedisCatchStorage redisCatchStorage; | 64 | private IRedisCatchStorage redisCatchStorage; |
| 65 | 65 | ||
| 66 | @Autowired | 66 | @Autowired |
| 67 | - private RedisUtil redis; | ||
| 68 | - | ||
| 69 | - @Autowired | ||
| 70 | private DeferredResultHolder resultHolder; | 67 | private DeferredResultHolder resultHolder; |
| 71 | 68 | ||
| 72 | @Autowired | 69 | @Autowired |
| @@ -591,7 +588,7 @@ public class PlayServiceImpl implements IPlayService { | @@ -591,7 +588,7 @@ public class PlayServiceImpl implements IPlayService { | ||
| 591 | 588 | ||
| 592 | BigDecimal currentCount = new BigDecimal(duration/1000); | 589 | BigDecimal currentCount = new BigDecimal(duration/1000); |
| 593 | BigDecimal totalCount = new BigDecimal(end-start); | 590 | BigDecimal totalCount = new BigDecimal(end-start); |
| 594 | - BigDecimal divide = currentCount.divide(totalCount,2, BigDecimal.ROUND_HALF_UP); | 591 | + BigDecimal divide = currentCount.divide(totalCount,2, RoundingMode.HALF_UP); |
| 595 | double process = divide.doubleValue(); | 592 | double process = divide.doubleValue(); |
| 596 | streamInfo.setProgress(process); | 593 | streamInfo.setProgress(process); |
| 597 | } | 594 | } |
web_src/package.json
| @@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
| 52 | "postcss-url": "^7.2.1", | 52 | "postcss-url": "^7.2.1", |
| 53 | "rimraf": "^2.6.0", | 53 | "rimraf": "^2.6.0", |
| 54 | "semver": "^5.3.0", | 54 | "semver": "^5.3.0", |
| 55 | - "shelljs": "^0.7.6", | 55 | + "shelljs": "^0.8.5", |
| 56 | "uglifyjs-webpack-plugin": "^1.1.1", | 56 | "uglifyjs-webpack-plugin": "^1.1.1", |
| 57 | "url-loader": "^0.5.8", | 57 | "url-loader": "^0.5.8", |
| 58 | "vue-loader": "^13.3.0", | 58 | "vue-loader": "^13.3.0", |