Author: solomax
Date: Tue Jan 20 10:42:12 2015
New Revision: 1653220
URL: http://svn.apache.org/r1653220
Log:
RTMPT screen client was tested
Modified:
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
Modified:
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
URL:
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
(original)
+++
openmeetings/branches/3.0.x/src/main/java/org/apache/openmeetings/remote/red5/ScopeApplicationAdapter.java
Tue Jan 20 10:42:12 2015
@@ -1812,11 +1812,13 @@ public class ScopeApplicationAdapter ext
* @param sendScreen send to the current client as well
*/
public void syncMessageToCurrentScope(final String remoteMethodName,
final Object newMessage, final boolean sendSelf, final boolean sendScreen) {
- try {
- final IConnection current = Red5.getConnectionLocal();
+ final IConnection current = Red5.getConnectionLocal();
- new Thread(new Runnable() {
- public void run() {
+ new Thread() {
+ @Override
+ public void run() {
+ try {
+ // Send to all Clients of that
Scope(Room)
for (IConnection conn :
current.getScope().getClientConnections()) {
if (conn != null && conn
instanceof IServiceCapableConnection) {
IClient client =
conn.getClient();
@@ -1833,12 +1835,11 @@ public class ScopeApplicationAdapter ext
((IServiceCapableConnection) conn).invoke(remoteMethodName, new Object[] {
newMessage }, ScopeApplicationAdapter.this);
}
}
- }
- }).start();
- // Send to all Clients of that Scope(Room)
- } catch (Exception err) {
- log.error("[syncMessageToCurrentScope]", err);
- }
+ } catch (Exception err) {
+ log.error("[syncMessageToCurrentScope
-> {}, {}] {}", remoteMethodName, newMessage, err);
+ }
+ }
+ }.start();
}
/**
Modified:
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
URL:
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
(original)
+++
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
Tue Jan 20 10:42:12 2015
@@ -137,9 +137,6 @@ final class CaptureScreen extends Thread
if (sendCursor) {
cursorScheduler.scheduleWithFixedDelay(new
Runnable() {
public void run() {
- if (Red5.getConnectionLocal()
== null) {
-
Red5.setConnectionLocal(client.getConnection());
- }
core.sendCursorStatus();
}
}, 0, timeBetweenFrames * NANO_MULTIPLIER,
TimeUnit.NANOSECONDS);
Modified:
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
URL:
http://svn.apache.org/viewvc/openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
(original)
+++
openmeetings/branches/3.0.x/src/screenshare/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
Tue Jan 20 10:42:12 2015
@@ -44,6 +44,7 @@ import org.apache.commons.codec.binary.H
import org.apache.openmeetings.screen.webstart.gui.ScreenSharerFrame;
import org.red5.client.net.rtmp.INetStreamEventHandler;
import org.red5.io.utils.ObjectMap;
+import org.red5.server.api.Red5;
import org.red5.server.api.event.IEvent;
import org.red5.server.api.service.IPendingServiceCall;
import org.red5.server.api.service.IPendingServiceCallback;
@@ -204,6 +205,9 @@ public class CoreScreenShare implements
cursorPosition.put("cursor_y", y);
if (instance.getConnection() != null) {
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("setNewCursorPosition", new
Object[] { cursorPosition }, this);
}
} catch (NullPointerException npe) {
@@ -238,6 +242,9 @@ public class CoreScreenShare implements
map.put("user_id", user_id);
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("setConnectionAsSharingClient", new
Object[] { map }, this);
} catch (Exception err) {
frame.setStatus("Error: " + err.getLocalizedMessage());
@@ -298,6 +305,9 @@ public class CoreScreenShare implements
Map<String, Object> map = new HashMap<String, Object>();
map.put(action, true);
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("screenSharerAction", new Object[] {
map }, this);
} catch (Exception err) {
log.error("captureScreenStop Exception: ", err);
Modified:
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-core/src/main/java/org/apache/openmeetings/core/remote/red5/ScopeApplicationAdapter.java
Tue Jan 20 10:42:12 2015
@@ -111,12 +111,12 @@ public class ScopeApplicationAdapter ext
private static AtomicLong broadCastCounter = new AtomicLong(0);
- public synchronized void resultReceived(IPendingServiceCall arg0) {
+ public void resultReceived(IPendingServiceCall arg0) {
// TODO Auto-generated method stub
}
@Override
- public synchronized boolean appStart(IScope scope) {
+ public boolean appStart(IScope scope) {
try {
OmFileHelper.setOmHome(scope.getResource("/").getFile());
@@ -482,7 +482,7 @@ public class ScopeApplicationAdapter ext
* Exit Room by Application
*
*/
- public synchronized void logicalRoomLeave() {
+ public void logicalRoomLeave() {
log.debug("logicalRoomLeave ");
try {
IConnection current = Red5.getConnectionLocal();
@@ -508,7 +508,7 @@ public class ScopeApplicationAdapter ext
* @param currentClient
* @param currentScope
*/
- public synchronized void roomLeaveByScope(Client currentClient, IScope
currentScope, boolean removeUserFromSessionList) {
+ public void roomLeaveByScope(Client currentClient, IScope currentScope,
boolean removeUserFromSessionList) {
try {
log.debug("currentClient " + currentClient);
Long room_id = currentClient.getRoom_id();
@@ -616,7 +616,7 @@ public class ScopeApplicationAdapter ext
* @see
org.red5.server.adapter.MultiThreadedApplicationAdapter#streamPublishStart(org.red5.server.api.stream.IBroadcastStream)
*/
@Override
- public synchronized void streamPublishStart(IBroadcastStream stream) {
+ public void streamPublishStart(IBroadcastStream stream) {
try {
log.debug("----------- streamPublishStart");
IConnection current = Red5.getConnectionLocal();
@@ -711,7 +711,7 @@ public class ScopeApplicationAdapter ext
* @see
org.red5.server.adapter.MultiThreadedApplicationAdapter#streamBroadcastClose(org.red5.server.api.stream.IBroadcastStream)
*/
@Override
- public synchronized void streamBroadcastClose(IBroadcastStream stream) {
+ public void streamBroadcastClose(IBroadcastStream stream) {
// Notify all the clients that the stream had been closed
log.debug("start streamBroadcastClose broadcast close: " +
stream.getPublishedName());
@@ -846,31 +846,13 @@ public class ScopeApplicationAdapter ext
Map cursor = (Map) item;
cursor.put("streamPublishName",
currentClient.getStreamPublishName());
- // Notify all users of the same Scope
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- if (conn instanceof
IServiceCapableConnection) {
- IClient client =
conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen sharing
clients do not receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or
potential AVClients do not receive events
- continue;
- } if
(client.getId().equals(current.getClient().getId())) {
- // don't send back to
same user
- continue;
- }
- ((IServiceCapableConnection)
conn).invoke("newRed5ScreenCursor", new Object[] { cursor }, this);
- }
- }
- }
+ syncMessageToCurrentScope("newRed5ScreenCursor", cursor,
true, false);
} catch (Exception err) {
log.error("[setNewCursorPosition]", err);
}
}
- public synchronized Long removeModerator(String publicSID) {
+ public Long removeModerator(String publicSID) {
try {
log.debug("----------- removeModerator: " + publicSID);
@@ -890,34 +872,17 @@ public class ScopeApplicationAdapter ext
List<Client> currentMods =
sessionManager.getCurrentModeratorByRoom(room_id);
- // Notify all clients of the same scope (room)
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- if (conn instanceof
IServiceCapableConnection) {
- IClient client =
conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen sharing
clients do not receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or
potential AVClients do not receive events
- continue;
- }
- ((IServiceCapableConnection)
conn).invoke("setNewModeratorByList", new Object[] { currentMods }, this);
- }
- }
- }
+ syncMessageToCurrentScope("setNewModeratorByList",
currentMods, true);
} catch (Exception err) {
log.error("[addModerator]", err);
}
return -1L;
}
- public synchronized Long setBroadCastingFlag(String publicSID, boolean
value, Integer interviewPodId) {
+ public Long setBroadCastingFlag(String publicSID, boolean value,
Integer interviewPodId) {
try {
log.debug("----------- setBroadCastingFlag: " +
publicSID);
- IConnection current = Red5.getConnectionLocal();
- // String streamid = current.getClient().getId();
Client currentClient =
sessionManager.getClientByPublicSID(publicSID, false, null);
@@ -932,22 +897,7 @@ public class ScopeApplicationAdapter ext
sessionManager.updateClientByStreamId(currentClient.getStreamid(),
currentClient, false, null);
// Notify all clients of the same scope (room)
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- if (conn instanceof
IServiceCapableConnection) {
- IClient client =
conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen sharing
clients do not receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or
potential AVClients do not receive events
- continue;
- }
-
- ((IServiceCapableConnection)
conn).invoke("setNewBroadCastingFlag", new Object[] { currentClient }, this);
- }
- }
- }
+ syncMessageToCurrentScope("setNewBroadCastingFlag",
currentClient, true);
} catch (Exception err) {
log.error("[setBroadCastingFlag]", err);
}
@@ -1108,7 +1058,7 @@ public class ScopeApplicationAdapter ext
* @param interviewPodId
* @return RoomClient being updated in case of no errors, null otherwise
*/
- public synchronized Client setUserAVSettings(String avsettings,
+ public Client setUserAVSettings(String avsettings,
Object newMessage, Integer vWidth, Integer vHeight,
long room_id, String publicSID, Integer interviewPodId)
{
try {
@@ -1135,21 +1085,7 @@ public class ScopeApplicationAdapter ext
hsm.put("client", currentClient);
hsm.put("message", newMessage);
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- if (conn instanceof
IServiceCapableConnection) {
- IClient client =
conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen sharing
clients do not receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or
potential AVClients do not receive events
- continue;
- }
-
((IServiceCapableConnection)conn).invoke("sendVarsToMessageWithClient", new
Object[] { hsm }, this);
- }
- }
- }
+
syncMessageToCurrentScope("sendVarsToMessageWithClient", hsm, true);
return currentClient;
} catch (Exception err) {
log.error("[setUserAVSettings]", err);
@@ -1720,12 +1656,11 @@ public class ScopeApplicationAdapter ext
}
}
- public synchronized int sendVarsModeratorGeneral(Object vars) {
+ public int sendVarsModeratorGeneral(Object vars) {
log.debug("*..*sendVars: " + vars);
try {
IConnection current = Red5.getConnectionLocal();
- Client currentClient = this.sessionManager
-
.getClientByStreamId(current.getClient().getId(), null);
+ Client currentClient =
sessionManager.getClientByStreamId(current.getClient().getId(), null);
// Long room_id = currentClient.getRoom_id();
log.debug("***** id: " + currentClient.getStreamid());
@@ -1735,24 +1670,7 @@ public class ScopeApplicationAdapter ext
if (ismod) {
log.debug("CurrentScope :" +
current.getScope().getName());
// Send to all Clients of the same Scope
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- if (conn instanceof
IServiceCapableConnection) {
- IClient client =
conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen
sharing clients do not receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or
potential AVClients do not receive events
- continue;
- } if
(client.getId().equals(current.getClient().getId())) {
- // don't send
back to same user
- continue;
- }
-
((IServiceCapableConnection) conn).invoke("sendVarsToModeratorGeneral", new
Object[] { vars },this);
- }
- }
- }
+
syncMessageToCurrentScope("sendVarsToModeratorGeneral", vars, false);
return 1;
} else {
// log.debug("*..*you are not allowed to send:
"+ismod);
@@ -1881,11 +1799,13 @@ public class ScopeApplicationAdapter ext
* @param sendScreen send to the current client as well
*/
public void syncMessageToCurrentScope(final String remoteMethodName,
final Object newMessage, final boolean sendSelf, final boolean sendScreen) {
- try {
- final IConnection current = Red5.getConnectionLocal();
+ final IConnection current = Red5.getConnectionLocal();
- new Thread(new Runnable() {
- public void run() {
+ new Thread() {
+ @Override
+ public void run() {
+ try {
+ // Send to all Clients of that
Scope(Room)
for (IConnection conn :
current.getScope().getClientConnections()) {
if (conn != null && conn
instanceof IServiceCapableConnection) {
IClient client =
conn.getClient();
@@ -1902,12 +1822,11 @@ public class ScopeApplicationAdapter ext
((IServiceCapableConnection) conn).invoke(remoteMethodName, new Object[] {
newMessage }, ScopeApplicationAdapter.this);
}
}
- }
- }).start();
- // Send to all Clients of that Scope(Room)
- } catch (Exception err) {
- log.error("[syncMessageToCurrentScope]", err);
- }
+ } catch (Exception err) {
+ log.error("[syncMessageToCurrentScope
-> {}, {}] {}", remoteMethodName, newMessage, err);
+ }
+ }
+ }.start();
}
/**
@@ -2445,7 +2364,7 @@ public class ScopeApplicationAdapter ext
return null;
}
- public synchronized void setSipTransport(Long room_id, String
publicSID, String broadCastId) {
+ public void setSipTransport(Long room_id, String publicSID, String
broadCastId) {
log.debug("----------- setSipTransport");
IConnection current = Red5.getConnectionLocal();
IClient c = current.getClient();
@@ -2466,26 +2385,6 @@ public class ScopeApplicationAdapter ext
sessionManager.updateClientByStreamId(streamid, currentClient,
false, null);
SessionVariablesUtil.initClient(c, false, publicSID);
- for (IConnection conn :
current.getScope().getClientConnections()) {
- if (conn != null) {
- IClient client = conn.getClient();
- if
(SessionVariablesUtil.isScreenClient(client)) {
- // screen sharing clients do not
receive events
- continue;
- } else if
(SessionVariablesUtil.isAVClient(client)) {
- // AVClients or potential AVClients do
not receive events
- continue;
- }
-
- if (!client.getId().equals(streamid)) {
- // It is not needed to send back that
event to the actual Moderator
- // as it will be already triggered in
the result of this Function in the Client
- if (conn instanceof
IServiceCapableConnection) {
- ((IServiceCapableConnection)
conn).invoke("addNewUser", new Object[] { currentClient }, this);
- log.debug("sending
setSipTransport to " + conn);
- }
- }
- }
- }
+ syncMessageToCurrentScope("addNewUser", currentClient, false);
}
}
Modified:
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CaptureScreen.java
Tue Jan 20 10:42:12 2015
@@ -137,9 +137,6 @@ final class CaptureScreen extends Thread
if (sendCursor) {
cursorScheduler.scheduleWithFixedDelay(new
Runnable() {
public void run() {
- if (Red5.getConnectionLocal()
== null) {
-
Red5.setConnectionLocal(client.getConnection());
- }
core.sendCursorStatus();
}
}, 0, timeBetweenFrames * NANO_MULTIPLIER,
TimeUnit.NANOSECONDS);
Modified:
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
URL:
http://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java?rev=1653220&r1=1653219&r2=1653220&view=diff
==============================================================================
---
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
(original)
+++
openmeetings/trunk/singlewebapp/openmeetings-screenshare/src/main/java/org/apache/openmeetings/screen/webstart/CoreScreenShare.java
Tue Jan 20 10:42:12 2015
@@ -44,6 +44,7 @@ import org.apache.commons.codec.binary.H
import org.apache.openmeetings.screen.webstart.gui.ScreenSharerFrame;
import org.red5.client.net.rtmp.INetStreamEventHandler;
import org.red5.io.utils.ObjectMap;
+import org.red5.server.api.Red5;
import org.red5.server.api.event.IEvent;
import org.red5.server.api.service.IPendingServiceCall;
import org.red5.server.api.service.IPendingServiceCallback;
@@ -204,6 +205,9 @@ public class CoreScreenShare implements
cursorPosition.put("cursor_y", y);
if (instance.getConnection() != null) {
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("setNewCursorPosition", new
Object[] { cursorPosition }, this);
}
} catch (NullPointerException npe) {
@@ -238,6 +242,9 @@ public class CoreScreenShare implements
map.put("user_id", user_id);
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("setConnectionAsSharingClient", new
Object[] { map }, this);
} catch (Exception err) {
frame.setStatus("Error: " + err.getLocalizedMessage());
@@ -298,6 +305,9 @@ public class CoreScreenShare implements
Map<String, Object> map = new HashMap<String, Object>();
map.put(action, true);
+ if (Red5.getConnectionLocal() == null) {
+
Red5.setConnectionLocal(instance.getConnection());
+ }
instance.invoke("screenSharerAction", new Object[] {
map }, this);
} catch (Exception err) {
log.error("captureScreenStop Exception: ", err);