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/04/24 11:45:14 UTC

[openmeetings] branch 4.0.x updated: [OPENMEETINGS-1877] the issue seems to be fixed

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

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


The following commit(s) were added to refs/heads/4.0.x by this push:
     new ccc1fc6  [OPENMEETINGS-1877] the issue seems to be fixed
ccc1fc6 is described below

commit ccc1fc604abb4bad3b6d8d1eacf260a260813853
Author: Maxim Solodovnik <so...@gmail.com>
AuthorDate: Tue Apr 24 18:44:57 2018 +0700

    [OPENMEETINGS-1877] the issue seems to be fixed
---
 .../openmeetings/core/converter/BaseConverter.java |  4 +-
 .../core/remote/ScopeApplicationAdapter.java       | 27 ++------
 .../apache/openmeetings/db/dto/room/CheckDto.java  | 74 ---------------------
 openmeetings-flash/src/main/flex/main.mxml         | 75 +++++++++-------------
 .../main/flex/org/apache/openmeetings/OmVideo.as   |  7 +-
 .../src/main/assembly/conf/jee-container.xml       | 10 +--
 .../java/org/apache/openmeetings/web/room/video.js |  2 +-
 7 files changed, 45 insertions(+), 154 deletions(-)

diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
index 904e86d..e9af1e4 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/converter/BaseConverter.java
@@ -74,7 +74,7 @@ public abstract class BaseConverter {
 	@Autowired
 	protected FileItemLogDao logDao;
 
-	protected static class Dimension {
+	public static class Dimension {
 		private final int width;
 		private final int height;
 
@@ -406,7 +406,7 @@ public abstract class BaseConverter {
 		logs.add(ProcessHelper.executeScript(String.format("generate preview PNG :: %s", f.getHash()), argv));
 	}
 
-	protected static Dimension getDimension(String txt) {
+	public static Dimension getDimension(String txt) {
 		Matcher matcher = p.matcher(txt);
 
 		while (matcher.find()) {
diff --git a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ScopeApplicationAdapter.java b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ScopeApplicationAdapter.java
index cd76dd4..78e417c 100644
--- a/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ScopeApplicationAdapter.java
+++ b/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/ScopeApplicationAdapter.java
@@ -37,6 +37,7 @@ import java.util.Map;
 import java.util.UUID;
 
 import org.apache.openmeetings.IApplication;
+import org.apache.openmeetings.core.converter.BaseConverter;
 import org.apache.openmeetings.core.service.RecordingService;
 import org.apache.openmeetings.core.util.IClientUtil;
 import org.apache.openmeetings.core.util.WebSocketHelper;
@@ -47,7 +48,6 @@ import org.apache.openmeetings.db.dao.record.RecordingDao;
 import org.apache.openmeetings.db.dao.room.RoomDao;
 import org.apache.openmeetings.db.dao.room.SipDao;
 import org.apache.openmeetings.db.dao.user.UserDao;
-import org.apache.openmeetings.db.dto.room.CheckDto;
 import org.apache.openmeetings.db.entity.basic.Client;
 import org.apache.openmeetings.db.entity.log.ConferenceLog;
 import org.apache.openmeetings.db.entity.room.Room;
@@ -501,6 +501,12 @@ public class ScopeApplicationAdapter extends MultiThreadedApplicationAdapter imp
 			String streamName = stream.getPublishedName();
 			_log.debug("start streamPublishStart broadcast start: {}, CONN {}", streamName, current);
 			c.setBroadcastId(streamName);
+			final int sizeIdx = streamName.indexOf("__");
+			if (sizeIdx > -1) {
+				BaseConverter.Dimension d = BaseConverter.getDimension(streamName.substring(sizeIdx + 2));
+				c.setWidth(d.getWidth());
+				c.setHeight(d.getHeight());
+			}
 
 			if (Client.Type.sharing != c.getType() && Client.Type.mobile != c.getType()) {
 				if (Strings.isEmpty(c.getAvsettings()) || "n".equals(c.getAvsettings())) {
@@ -1030,23 +1036,4 @@ public class ScopeApplicationAdapter extends MultiThreadedApplicationAdapter imp
 		}
 		return count != null && count > 0 ? count - 1 : 0;
 	}
-
-	public CheckDto check() {
-		IConnection current = Red5.getConnectionLocal();
-		StreamClient c = streamClientManager.get(IClientUtil.getId(current.getClient()));
-		Client cl = clientManager.getBySid(c.getSid());
-		return new CheckDto(cl);
-	}
-
-	public void resize(Double width, Double height) {
-		if (width == null || height == null) {
-			return;
-		}
-		IConnection current = Red5.getConnectionLocal();
-		StreamClient c = streamClientManager.get(IClientUtil.getId(current.getClient()));
-		if (c == null) {
-			return;
-		}
-		streamClientManager.update(c.setWidth(width.intValue()).setHeight(height.intValue()));
-	}
 }
diff --git a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/CheckDto.java b/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/CheckDto.java
deleted file mode 100644
index 1ef1d2b..0000000
--- a/openmeetings-db/src/main/java/org/apache/openmeetings/db/dto/room/CheckDto.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License") +  you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.openmeetings.db.dto.room;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.openmeetings.db.entity.basic.Client;
-import org.apache.openmeetings.db.entity.basic.Client.Activity;
-import org.apache.openmeetings.db.entity.basic.Client.Pod;
-import org.apache.openmeetings.db.entity.room.Room;
-
-@XmlRootElement
-@XmlAccessorType(XmlAccessType.FIELD)
-public class CheckDto {
-	private final long roomId;
-	private final Room.Type roomType;
-	private final boolean audioOnly;
-	private final Set<Activity> activities = new HashSet<>();
-	private final Pod pod;
-
-	public CheckDto(Client c) {
-		roomId = c.getRoom().getId();
-		roomType = c.getRoom().getType();
-		audioOnly = c.getRoom().isAudioOnly();
-		if (c.hasActivity(Activity.broadcastA)) {
-			activities.add(Activity.broadcastA);
-		}
-		if (c.hasActivity(Activity.broadcastV)) {
-			activities.add(Activity.broadcastV);
-		}
-		pod = c.getPod();
-	}
-
-	public long getRoomId() {
-		return roomId;
-	}
-
-	public Room.Type getRoomType() {
-		return roomType;
-	}
-
-	public boolean isAudioOnly() {
-		return audioOnly;
-	}
-
-	public Set<Activity> getActivities() {
-		return activities;
-	}
-
-	public Pod getPod() {
-		return pod;
-	}
-}
diff --git a/openmeetings-flash/src/main/flex/main.mxml b/openmeetings-flash/src/main/flex/main.mxml
index 105fc2a..e6a336d 100644
--- a/openmeetings-flash/src/main/flex/main.mxml
+++ b/openmeetings-flash/src/main/flex/main.mxml
@@ -184,50 +184,35 @@
 					ExternalInterface.addCallback("setRights", setRightsCallback);
 					ExternalInterface.addCallback("cleanup", cleanupCallback);
 					video.connect(function ():void {
-						// trust no-one
-						video.getNc().call("check", new Responder(function (check:Object):void {
-							debug("check", check);
-							audioOnly = check.audioOnly;
-							activities = check.activities;
-							interview = 'interview' == check.roomType;
-							checkAvPermissions(function ():void {
-								// trust no-one
-								video.getNc().call("check", new Responder(function (check:Object):void {
-									debug("check", check);
-									activities = check.activities;
-									addImage(params.width, params.height);
-									_resize(params.width, params.height);
-									_updateExclusive();
-									activityTimer.addEventListener(TimerEvent.TIMER, broadcastTimerListener);
-									refreshBroadcast(null);
-									ExternalInterface.call("VideoManager.securityMode", params.uid, false);
-									ExternalInterface.addCallback("refresh", refreshBroadcast);
-									ExternalInterface.addCallback("update", function ():void {
-										video.getNc().call("check", new Responder(function (check:Object):void {
-											debug("check", check);
-											var pVideo:Boolean = hasVideo(), nVideo:Boolean = _hasVideo(check.activities)
-													, pAudio:Boolean = hasAudio(), nAudio:Boolean = _hasAudio(check.activities);
-											if (nVideo != pVideo || nAudio != pAudio) {
-												// activities are changed
-												activities = check.activities;
-												if (nVideo && pVideo) {
-													nAudio ? video.unmute() : video.mute();
-													if (mic != null) {
-														activityTimer.start();
-													} else {
-														activityTimer.stop();
-													}
-												} else {
-													refreshBroadcast(null);
-												}
-											}
-											_updateExclusive();
-											//debug("Client updated: ", c);
-										}));
-									});
-								}));
+						checkAvPermissions(function ():void {
+							addImage(params.width, params.height);
+							_resize(params.width, params.height);
+							_updateExclusive();
+							activityTimer.addEventListener(TimerEvent.TIMER, broadcastTimerListener);
+							refreshBroadcast(null);
+							ExternalInterface.call("VideoManager.securityMode", params.uid, false);
+							ExternalInterface.addCallback("refresh", refreshBroadcast);
+							ExternalInterface.addCallback("update", function(c:Object):void {
+								var pVideo:Boolean = hasVideo(), nVideo:Boolean = _hasVideo(c.activities)
+										, pAudio:Boolean = hasAudio(), nAudio:Boolean = _hasAudio(c.activities);
+								if (nVideo != pVideo || nAudio != pAudio) {
+									// activities are changed
+									activities = c.activities;
+									if (nVideo && pVideo) {
+										nAudio ? video.unmute() : video.mute();
+										if (mic != null) {
+											activityTimer.start();
+										} else {
+											activityTimer.stop();
+										}
+									} else {
+										refreshBroadcast(null);
+									}
+								}
+								_updateExclusive();
+								//debug("Client updated: ", c);
 							});
-						}))
+						});
 					});
 				}
 					break;
@@ -613,8 +598,8 @@
 			volumeRect.height = ah;
 			if (active !== _active) {
 				active = _active;
-				video.getNc().call("micActivity", new Responder(function (res:Object):void {
-				}), active);
+				//video.getNc().call("micActivity", new Responder(function (res:Object):void {
+				//}), active);
 				ExternalInterface.call("VideoManager.micActivity", params.uid, active);
 			}
 		}
diff --git a/openmeetings-flash/src/main/flex/org/apache/openmeetings/OmVideo.as b/openmeetings-flash/src/main/flex/org/apache/openmeetings/OmVideo.as
index cd0a0e8..bc863db 100644
--- a/openmeetings-flash/src/main/flex/org/apache/openmeetings/OmVideo.as
+++ b/openmeetings-flash/src/main/flex/org/apache/openmeetings/OmVideo.as
@@ -193,7 +193,8 @@ public class OmVideo {
 		this.mic = _mic;
 		createStream();
 
-		ns.publish(name, (mode === BROADCAST) ? LIVE : mode);
+		ns.publish(name + "__" + (cam === null ? 0 : cam.width) + "x" + (cam === null ? 0 : cam.height)
+				, (mode === BROADCAST) ? LIVE : mode);
 		ns.attachCamera(cam);
 		attachCamera(cam);
 		if (cam !== null) {
@@ -306,9 +307,7 @@ public class OmVideo {
 
 	public function broadcast(name:String, cam:Camera, _mic:Microphone):void {
 		connect(function():void {
-			nc.call("resize", new Responder(function ():void {
-				_publish(BROADCAST, name, cam, _mic, null);
-			}), cam === null ? 0 : cam.width, cam === null ? 0 : cam.height);
+			_publish(BROADCAST, name, cam, _mic, null);
 		});
 	}
 
diff --git a/openmeetings-server/src/main/assembly/conf/jee-container.xml b/openmeetings-server/src/main/assembly/conf/jee-container.xml
index 79d274d..4266859 100644
--- a/openmeetings-server/src/main/assembly/conf/jee-container.xml
+++ b/openmeetings-server/src/main/assembly/conf/jee-container.xml
@@ -40,6 +40,7 @@
 					<property name="redirectPort" value="${https.port}" />
 					<property name="connectionProperties">
 						<map>
+							<entry key="maxHttpHeaderSize" value="${http.max_headers_size}"/>
 							<entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}"/>
 							<entry key="keepAliveTimout" value="-1"/>
 						</map>
@@ -61,10 +62,6 @@
 					<property name="pattern" value="common" />
 					<property name="rotatable" value="true" />
 				</bean>
-				<bean id="valve.error" class="org.apache.catalina.valves.ErrorReportValve">
-					<property name="showReport" value="false" />
-					<property name="showServerInfo" value="false" />
-				</bean>
 			</list>
 		</property>
 	</bean>
@@ -97,6 +94,7 @@
 							<entry key="truststorePass" value="${rtmps.truststorepass}" />
 							<entry key="clientAuth" value="false" />
 							<entry key="allowUnsafeLegacyRenegotiation" value="true" />
+							<entry key="maxHttpHeaderSize" value="${http.max_headers_size}"/>
 							<entry key="maxKeepAliveRequests" value="${http.max_keep_alive_requests}"/>
 							<entry key="keepAliveTimout" value="-1"/>
 							<entry key="useExecutor" value="true"/>
@@ -122,10 +120,6 @@
 					<property name="pattern" value="common" />
 					<property name="rotatable" value="true" />
 				</bean>
-				<bean id="valve.error" class="org.apache.catalina.valves.ErrorReportValve">
-					<property name="showReport" value="false" />
-					<property name="showServerInfo" value="false" />
-				</bean>
 			</list>
 		</property>
 	</bean>
diff --git a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
index 47f8011..9ce3d20 100644
--- a/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
+++ b/openmeetings-web/src/main/java/org/apache/openmeetings/web/room/video.js
@@ -228,7 +228,7 @@ var Video = (function() {
 		const name = _getName();
 		v.dialog('option', 'title', name).parent().find('.ui-dialog-titlebar').attr('title', name);
 		if (typeof(swf[0].update) === 'function') {
-			c.self ? swf[0].update() : swf[0].update(c);
+			swf[0].update(c);
 		}
 	}
 	function _refresh(_opts) {

-- 
To stop receiving notification emails like this one, please contact
solomax@apache.org.