| | |
| | | package com.hbbh.adapter.manager.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.common.collect.Maps; |
| | | import com.hbbh.adapter.manager.MonibucaManager; |
| | | import com.hbbh.adapter.utils.HttpClientUtil; |
| | | import com.hbbh.adapter.vo.CallResult; |
| | | import com.hbbh.adapter.vo.MessageVO; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | public class MonibucaManagerImpl implements MonibucaManager { |
| | | |
| | | |
| | | //入参 rtsp视频流 |
| | | private String rtspDemo="rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"; |
| | | |
| | | //返回结果,通过配置文件即可反推得到 前提是调用 rtsp/pull 接口成功 |
| | | private String jessibucaDemo="ws://localhost:8080/live/test.flv"; |
| | | |
| | | |
| | | // =========== monica监控 =========== |
| | | |
| | | /** |
| | | * 调用Gateway API |
| | | * 成功返回 {"code":0} |
| | | * 失败返回 {"code":1,"msg":"publish badname"} |
| | | * @return jessibucaDemo |
| | | */ |
| | | @Override |
| | | public String parseVideo() { |
| | | public CallResult<String> parseVideo() { |
| | | String url="http://localhost:8081/rtsp/pull"; |
| | | Map<String, String> params = Maps.newLinkedHashMap(); |
| | | |
| | | params.put("target",rtspDemo); |
| | | params.put("streamPath","live/test"); |
| | | //TODO:解析rtsp视频 |
| | | return null; |
| | | |
| | | String result = HttpClientUtil.doGet(url, params); |
| | | |
| | | |
| | | Map map = JSON.parseObject(result, Map.class); |
| | | String code = map.get("code")+""; |
| | | String msg = map.get("msg")+""; |
| | | if (!StringUtils.equals("0",code)){ |
| | | CallResult.success(msg,"-1"); |
| | | } |
| | | return CallResult.success(jessibucaDemo); |
| | | } |
| | | } |