| | |
| | | import com.genersoft.iot.vmp.service.bean.MessageForPushChannel;
|
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
| | | import com.genersoft.iot.vmp.utils.redis.RedisUtil;
|
| | | import com.genersoft.iot.vmp.vmanager.bean.*;
|
| | | import org.slf4j.Logger;
|
| | | import org.slf4j.LoggerFactory;
|
| | |
| | |
|
| | |
|
| | | HookResultForOnPublish result = HookResultForOnPublish.SUCCESS();
|
| | | if (!"rtp".equals(param.getApp())) {
|
| | | result.setEnable_audio(true);
|
| | | }
|
| | |
|
| | | result.setEnable_audio(true);
|
| | | taskExecutor.execute(() -> {
|
| | | ZlmHttpHookSubscribe.Event subscribe = this.subscribe.sendNotify(HookType.on_publish, json);
|
| | | if (subscribe != null) {
|
| | |
| | | // 如果是录像下载就设置视频间隔十秒
|
| | | if (ssrcTransactionForAll.get(0).getType() == VideoStreamSessionManager.SessionType.download) {
|
| | | result.setMp4_max_second(10);
|
| | | result.setEnable_audio(true);
|
| | | result.setEnable_mp4(true);
|
| | | }
|
| | | }
|
| | |
|
| | | String receiveKey = VideoManagerConstants.WVP_OTHER_RECEIVE_RTP_INFO + userSetting.getServerId() + "*";
|
| | | // 将信息写入redis中,以备后用
|
| | | List<Object> scan = RedisUtil.scan(redisTemplate, receiveKey);
|
| | | if (scan.size()>0) {
|
| | | for (Object o : scan) {
|
| | | String key = (String) o;
|
| | | OtherRtpSendInfo otherRtpSendInfo = (OtherRtpSendInfo)redisTemplate.opsForValue().get(key);
|
| | | if (otherRtpSendInfo != null && otherRtpSendInfo.getStream().equalsIgnoreCase(param.getStream())) {
|
| | | result.setEnable_audio(true);
|
| | | result.setEnable_mp4(true);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | if (param.getApp().equalsIgnoreCase("rtp")) {
|
| | | String receiveKey = VideoManagerConstants.WVP_OTHER_RECEIVE_RTP_INFO + userSetting.getServerId() + "_" + param.getStream();
|
| | | OtherRtpSendInfo otherRtpSendInfo = (OtherRtpSendInfo)redisTemplate.opsForValue().get(receiveKey);
|
| | |
|
| | | String receiveKeyForPS = VideoManagerConstants.WVP_OTHER_RECEIVE_PS_INFO + userSetting.getServerId() + "_" + param.getStream();
|
| | | OtherPsSendInfo otherPsSendInfo = (OtherPsSendInfo)redisTemplate.opsForValue().get(receiveKeyForPS);
|
| | | if (otherRtpSendInfo != null || otherPsSendInfo != null) {
|
| | | result.setEnable_mp4(true);
|
| | | }
|
| | | }
|
| | | logger.info("[ZLM HOOK]推流鉴权 响应:{}->{}->>>>{}", param.getMediaServerId(), param, result);
|
| | | return result;
|
| | | }
|
| | |
|