|  |  |  | 
|---|
|  |  |  | import com.genersoft.iot.vmp.common.StreamInfo; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.conf.MediaConfig; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IMediaServerService; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.storager.IVideoManagerStorage; | 
|---|
|  |  |  | import com.genersoft.iot.vmp.service.IMediaService; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | private IRedisCatchStorage redisCatchStorage; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IVideoManagerStorager storager; | 
|---|
|  |  |  | private IVideoManagerStorage storager; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private IMediaServerService mediaServerService; | 
|---|
|  |  |  | 
|---|
|  |  |  | if (mediaList != null) { | 
|---|
|  |  |  | if (mediaList.getInteger("code") == 0) { | 
|---|
|  |  |  | JSONArray data = mediaList.getJSONArray("data"); | 
|---|
|  |  |  | if (data == null) return null; | 
|---|
|  |  |  | if (data == null) { | 
|---|
|  |  |  | return null; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | JSONObject mediaJSON = JSON.parseObject(JSON.toJSONString(data.get(0)), JSONObject.class); | 
|---|
|  |  |  | JSONArray tracks = mediaJSON.getJSONArray("tracks"); | 
|---|
|  |  |  | streamInfo = getStreamInfoByAppAndStream(mediaInfo, app, stream, tracks); | 
|---|
|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public StreamInfo getStreamInfoByAppAndStream(MediaServerItem mediaInfo, String app, String stream, Object tracks, String addr) { | 
|---|
|  |  |  | StreamInfo streamInfoResult = new StreamInfo(); | 
|---|
|  |  |  | streamInfoResult.setStreamId(stream); | 
|---|
|  |  |  | streamInfoResult.setStream(stream); | 
|---|
|  |  |  | streamInfoResult.setApp(app); | 
|---|
|  |  |  | if (addr == null) { | 
|---|
|  |  |  | addr = mediaInfo.getStreamIp(); | 
|---|