| | |
| | | package com.genersoft.iot.vmp.media.zlm; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.IMediaServerItem; |
| | | import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | import java.util.concurrent.ConcurrentHashMap; |
| | | |
| | | /** |
| | | * @Description:针对 ZLMediaServer的hook事件订阅 |
| | | * @description:针对 ZLMediaServer的hook事件订阅 |
| | | * @author: pan |
| | | * @date: 2020年12月2日 21:17:32 |
| | | */ |
| | |
| | | on_stream_changed, |
| | | on_stream_none_reader, |
| | | on_stream_not_found, |
| | | on_server_started |
| | | on_server_started, |
| | | on_server_keepalive |
| | | } |
| | | |
| | | public interface Event{ |
| | | void response(IMediaServerItem mediaServerItem, JSONObject response); |
| | | void response(MediaServerItem mediaServerItem, JSONObject response); |
| | | } |
| | | |
| | | private Map<HookType, Map<JSONObject, ZLMHttpHookSubscribe.Event>> allSubscribes = new ConcurrentHashMap<>(); |
| | |
| | | if (result == null) { |
| | | result = key.getString(s).equals(hookResponse.getString(s)); |
| | | }else { |
| | | if (key.getString(s) == null) { |
| | | continue; |
| | | } |
| | | result = result && key.getString(s).equals(hookResponse.getString(s)); |
| | | } |
| | | |
| | |
| | | if (result == null) { |
| | | result = key.getString(s).equals(hookResponse.getString(s)); |
| | | }else { |
| | | if (key.getString(s) == null) continue; |
| | | result = result && key.getString(s).equals(hookResponse.getString(s)); |
| | | } |
| | | |
| | | } |
| | | if (null != result && result){ |
| | | iterator.remove(); |