Author: solomax
Date: Tue May 29 03:16:44 2012
New Revision: 1343460

URL: http://svn.apache.org/viewvc?rev=1343460&view=rev
Log:
Accidentally commited files are reverted

Modified:
    incubator/openmeetings/trunk/singlewebapp/.classpath
    
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
    incubator/openmeetings/trunk/singlewebapp/src/META-INF/mysql_persistence.xml
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/conference/session/RoomClient.java
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/CoreScreenShare.java
    
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/ScreenSharerFrame.java

Modified: incubator/openmeetings/trunk/singlewebapp/.classpath
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/.classpath?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- incubator/openmeetings/trunk/singlewebapp/.classpath (original)
+++ incubator/openmeetings/trunk/singlewebapp/.classpath Tue May 29 03:16:44 
2012
@@ -22,7 +22,7 @@
        <classpathentry kind="lib" 
path="build/lib/om/geronimo-ws-metadata_2.0_spec-jar-1.1.2.jar"/>
        <classpathentry kind="lib" path="build/lib/om/ical4j-bundle-1.0.3.jar"/>
        <classpathentry kind="lib" path="build/lib/om/jaxen-jar-1.1.1.jar"/>
-       <classpathentry kind="lib" path="build/lib/om/openjpa-bundle-2.2.0.jar" 
sourcepath="C:/Users/swagner/.m2/repository/org/apache/openjpa/openjpa/2.2.0/openjpa-2.2.0-sources.jar"/>
+       <classpathentry kind="lib" 
path="build/lib/om/openjpa-bundle-2.2.0.jar"/>
        <classpathentry kind="lib" path="build/lib/om/stax-api-jar-1.0-2.jar"/>
        <classpathentry kind="lib" path="build/lib/om/wsdl4j-jar-1.6.2.jar"/>
        <classpathentry kind="lib" path="build/lib/om/xalan-jar-2.7.0.jar"/>
@@ -114,7 +114,7 @@
        <classpathentry kind="lib" 
path="build/lib/dtd-generator/trang-jar-20091111.jar"/>
        <classpathentry kind="lib" 
path="build/lib/om/axis2-kernel-jar-1.7.0-SNAPSHOT.jar"/>
        <classpathentry kind="lib" 
path="build/red5/dist/commons-cli-jar-1.2.jar"/>
-       <classpathentry kind="lib" 
path="build/lib/mainlibs/red5-client-jar-1.0-RC2.jar" 
sourcepath="D:/mm_src/svn/red5-client/src"/>
+       <classpathentry kind="lib" 
path="build/lib/mainlibs/red5-client-jar-1.0-RC2.jar"/>
        <classpathentry kind="lib" 
path="build/lib/mainlibs/cglib-jar-2.2.2.jar"/>
        <classpathentry kind="lib" 
path="build/lib/mainlibs/commons-fileupload-jar-1.2.2.jar"/>
        <classpathentry kind="lib" 
path="build/lib/mainlibs/commons-io-jar-2.1.jar"/>

Modified: 
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/WebContent/WEB-INF/openmeetings-applicationContext.xml
 Tue May 29 03:16:44 2012
@@ -70,7 +70,6 @@
        <bean id="chatservice.service" 
class="org.openmeetings.app.remote.ChatService" />
        <bean id="calendarservice.service" 
class="org.openmeetings.app.remote.CalendarService" />
        <bean id="flvrecorderservice.service" 
class="org.openmeetings.app.remote.FLVRecorderService" />
-       <bean id="streamPublishingService" 
class="org.openmeetings.app.remote.StreamPublishingService" />
        <bean id="openmeetings.FlvRecorderConverterTask"
                
class="org.openmeetings.app.data.flvrecord.converter.FlvRecorderConverterTask" 
/>
        <bean id="openmeetings.FlvInterviewConverterTask"

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/META-INF/mysql_persistence.xml
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/META-INF/mysql_persistence.xml?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/META-INF/mysql_persistence.xml 
(original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/META-INF/mysql_persistence.xml 
Tue May 29 03:16:44 2012
@@ -75,7 +75,7 @@
             <property name="openjpa.ConnectionDriverName" 
value="org.apache.commons.dbcp.BasicDataSource" />
                        <property name="openjpa.ConnectionProperties"
                                value="DriverClassName=com.mysql.jdbc.Driver
-                                       , 
Url=jdbc:mysql://192.168.72.105:3306/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8&amp;connectionCollation=utf8_general_ci&amp;cachePrepStmts=true&amp;cacheCallableStatements=true&amp;cacheServerConfiguration=true&amp;useLocalSessionState=true&amp;elideSetAutoCommits=true&amp;alwaysSendSetIsolation=false&amp;enableQueryTimeouts=false&amp;prepStmtCacheSize=3000&amp;prepStmtCacheSqlLimit=1000
+                                       , 
Url=jdbc:mysql://localhost:3306/openmeetings?autoReconnect=true&amp;useUnicode=true&amp;createDatabaseIfNotExist=true&amp;characterEncoding=utf-8&amp;connectionCollation=utf8_general_ci&amp;cachePrepStmts=true&amp;cacheCallableStatements=true&amp;cacheServerConfiguration=true&amp;useLocalSessionState=true&amp;elideSetAutoCommits=true&amp;alwaysSendSetIsolation=false&amp;enableQueryTimeouts=false&amp;prepStmtCacheSize=3000&amp;prepStmtCacheSqlLimit=1000
                                        , MaxActive=100
                                        , MaxWait=10000
                                        , TestOnBorrow=true
@@ -89,6 +89,6 @@
                        <property name="openjpa.QueryCache" value="false"/>
                        <property name="openjpa.jdbc.DBDictionary"  
value="batchLimit=100,tableType=myisam"/> 
                        <property name="openjpa.jdbc.QuerySQLCache"  
value="false"/> 
-               </properties>
+               </properties>
        </persistence-unit>
 </persistence>

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/conference/session/RoomClient.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/conference/session/RoomClient.java?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/conference/session/RoomClient.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/conference/session/RoomClient.java
 Tue May 29 03:16:44 2012
@@ -163,7 +163,6 @@ public class RoomClient implements Seria
        boolean startRecording = false;
        boolean startStreaming = false;
        private boolean screenPublishStarted = false;
-       private boolean streamPublishStarted = false;
        
        /*
         * Indicates if this User is broadcasting his stream at all
@@ -594,14 +593,6 @@ public class RoomClient implements Seria
                this.isAVClient = isAVClient;
        }
 
-       public boolean isStreamPublishStarted() {
-               return streamPublishStarted;
-       }
-
-       public void setStreamPublishStarted(boolean streamPublishStarted) {
-               this.streamPublishStarted = streamPublishStarted;
-       }
-
        /**
         * To improve our trace log
         */

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/app/remote/red5/ScopeApplicationAdapter.java
 Tue May 29 03:16:44 2012
@@ -49,23 +49,31 @@ import org.openmeetings.app.persistence.
 import org.openmeetings.app.persistence.beans.rooms.Rooms;
 import org.openmeetings.app.persistence.beans.user.Users;
 import org.openmeetings.app.remote.FLVRecorderService;
-import org.openmeetings.app.remote.StreamPublishingService;
 import org.openmeetings.app.remote.WhiteBoardService;
 import org.openmeetings.utils.math.CalendarPatterns;
+import org.red5.client.net.rtmp.ClientExceptionHandler;
 import org.red5.logging.Red5LoggerFactory;
-import org.red5.server.adapter.MultiThreadedApplicationAdapter;
+import org.red5.server.adapter.ApplicationAdapter;
 import org.red5.server.api.IClient;
 import org.red5.server.api.IConnection;
 import org.red5.server.api.Red5;
+import org.red5.server.api.scope.IBasicScope;
+import org.red5.server.api.scope.IBroadcastScope;
 import org.red5.server.api.scope.IScope;
+import org.red5.server.api.scope.ScopeType;
 import org.red5.server.api.service.IPendingServiceCall;
 import org.red5.server.api.service.IPendingServiceCallback;
 import org.red5.server.api.service.IServiceCapableConnection;
 import org.red5.server.api.stream.IBroadcastStream;
+import org.red5.server.api.stream.IStreamListener;
+import org.red5.server.api.stream.IStreamPacket;
+import org.red5.server.net.rtmp.event.IRTMPEvent;
+import org.red5.server.stream.StreamingProxy;
+import org.red5.server.stream.message.RTMPMessage;
 import org.slf4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
 
-public class ScopeApplicationAdapter extends MultiThreadedApplicationAdapter 
implements
+public class ScopeApplicationAdapter extends ApplicationAdapter implements
                IPendingServiceCallback {
 
        private static final Logger log = Red5LoggerFactory.getLogger(
@@ -96,9 +104,8 @@ public class ScopeApplicationAdapter ext
        private UsersDaoImpl usersDao;
        @Autowired
        private MeetingMemberDaoImpl meetingMemberDao;
-       @Autowired
-       private StreamPublishingService streamPublishingService;
 
+    private Map<String, StreamingProxy> streamingProxyMap = new 
HashMap<String, StreamingProxy>();
        // This is the Folder where all executables are written
        // for windows platform
        public static String batchFileDir = "webapps" + File.separatorChar + 
"ROOT"
@@ -262,7 +269,7 @@ public class ScopeApplicationAdapter ext
                                                        
currentClient.getStreamid(), currentClient);
                                }
                                if 
(Boolean.valueOf(map.get("stopPublishing").toString())) {
-                                       
streamPublishingService.streamPublishingStop(this);
+                                       streamPublishingStop();
                                        if (currentClient.getIsScreenClient() 
&& currentClient.isStartStreaming()) {
                                                returnMap.put("result", 
"stopPublishingOnly");
                                        }
@@ -407,9 +414,7 @@ public class ScopeApplicationAdapter ext
 
                                        
flvRecorderService.recordMeetingStream(recordingName, "", false);
                                } else if 
(Boolean.valueOf(map.get("startPublishing").toString())) {
-                                       if 
(streamPublishingService.streamPublishingStart(
-                                               this
-                                               , "" + map.get("publishingHost")
+                                       if (streamPublishingStart("" + 
map.get("publishingHost")
                                                , "" + map.get("publishingApp")
                                                , "" + map.get("publishingId")))
                                        {
@@ -795,6 +800,78 @@ public class ScopeApplicationAdapter ext
                }
        }
 
+       public IBroadcastScope getBroadcastScope(IScope scope, String name) {
+               IBasicScope basicScope = 
scope.getBasicScope(ScopeType.BROADCAST, name);
+               if (!(basicScope instanceof IBroadcastScope)) {
+                       return null;
+               } else {
+                       return (IBroadcastScope) basicScope;
+               }
+       }
+
+    public boolean streamPublishingStart(String host, String app, String id) {
+       final boolean[] result = {true};
+               final IConnection conn = Red5.getConnectionLocal();
+               RoomClient rc = 
clientListManager.getClientByStreamId(conn.getClient().getId());
+               String publishName = rc.getStreamPublishName();
+               
+               if (rc.getIsScreenClient() && rc.isStartStreaming()) {
+               IScope scope = conn.getScope();
+               IBroadcastStream stream = getBroadcastStream(scope, 
publishName);
+               IBroadcastScope bsScope = getBroadcastScope(scope, publishName);
+               final StreamingProxy proxy = new StreamingProxy();
+               proxy.setHost(host);
+               proxy.setApp(app);
+               proxy.setPort(1935);
+               proxy.init();
+               proxy.setExceptionHandler(new ClientExceptionHandler() {
+                               public void handleException(Throwable 
throwable) {
+                                       result[0] = false;
+                                       HashMap<String, Object> params = new 
HashMap<String, Object>();
+                                       params.put("stopPublishing", true);
+                                       params.put("error", 
throwable.getMessage());
+                                       
((IServiceCapableConnection)conn).invoke(
+                                               "screenSharerAction"
+                                               , new Object[] { params }
+                                               , ScopeApplicationAdapter.this);
+                               }
+                       });
+               bsScope.subscribe(proxy, null);
+               proxy.start(id, "live", null);
+               streamingProxyMap.put(publishName, proxy);
+               stream.addStreamListener(new IStreamListener() {
+                               public void packetReceived(IBroadcastStream 
stream, IStreamPacket packet) {
+                                       try {
+                                               RTMPMessage m = 
RTMPMessage.build((IRTMPEvent)packet, packet.getTimestamp());
+                                       proxy.pushMessage(null, m);
+                                       } catch (Exception e) {
+                                               log.error("Exception while 
sending proxy message", e);
+                                       }
+                               }
+                       });
+               }
+               return result[0];
+    }
+    
+    public void streamPublishingStop() {
+               IConnection current = Red5.getConnectionLocal();
+               RoomClient rc = 
clientListManager.getClientByStreamId(current.getClient().getId());
+               String publishName = rc.getStreamPublishName();
+               
+               if (rc.getIsScreenClient() && publishName != null) {
+               IScope scope = current.getScope();
+               IBroadcastStream stream = getBroadcastStream(scope, 
publishName);
+                       StreamingProxy proxy = 
streamingProxyMap.remove(publishName);
+                       if (proxy != null) {
+                               proxy.stop();
+                               IBroadcastScope bsScope = 
getBroadcastScope(scope, stream.getPublishedName());
+                               if (bsScope != null) {
+                                       bsScope.unsubscribe(proxy);
+                               }
+                       }
+               }
+    }
+    
        /**
         * This method handles the Event after a stream has been removed all
         * connected Clients in the same room will get a notification
@@ -809,7 +886,7 @@ public class ScopeApplicationAdapter ext
                log.debug("start streamBroadcastClose broadcast close: "
                                + stream.getPublishedName());
                try {
-                       streamPublishingService.streamPublishingStop(this);
+                       streamPublishingStop();
                        
                        IConnection current = Red5.getConnectionLocal();
                        RoomClient rcl = 
clientListManager.getClientByStreamId(current.getClient().getId());

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/CoreScreenShare.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/CoreScreenShare.java?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/CoreScreenShare.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/CoreScreenShare.java
 Tue May 29 03:16:44 2012
@@ -166,7 +166,6 @@ public class CoreScreenShare {
                        });
                        frame.setVisible(true);
                        frame.setRecordingTabEnabled(allowRecording);
-                       frame.setPublishingTabEnabled(allowRecording);
 
                        logger.debug("initialized");
 

Modified: 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/ScreenSharerFrame.java
URL: 
http://svn.apache.org/viewvc/incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/ScreenSharerFrame.java?rev=1343460&r1=1343459&r2=1343460&view=diff
==============================================================================
--- 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/ScreenSharerFrame.java
 (original)
+++ 
incubator/openmeetings/trunk/singlewebapp/src/org/openmeetings/screen/webstart/gui/ScreenSharerFrame.java
 Tue May 29 03:16:44 2012
@@ -524,7 +524,7 @@ public class ScreenSharerFrame extends J
                                BorderFactory.createEmptyBorder(0, 5, 0, 0)));
                panelStatus.add(lblStatus);
                
-               //setPublishingTabEnabled(false);
+               setPublishingTabEnabled(false);
                contentPane.setLayout(gl_contentPane);
                
                // Background Image


Reply via email to