|
Loading...
|
openmeetings-dev@googlegroups.com
[Prev] Thread [Next] | [Prev] Date [Next]
[openmeetings-dev] [openmeetings commit] r2132 - Starting Sharing Session codesite-noreply Tue Jun 30 08:00:20 2009
Author: [EMAIL PROTECTED]
Date: Tue Jun 30 06:25:51 2009
New Revision: 2132
Modified:
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPScreenSharingSession.java
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPStreamingHandler.java
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/RTPMethodServlet.java
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/ScreenRequestHandler.java
trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/Main.java
trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/ServletFunctions.java
Log:
Starting Sharing Session
Modified:
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPScreenSharingSession.java
==============================================================================
---
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPScreenSharingSession.java
(original)
+++
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPScreenSharingSession.java
Tue Jun 30 06:25:51 2009
@@ -98,7 +98,4 @@
this.jpegQuality = jpegQuality;
}
-
-
-
}
Modified:
trunk/webapp/src/app/org/openmeetings/app/rtp/RTPStreamingHandler.java
==============================================================================
--- trunk/webapp/src/app/org/openmeetings/app/rtp/RTPStreamingHandler.java
(original)
+++ trunk/webapp/src/app/org/openmeetings/app/rtp/RTPStreamingHandler.java
Tue Jun 30 06:25:51 2009
@@ -7,6 +7,8 @@
import org.openmeetings.app.data.conference.Roommanagement;
import org.openmeetings.app.data.user.Usermanagement;
import org.openmeetings.app.hibernate.beans.rooms.Rooms;
+import org.openmeetings.app.hibernate.beans.user.Users;
+import org.openmeetings.app.remote.red5.ScopeApplicationAdapter;
import org.openmeetings.servlet.outputhandler.ScreenRequestHandler;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
@@ -86,10 +88,69 @@
if(myRoom == null)
throw new Exception("no room available for ID "
+ room);
- if(!rtpSessions.containsKey(myRoom))
- throw new Exception("no RTPSession available
for Room " + room);
+
+ Iterator<Rooms> miter = rtpSessions.keySet().iterator();
+
+ RTPScreenSharingSession session = null;
+
+ while(miter.hasNext()){
+ Rooms rooms = miter.next();
+
+ System.out.println("Rooms id in Cache : " +
rooms.getRooms_id());
+
+ if(rooms.getRooms_id().intValue() ==
myRoom.getRooms_id().intValue()){
+ session = rtpSessions.get(rooms);
+
+ if(session == null)
+ log.error("No Session for ID "
+ myRoom.getRooms_id());
+ }
+ else
+ log.debug("not equal ");
+ }
+
+
+ if(session == null)
+ throw new Exception("no RTPSession for Room " +
room);
+
+ return session;
+ }
+
//---------------------------------------------------------------------------------------------
- return rtpSessions.get(myRoom);
+
+ /**
+ * Store Session for Room
+ */
+
//---------------------------------------------------------------------------------------------
+ public static RTPScreenSharingSession
storeSessionForRoom(String room,
Long sharing_user_id) throws Exception{
+ log.debug("storeSessionForRoom : " + room);
+
+ RTPScreenSharingSession session = new
RTPScreenSharingSession();
+
+ if(room == null || room.length() <1)
+ throw new Exception("InputVal room not valid");
+
+ Long user_level =
Usermanagement.getInstance().getUserLevelByID(sharing_user_id);
+ Rooms myRoom=
Roommanagement.getInstance().getRoomById(user_level,
Long.parseLong(room));
+
+ if(myRoom == null)
+ throw new Exception("no Room for ID " + room);
+
+ // Define Room
+ session.setRoom(myRoom);
+
+ Users user =
Usermanagement.getInstance().getUserById(sharing_user_id);
+
+ if(user == null)
+ throw new Exception("No User for id " +
sharing_user_id);
+
+ session.setSharingUser(user);
+
+ // RTP Sharer IP + Port + Streamdata are defined on
ServletCall (->
streamer start)
+
+ rtpSessions.put(myRoom, session);
+
+ return session;
+
}
//---------------------------------------------------------------------------------------------
Modified:
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/RTPMethodServlet.java
==============================================================================
---
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/RTPMethodServlet.java
(original)
+++
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/RTPMethodServlet.java
Tue Jun 30 06:25:51 2009
@@ -36,7 +36,7 @@
// define Method
- String method = request.getParameter("service");
+ String method = request.getParameter("method");
// Streming Client says GO!
@@ -88,21 +88,34 @@
try{
+ String width, height, jpegquality, sid = null,
publicSID = null;
+
String room = request.getParameter("room");
if(room == null || room.length() < 1)
throw new
ServletException("RTPMethodServlet.startStreaming : no
parameter room!");
+ sid = request.getParameter("sid");
+
+ if(sid == null || sid.length() < 1)
+ throw new
ServletException("RTPMethodServlet.startStreaming : no
parameter SID!");
+
+
+ String sharerIP = request.getParameter("sharerIP");
+
+ if(sharerIP == null || sharerIP.length() < 1)
+ throw new
ServletException("RTPMethodServlet.startStreaming : no
parameter sharerIP!");
+
// TODO get Userdefinitions from ServletCall *width,
height* => what
for? they are already in the RTPScreenSharingSession
// -> Sharing Client has the possibility to alter
Width/height/quality
of the stream, so it should be notified at every Stream Start, i think
- String width, height, jpegquality, sid = null,
publicSID = null;
-
// TODO Change RTP - Session with these detailvalues
RTPScreenSharingSession session;
-
+
session = RTPStreamingHandler.getSessionForRoom(room,
sid);
+ session.setSharingIpAddress(sharerIP);
+
//width, height should be also in the
RTPScreenSharingSession Object
width=request.getParameter("width");
@@ -129,6 +142,7 @@
}
}
+ log.debug("startStreaming values : IPAddress Sharer : "
+ sharerIP + ",
width=" + width + ", height=" + height + ",room=" + room);
//we have to include the publicSID to get the
RoomClient Object
//also the HOST, PORT must be set correctly in the
RTPScreenSharingSession-Object
Modified:
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/ScreenRequestHandler.java
==============================================================================
---
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/ScreenRequestHandler.java
(original)
+++
trunk/webapp/src/app/org/openmeetings/servlet/outputhandler/ScreenRequestHandler.java
Tue Jun 30 06:25:51 2009
@@ -168,13 +168,11 @@
ctx.put("DOMAIN", domain);
ctx.put("PUBLIC_SID", publicSID);
ctx.put("RECORDER", record);
-
String requestedFile = roomName+".jnlp";
httpServletResponse.setContentType("application/x-java-jnlp-file");
httpServletResponse.setHeader("Content-Disposition","Inline;
filename=\"" + requestedFile + "\"");
-
// Check , which screenviewer is to be used
org.openmeetings.app.hibernate.beans.basic.Configuration conf =
Configurationmanagement.getInstance().getConfKey(user_level, "screen_viewer");
@@ -198,6 +196,10 @@
ctx.put("PORT",
free_rtp_port);
template =
"screencast_rtp.vm";
log.debug("Creating
JNLP Template for RTP solution");
+
+ // Storing Session data
+
RTPStreamingHandler.storeSessionForRoom(room, users_id);
+ log.debug("Stored
RTPSession Data for Room " + room);
//We need to start a
new Thread of the RTPStreamReceiver at this
Moment
//that is waiting for
the RTP Stream to be received
Modified: trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/Main.java
==============================================================================
--- trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/Main.java
(original)
+++ trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/Main.java Tue
Jun 30 06:25:51 2009
@@ -8,6 +8,8 @@
import javax.swing.SwingConstants;
import javax.swing.SwingUtilities;
import java.awt.Point;
+import java.net.InetAddress;
+
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JMenuItem;
@@ -301,7 +303,9 @@
// Notify viewers
try{
- ServletFunctions.sendStartSignal(servletUrl,
quality, videoHeight,
videoWidth, ROOM);
+ InetAddress address =
InetAddress.getLocalHost();
+
+ ServletFunctions.sendStartSignal(servletUrl,
quality, videoHeight,
videoWidth, ROOM, SID, address.getHostName());
}catch(Exception ex){
System.out.println("Error on ServletCall : " +
ex.getMessage());
}
Modified:
trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/ServletFunctions.java
==============================================================================
---
trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/ServletFunctions.java
(original)
+++
trunk/webapp/src/screenviewer/de/medint/rtpsharer/main/ServletFunctions.java
Tue Jun 30 06:25:51 2009
@@ -22,11 +22,11 @@
* @param width
*/
//---------------------------------------------------------------------------------------------------------
- public static void sendStartSignal(String servletUrl, float
jpegQuality,
int height, int width, String room) throws Exception{
+ public static void sendStartSignal(String servletUrl, float
jpegQuality,
int height, int width, String room, String SID, String sharerIP) throws
Exception{
//Building ServletUrl
- String url = servletUrl + "?method=streamer_start&room=" + room
+ "&height=" + height + "&width=" + width + "&quality=" + jpegQuality;
+ String url = servletUrl + "?method=streamer_start&room=" + room
+ "&height=" + height + "&width=" + width + "&quality=" + jpegQuality
+ "&sid=" + SID + "&sharerIP=" + sharerIP;
URLConnection c = getConnection(url);
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenMeetings developers" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/openmeetings-dev?hl=en
-~----------~----~----~----~------~----~------~--~---
- [openmeetings-dev] [openmeetings commit] r2132 - Starting Sharing Session codesite-noreply 2009/06/30 <=