You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openmeetings.apache.org by so...@apache.org on 2018/10/29 12:55:34 UTC

[openmeetings] branch master updated: [OPENMEETINGS-1955] stream type is preserved

This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new fe904b2  [OPENMEETINGS-1955] stream type is preserved
fe904b2 is described below

commit fe904b20cc3dba42fa6ed14c50b18437437312e4
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Mon Oct 29 19:55:22 2018 +0700

    [OPENMEETINGS-1955] stream type is preserved
---
 .../main/java/org/apache/openmeetings/core/remote/KStream.java | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java
index 1bc11f0..a3228fb 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/KStream.java
@@ -57,6 +57,7 @@ public class KStream implements IKStream {
 	private final String sid;
 	private final String uid;
 	private final KRoom room;
+	private final StreamType streamType;
 	private MediaProfileSpecType profile;
 	private RecorderEndpoint recorder;
 	private WebRtcEndpoint outgoingMedia = null;
@@ -68,6 +69,7 @@ public class KStream implements IKStream {
 		this.room = room;
 		this.sid = sd.getSid();
 		this.uid = sd.getUid();
+		streamType = sd.getType();
 		//TODO Min/MaxVideoSendBandwidth
 		//TODO Min/Max Audio/Video RecvBandwidth
 	}
@@ -79,12 +81,12 @@ public class KStream implements IKStream {
 		final boolean hasAudio = sd.hasActivity(Activity.AUDIO);
 		final boolean hasVideo = sd.hasActivity(Activity.VIDEO);
 		if ((sdpOffer.indexOf("m=audio") > -1 && !hasAudio)
-				|| (sdpOffer.indexOf("m=video") > -1 && !hasVideo && StreamType.SCREEN != sd.getType()))
+				|| (sdpOffer.indexOf("m=video") > -1 && !hasVideo && StreamType.SCREEN != streamType))
 		{
 			log.warn("Broadcast started without enough rights");
 			return this;
 		}
-		if (StreamType.SCREEN == sd.getType()) {
+		if (StreamType.SCREEN == streamType) {
 			type = Type.SCREEN;
 		} else {
 			if (hasAudio && hasVideo) {
@@ -115,7 +117,7 @@ public class KStream implements IKStream {
 		outgoingMedia.addMediaFlowOutStateChangeListener(evt -> {
 			if (MediaFlowState.NOT_FLOWING == evt.getState()) {
 				log.warn("Media FlowOut :: {}", evt.getState());
-				if (StreamType.SCREEN == sd.getType()) {
+				if (StreamType.SCREEN == streamType) {
 					h.stopSharing(sid, uid);
 				} else {
 					//TODO remove stream ?
@@ -189,7 +191,7 @@ public class KStream implements IKStream {
 				if (sd.hasActivity(Activity.AUDIO)) {
 					outgoingMedia.connect(listener, MediaType.AUDIO);
 				}
-				if (StreamType.SCREEN == sd.getType() || sd.hasActivity(Activity.VIDEO)) {
+				if (StreamType.SCREEN == streamType || sd.hasActivity(Activity.VIDEO)) {
 					outgoingMedia.connect(listener, MediaType.VIDEO);
 				}
 			}