Commit 8cab9f23b07dca8aa20f117aaf420597f14a0fe3

Authored by 648540858
1 parent 86c08db2

修复使用来源IP作为流ip配置

src/main/java/com/genersoft/iot/vmp/vmanager/gb28181/play/PlayController.java
@@ -106,22 +106,24 @@ public class PlayController { @@ -106,22 +106,24 @@ public class PlayController {
106 resultHolder.invokeResult(msg); 106 resultHolder.invokeResult(msg);
107 }); 107 });
108 108
109 - // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误  
110 - deferredResultEx.setFilter(result1 -> {  
111 - WVPResult<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1;  
112 - WVPResult<StreamInfo> clone = null;  
113 - try {  
114 - clone = (WVPResult<StreamInfo>)wvpResult1.clone();  
115 - } catch (CloneNotSupportedException e) {  
116 - throw new RuntimeException(e);  
117 - }  
118 - if (clone.getCode() == ErrorCode.SUCCESS.getCode()) {  
119 - StreamInfo data = clone.getData().clone();  
120 - data.channgeStreamIp(request.getLocalName());  
121 - clone.setData(data);  
122 - }  
123 - return clone;  
124 - }); 109 + if (userSetting.getUseSourceIpAsStreamIp()) {
  110 + // TODO 在点播未成功的情况下在此调用接口点播会导致返回的流地址ip错误
  111 + deferredResultEx.setFilter(result1 -> {
  112 + WVPResult<StreamInfo> wvpResult1 = (WVPResult<StreamInfo>)result1;
  113 + WVPResult<StreamInfo> clone = null;
  114 + try {
  115 + clone = (WVPResult<StreamInfo>)wvpResult1.clone();
  116 + } catch (CloneNotSupportedException e) {
  117 + throw new RuntimeException(e);
  118 + }
  119 + if (clone.getCode() == ErrorCode.SUCCESS.getCode()) {
  120 + StreamInfo data = clone.getData().clone();
  121 + data.channgeStreamIp(request.getLocalName());
  122 + clone.setData(data);
  123 + }
  124 + return clone;
  125 + });
  126 + }
125 127
126 // 录像查询以channelId作为deviceId查询 128 // 录像查询以channelId作为deviceId查询
127 resultHolder.put(key, uuid, deferredResultEx); 129 resultHolder.put(key, uuid, deferredResultEx);