Author: solomax
Date: Tue May 17 19:16:11 2016
New Revision: 1744308

URL: http://svn.apache.org/viewvc?rev=1744308&view=rev
Log:
[OPENMEETINGS-1403] external camera suport is added

Modified:
    
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
    
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
    
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
    
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1744308&r1=1744307&r2=1744308&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Tue May 17 19:16:11 2016
@@ -81,6 +81,7 @@ import org.springframework.beans.factory
 
 public class ScopeApplicationAdapter extends ApplicationAdapter implements 
IPendingServiceCallback {
        private static final Logger log = 
Red5LoggerFactory.getLogger(ScopeApplicationAdapter.class, webAppRootKey);
+       private static final String SECURITY_CODE_PARAM = "securityCode";
 
        @Autowired
        private ISessionManager sessionManager;
@@ -152,6 +153,14 @@ public class ScopeApplicationAdapter ext
                return true;
        }
 
+       @SuppressWarnings("unchecked")
+       private Map<String, Object> getConnParams(Object[] params) {
+               if (params != null && params.length > 0) {
+                       return (Map<String, Object>)params[0]; 
+               }
+               return new HashMap<>();
+       }
+       
        @Override
        public boolean roomConnect(IConnection conn, Object[] params) {
                log.debug("roomConnect : ");
@@ -166,7 +175,16 @@ public class ScopeApplicationAdapter ext
 
                Map<String, Object> map = conn.getConnectParams();
                String swfURL = map.containsKey("swfUrl") ? 
(String)map.get("swfUrl") : "";
-               String securityCode = params != null && params.length > 0 ? 
(String)params[0] : "";
+               Map<String, Object> connParams = getConnParams(params);
+               String uid = (String)connParams.get("uid");
+               String securityCode = 
(String)connParams.get(SECURITY_CODE_PARAM);
+               if (!Strings.isEmpty(securityCode)) {
+                       //FIXME TODO add better mechanism
+                       Client parent = 
sessionManager.getClientByPublicSID(securityCode, null);
+                       if (parent == null || 
!parent.getScope().equals(conn.getScope().getName())) {
+                               return rejectClient();
+                       }
+               }
 
                Client parentClient = null;
                //TODO add similar code for other connections
@@ -213,7 +231,6 @@ public class ScopeApplicationAdapter ext
                        sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
                }
                if (!Strings.isEmpty(securityCode)) {
-                       //FIXME TODO check if client by code is in this room
                        rcm.setSecurityCode(securityCode);
                        sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
                }
@@ -630,12 +647,6 @@ public class ScopeApplicationAdapter ext
                                sessionManager.updateClientByStreamId(streamid, 
currentClient, false, null);
                        }
                        if (!Strings.isEmpty(currentClient.getSecurityCode())) {
-                               //FIXME TODO add better mechanism
-                               Client parent = 
sessionManager.getClientByPublicSID(currentClient.getSecurityCode(), null);
-                               if (parent == null || 
!parent.getScope().equals(stream.getScope().getName())) {
-                                       rejectClient();
-                                       return;
-                               }
                                
currentClient.setBroadCastID(Long.parseLong(stream.getPublishedName()));
                                currentClient.setIsBroadcasting(true);
                                currentClient.setVWidth(320);
@@ -1491,7 +1502,7 @@ public class ScopeApplicationAdapter ext
                return roomClientList;
        }
 
-       public synchronized List<Client> getCurrentModeratorList() {
+       public List<Client> getCurrentModeratorList() {
                try {
                        IConnection current = Red5.getConnectionLocal();
                        Client currentClient = 
sessionManager.getClientByStreamId(current.getClient().getId(), null);
@@ -2124,7 +2135,7 @@ public class ScopeApplicationAdapter ext
                return null;
        }
 
-    /*
+       /*
         * SIP transport methods
         */
 

Modified: 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx?rev=1744308&r1=1744307&r2=1744308&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 (original)
+++ 
openmeetings/application/branches/3.1.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 Tue May 17 19:16:11 2016
@@ -52,7 +52,7 @@
             
             this._nc.proxyType = canvas.proxyType;
             
-            var ok = this._nc.connect(src == "null" ? null : src, "");
+            var ok = this._nc.connect(src == "null" ? null : src, {uid: ''});
             if (this.debug) {
                if($debug) Debug.write("*** debug ***");
             }

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1744308&r1=1744307&r2=1744308&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Tue May 17 19:16:11 2016
@@ -88,6 +88,7 @@ import org.springframework.beans.factory
 
 public class ScopeApplicationAdapter extends ApplicationAdapter implements 
IPendingServiceCallback {
        private static final Logger log = 
Red5LoggerFactory.getLogger(ScopeApplicationAdapter.class, webAppRootKey);
+       private static final String SECURITY_CODE_PARAM = "securityCode";
 
        @Autowired
        private ISessionManager sessionManager;
@@ -150,6 +151,14 @@ public class ScopeApplicationAdapter ext
                return true;
        }
 
+       @SuppressWarnings("unchecked")
+       private Map<String, Object> getConnParams(Object[] params) {
+               if (params != null && params.length > 0) {
+                       return (Map<String, Object>)params[0]; 
+               }
+               return new HashMap<>();
+       }
+       
        @Override
        public boolean roomConnect(IConnection conn, Object[] params) {
                log.debug("roomConnect : ");
@@ -165,8 +174,19 @@ public class ScopeApplicationAdapter ext
                Map<String, Object> map = conn.getConnectParams();
                String swfURL = map.containsKey("swfUrl") ? 
(String)map.get("swfUrl") : "";
                String tcUrl = map.containsKey("tcUrl") ? 
(String)map.get("tcUrl") : "";
-               String uid = params != null && params.length > 0 ? 
(String)params[0] : "";
-               String securityCode = null;//FIXME TODO should named 
parameter!!!! params != null && params.length > 0 ? (String)params[0] : "";
+               Map<String, Object> connParams = getConnParams(params);
+               String uid = (String)connParams.get("uid");
+               String securityCode = 
(String)connParams.get(SECURITY_CODE_PARAM);
+               if (!Strings.isEmpty(securityCode)) {
+                       //FIXME TODO add better mechanism
+                       Client parent = 
sessionManager.getClientByPublicSID(securityCode, null);
+                       if (parent == null || 
!parent.getScope().equals(conn.getScope().getName())) {
+                               return rejectClient();
+                       }
+               }
+               if (Strings.isEmpty(uid) && Strings.isEmpty(securityCode)) {
+                       return rejectClient();
+               }
 
                Client parentClient = null;
                //TODO add similar code for other connections
@@ -192,6 +212,7 @@ public class ScopeApplicationAdapter ext
                rcm.setSwfurl(swfURL);
                rcm.setTcUrl(tcUrl);
                rcm.setPublicSID(uid);
+               rcm.setSecurityCode(securityCode);
                rcm = 
sessionManager.add(((IApplication)Application.get(OpenmeetingsVariables.wicketApplicationName)).updateClient(rcm),
 null);
                if (rcm == null) {
                        log.warn("Failed to create Client on room connect");
@@ -225,11 +246,6 @@ public class ScopeApplicationAdapter ext
                        log.debug("publishName :: " + 
rcm.getStreamPublishName());
                        sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
                }
-               if (!Strings.isEmpty(securityCode)) {
-                       //FIXME TODO check if client by code is in this room
-                       rcm.setSecurityCode(securityCode);
-                       sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
-               }
 
                // Log the User
                conferenceLogDao.add(ConferenceLog.Type.clientConnect,
@@ -648,12 +664,6 @@ public class ScopeApplicationAdapter ext
                                sessionManager.updateClientByStreamId(streamid, 
currentClient, false, null);
                        }
                        if (!Strings.isEmpty(currentClient.getSecurityCode())) {
-                               //FIXME TODO add better mechanism
-                               Client parent = 
sessionManager.getClientByPublicSID(currentClient.getSecurityCode(), null);
-                               if (parent == null || 
!parent.getScope().equals(stream.getScope().getName())) {
-                                       rejectClient();
-                                       return;
-                               }
                                
currentClient.setBroadCastID(Long.parseLong(stream.getPublishedName()));
                                currentClient.setIsBroadcasting(true);
                                currentClient.setVWidth(320);
@@ -2073,7 +2083,7 @@ public class ScopeApplicationAdapter ext
                }
        }
 
-    /*
+       /*
         * SIP transport methods
         */
 

Modified: 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
URL: 
http://svn.apache.org/viewvc/openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx?rev=1744308&r1=1744307&r2=1744308&view=diff
==============================================================================
--- 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 (original)
+++ 
openmeetings/application/branches/3.2.x/openmeetings-flash/src/main/swf/base/remote/rtmpConnection.lzx
 Tue May 17 19:16:11 2016
@@ -52,7 +52,7 @@
             
             this._nc.proxyType = canvas.proxyType;
             
-            var ok = this._nc.connect(src == "null" ? null : src, 
canvas.publicSID);
+            var ok = this._nc.connect(src == "null" ? null : src, {uid: 
canvas.publicSID});
             if (this.debug) {
                if($debug) Debug.write("*** debug ***");
             }

Modified: 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1744308&r1=1744307&r2=1744308&view=diff
==============================================================================
--- 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
openmeetings/application/trunk/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
 Tue May 17 19:16:11 2016
@@ -88,6 +88,7 @@ import org.springframework.beans.factory
 
 public class ScopeApplicationAdapter extends ApplicationAdapter implements 
IPendingServiceCallback {
        private static final Logger log = 
Red5LoggerFactory.getLogger(ScopeApplicationAdapter.class, webAppRootKey);
+       private static final String SECURITY_CODE_PARAM = "securityCode";
 
        @Autowired
        private ISessionManager sessionManager;
@@ -150,6 +151,14 @@ public class ScopeApplicationAdapter ext
                return true;
        }
 
+       @SuppressWarnings("unchecked")
+       private Map<String, Object> getConnParams(Object[] params) {
+               if (params != null && params.length > 0) {
+                       return (Map<String, Object>)params[0]; 
+               }
+               return new HashMap<>();
+       }
+       
        @Override
        public boolean roomConnect(IConnection conn, Object[] params) {
                log.debug("roomConnect : ");
@@ -165,8 +174,19 @@ public class ScopeApplicationAdapter ext
                Map<String, Object> map = conn.getConnectParams();
                String swfURL = map.containsKey("swfUrl") ? 
(String)map.get("swfUrl") : "";
                String tcUrl = map.containsKey("tcUrl") ? 
(String)map.get("tcUrl") : "";
-               String uid = params != null && params.length > 0 ? 
(String)params[0] : "";
-               String securityCode = null;//FIXME TODO should named 
parameter!!!! params != null && params.length > 0 ? (String)params[0] : "";
+               Map<String, Object> connParams = getConnParams(params);
+               String uid = (String)connParams.get("uid");
+               String securityCode = 
(String)connParams.get(SECURITY_CODE_PARAM);
+               if (!Strings.isEmpty(securityCode)) {
+                       //FIXME TODO add better mechanism
+                       Client parent = 
sessionManager.getClientByPublicSID(securityCode, null);
+                       if (parent == null || 
!parent.getScope().equals(conn.getScope().getName())) {
+                               return rejectClient();
+                       }
+               }
+               if (Strings.isEmpty(uid) && Strings.isEmpty(securityCode)) {
+                       return rejectClient();
+               }
 
                Client parentClient = null;
                //TODO add similar code for other connections
@@ -192,6 +212,7 @@ public class ScopeApplicationAdapter ext
                rcm.setSwfurl(swfURL);
                rcm.setTcUrl(tcUrl);
                rcm.setPublicSID(uid);
+               rcm.setSecurityCode(securityCode);
                rcm = 
sessionManager.add(((IApplication)Application.get(OpenmeetingsVariables.wicketApplicationName)).updateClient(rcm),
 null);
                if (rcm == null) {
                        log.warn("Failed to create Client on room connect");
@@ -225,11 +246,6 @@ public class ScopeApplicationAdapter ext
                        log.debug("publishName :: " + 
rcm.getStreamPublishName());
                        sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
                }
-               if (!Strings.isEmpty(securityCode)) {
-                       //FIXME TODO check if client by code is in this room
-                       rcm.setSecurityCode(securityCode);
-                       sessionManager.updateClientByStreamId(streamId, rcm, 
false, null);
-               }
 
                // Log the User
                conferenceLogDao.add(ConferenceLog.Type.clientConnect,
@@ -648,12 +664,6 @@ public class ScopeApplicationAdapter ext
                                sessionManager.updateClientByStreamId(streamid, 
currentClient, false, null);
                        }
                        if (!Strings.isEmpty(currentClient.getSecurityCode())) {
-                               //FIXME TODO add better mechanism
-                               Client parent = 
sessionManager.getClientByPublicSID(currentClient.getSecurityCode(), null);
-                               if (parent == null || 
!parent.getScope().equals(stream.getScope().getName())) {
-                                       rejectClient();
-                                       return;
-                               }
                                
currentClient.setBroadCastID(Long.parseLong(stream.getPublishedName()));
                                currentClient.setIsBroadcasting(true);
                                currentClient.setVWidth(320);
@@ -2073,7 +2083,7 @@ public class ScopeApplicationAdapter ext
                }
        }
 
-    /*
+       /*
         * SIP transport methods
         */
 


Reply via email to