| | |
| | | import com.genersoft.iot.vmp.conf.exception.ControllerException; |
| | | import com.genersoft.iot.vmp.media.bean.MediaInfo; |
| | | import com.genersoft.iot.vmp.media.service.IMediaNodeServerService; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServer; |
| | | import com.genersoft.iot.vmp.media.bean.MediaServer; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.ZLMServerConfig; |
| | | import com.genersoft.iot.vmp.vmanager.bean.ErrorCode; |
| | | import com.genersoft.iot.vmp.vmanager.bean.WVPResult; |
| | |
| | | return null; |
| | | } |
| | | JSONObject mediaJSON = data.getJSONObject(0); |
| | | MediaInfo mediaInfo = MediaInfo.getInstance(mediaJSON); |
| | | MediaInfo mediaInfo = MediaInfo.getInstance(mediaJSON, mediaServer); |
| | | StreamInfo streamInfo = getStreamInfoByAppAndStream(mediaServer, app, stream, mediaInfo, callId, true); |
| | | if (streamInfo != null) { |
| | | streamInfoList.add(streamInfo); |
| | |
| | | if (jsonObject.getInteger("code") != 0) { |
| | | return null; |
| | | } |
| | | return MediaInfo.getInstance(jsonObject); |
| | | return MediaInfo.getInstance(jsonObject, mediaServer); |
| | | } |
| | | |
| | | @Override |
| | |
| | | public WVPResult<String> addStreamProxy(MediaServer mediaServer, String app, String stream, String url, boolean enableAudio, boolean enableMp4, String rtpType) { |
| | | JSONObject jsonObject = zlmresTfulUtils.addStreamProxy(mediaServer, app, stream, url, enableAudio, enableMp4, rtpType); |
| | | if (jsonObject.getInteger("code") != 0) { |
| | | logger.warn("[addStreamProxy] 添加代理失败"); |
| | | return WVPResult.fail(ErrorCode.ERROR100.getCode(), "添加代理失败"); |
| | | }else { |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | | if (data == null) { |
| | | return WVPResult.fail(ErrorCode.ERROR100.getCode(), "代理结果异常: " + jsonObject); |
| | | }else { |
| | | return WVPResult.success(""); |
| | | return WVPResult.success(data.getString("key")); |
| | | } |
| | | } |
| | | } |