Commit c48def08cf607c9c106965f55d54afe24f1bef85
1 parent
4d1c6401
MediaItem增加callId
Showing
3 changed files
with
22 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java
| ... | ... | @@ -461,7 +461,7 @@ public class ZLMHttpHookListener { |
| 461 | 461 | StreamInfo streamInfoByAppAndStream = mediaService.getStreamInfoByAppAndStream(mediaServerItem, |
| 462 | 462 | app, stream, tracks, streamAuthorityInfo.getCallId()); |
| 463 | 463 | item.setStreamInfo(streamInfoByAppAndStream); |
| 464 | - | |
| 464 | + item.setSeverId(userSetting.getServerId()); | |
| 465 | 465 | redisCatchStorage.addStream(mediaServerItem, type, app, stream, item); |
| 466 | 466 | if (item.getOriginType() == OriginType.RTSP_PUSH.ordinal() |
| 467 | 467 | || item.getOriginType() == OriginType.RTMP_PUSH.ordinal() | ... | ... |
src/main/java/com/genersoft/iot/vmp/media/zlm/dto/MediaItem.java
| ... | ... | @@ -4,6 +4,9 @@ import com.genersoft.iot.vmp.common.StreamInfo; |
| 4 | 4 | |
| 5 | 5 | import java.util.List; |
| 6 | 6 | |
| 7 | +/** | |
| 8 | + * @author lin | |
| 9 | + */ | |
| 7 | 10 | public class MediaItem { |
| 8 | 11 | |
| 9 | 12 | /** |
| ... | ... | @@ -22,6 +25,11 @@ public class MediaItem { |
| 22 | 25 | private String stream; |
| 23 | 26 | |
| 24 | 27 | /** |
| 28 | + * 推流鉴权Id | |
| 29 | + */ | |
| 30 | + private String callId; | |
| 31 | + | |
| 32 | + /** | |
| 25 | 33 | * 观看总人数,包括hls/rtsp/rtmp/http-flv/ws-flv |
| 26 | 34 | */ |
| 27 | 35 | private String totalReaderCount; |
| ... | ... | @@ -427,4 +435,12 @@ public class MediaItem { |
| 427 | 435 | public void setSeverId(String severId) { |
| 428 | 436 | this.severId = severId; |
| 429 | 437 | } |
| 438 | + | |
| 439 | + public String getCallId() { | |
| 440 | + return callId; | |
| 441 | + } | |
| 442 | + | |
| 443 | + public void setCallId(String callId) { | |
| 444 | + this.callId = callId; | |
| 445 | + } | |
| 430 | 446 | } | ... | ... |
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
| ... | ... | @@ -485,7 +485,12 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { |
| 485 | 485 | |
| 486 | 486 | @Override |
| 487 | 487 | public void addStream(MediaServerItem mediaServerItem, String type, String app, String streamId, MediaItem mediaItem) { |
| 488 | + // 查找是否使用了callID | |
| 489 | + StreamAuthorityInfo streamAuthorityInfo = getStreamAuthorityInfo(app, streamId); | |
| 488 | 490 | String key = VideoManagerConstants.WVP_SERVER_STREAM_PREFIX + userSetting.getServerId() + "_" + type + "_" + app + "_" + streamId + "_" + mediaServerItem.getId(); |
| 491 | + if (streamAuthorityInfo != null) { | |
| 492 | + mediaItem.setCallId(streamAuthorityInfo.getCallId()); | |
| 493 | + } | |
| 489 | 494 | redis.set(key, mediaItem); |
| 490 | 495 | } |
| 491 | 496 | ... | ... |