Merge branch 'master' of https://github.com/bigbluebutton/bigbluebutton into change-internaluserid

This commit is contained in:
Markos Calderon 2012-10-01 16:41:45 -05:00
commit a72f91968b
8 changed files with 96 additions and 17 deletions

View File

@ -25,8 +25,12 @@ package org.bigbluebutton.conference.service.presentation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.bigbluebutton.conference.ClientMessage;
import org.bigbluebutton.conference.ConnectionInvokerService;
import org.red5.logging.Red5LoggerFactory;
import org.red5.server.api.Red5;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class PresentationApplication {
@ -34,6 +38,7 @@ public class PresentationApplication {
private static final String APP = "PRESENTATION";
private PresentationRoomsManager roomsManager;
private ConnectionInvokerService connInvokerService;
public boolean createRoom(String name) {
roomsManager.addRoom(new PresentationRoom(name));
@ -62,6 +67,7 @@ public class PresentationApplication {
@SuppressWarnings("unchecked")
public void sendUpdateMessage(Map message){
String room = (String) message.get("room");
if (roomsManager.hasRoom(room)){
roomsManager.sendUpdateMessage(message);
@ -118,13 +124,21 @@ public class PresentationApplication {
return null;
}
public void sendCursorUpdate(String room, Double xPercent, Double yPercent) {
public void sendCursorUpdate(String room, Double xPercent, Double yPercent) {
if (roomsManager.hasRoom(room)){
log.debug("Request to update cursor[" + xPercent + "," + yPercent + "]");
roomsManager.sendCursorUpdate(room, xPercent, yPercent);
Map<String, Object> message = new HashMap<String, Object>();
message.put("xPercent", xPercent);
message.put("yPercent", yPercent);
ClientMessage m = new ClientMessage(ClientMessage.BROADCAST, getMeetingId(), "PresentationCursorUpdateCommand", message);
connInvokerService.sendMessage(m);
return;
}
log.warn("resizeAndMoveSlide on a non-existant room " + room);
log.warn("Sending cursor update on a non-existant room " + room);
}
public void resizeAndMoveSlide(String room, Double xOffset, Double yOffset, Double widthRatio, Double heightRatio) {
@ -160,5 +174,12 @@ public class PresentationApplication {
log.debug("Done setting room manager");
}
private String getMeetingId(){
return Red5.getConnectionLocal().getScope().getName();
}
public void setConnInvokerService(ConnectionInvokerService connInvokerService) {
this.connInvokerService = connInvokerService;
}
}

View File

@ -142,11 +142,14 @@ public class PresentationEventSender implements IPresentationRoomListener {
@Override
public void sendCursorUpdate(Double xPercent, Double yPercent) {
log.debug("calling updateCursorCallback[" + xPercent + "," + yPercent + "]");
ArrayList list=new ArrayList();
list.add(xPercent);
list.add(yPercent);
so.sendMessage("updateCursorCallback", list);
// Disable. We are using connection invoke now. (ralam Oct 1, 2012).
// We'll have to convert all other messages to use conn invoke soon.
// log.debug("calling updateCursorCallback[" + xPercent + "," + yPercent + "]");
// ArrayList list=new ArrayList();
// list.add(xPercent);
// list.add(yPercent);
// so.sendMessage("updateCursorCallback", list);
}
@SuppressWarnings("unchecked")

View File

@ -60,9 +60,8 @@
</bean>
<bean id="presentationApplication" class="org.bigbluebutton.conference.service.presentation.PresentationApplication">
<property name="roomsManager">
<ref local="presentationRoomsManager"/>
</property>
<property name="roomsManager"> <ref local="presentationRoomsManager"/></property>
<property name="connInvokerService"> <ref bean="connInvokerService"/></property>
</bean>
<bean id="presentation.service" class="org.bigbluebutton.conference.service.presentation.PresentationService">

View File

@ -186,10 +186,10 @@ package org.bigbluebutton.modules.present.business {
*
*/
public function updateCursorCallback(xPercent:Number, yPercent:Number):void{
var e:CursorEvent = new CursorEvent(CursorEvent.UPDATE_CURSOR);
e.xPercent = xPercent;
e.yPercent = yPercent;
dispatcher.dispatchEvent(e);
// var e:CursorEvent = new CursorEvent(CursorEvent.UPDATE_CURSOR);
// e.xPercent = xPercent;
// e.yPercent = yPercent;
// dispatcher.dispatchEvent(e);
}
/**

View File

@ -30,7 +30,8 @@ package org.bigbluebutton.modules.present.business
import org.bigbluebutton.modules.present.events.PresentationEvent;
import org.bigbluebutton.modules.present.managers.PresentationSlides;
import org.bigbluebutton.modules.present.managers.Slide;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.modules.present.services.MessageReceiver;
/**
* This class directly communicates with an HTTP service in order to send and recives files (slides
@ -47,10 +48,12 @@ package org.bigbluebutton.modules.present.business
private var urlLoader:URLLoader;
private var slideUri:String;
private var dispatcher:Dispatcher;
private var _messageReceiver:MessageReceiver;
public function PresentationService()
{
service = new HTTPService();
_messageReceiver = new MessageReceiver();
dispatcher = new Dispatcher();
}

View File

@ -0,0 +1,37 @@
package org.bigbluebutton.modules.present.services
{
import com.asfusion.mate.events.Dispatcher;
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.IMessageListener;
import org.bigbluebutton.modules.present.events.CursorEvent;
public class MessageReceiver implements IMessageListener
{
public function MessageReceiver()
{
BBB.initConnectionManager().addMessageListener(this);
}
public function onMessage(messageName:String, message:Object):void {
// LogUtil.debug("Presentation: received message " + messageName);
switch (messageName) {
case "PresentationCursorUpdateCommand":
handlePresentationCursorUpdateCommand(message);
break;
default:
// LogUtil.warn("Cannot handle message [" + messageName + "]");
}
}
private function handlePresentationCursorUpdateCommand(message:Object):void {
var e:CursorEvent = new CursorEvent(CursorEvent.UPDATE_CURSOR);
e.xPercent = message.xPercent;
e.yPercent = message.yPercent;
var dispatcher:Dispatcher = new Dispatcher();
dispatcher.dispatchEvent(e);
}
}
}

View File

@ -0,0 +1,16 @@
package org.bigbluebutton.modules.present.services
{
import org.bigbluebutton.common.LogUtil;
import org.bigbluebutton.core.BBB;
import org.bigbluebutton.main.model.users.IMessageListener;
public class MessageSender
{
public function MessageSender()
{
}
}
}

View File

@ -135,7 +135,7 @@ module BigBlueButton
#Converts flv to mpg
def self.convert_flv_to_mpg(flv_video, mpg_video_out)
command = "ffmpeg -i #{flv_video} -loglevel fatal -v -10 -sameq -f mpegts #{mpg_video_out}"
command = "ffmpeg -i #{flv_video} -loglevel fatal -v -10 -sameq -f mpegts -r 29.97 #{mpg_video_out}"
BigBlueButton.logger.info("Task: Converting .flv to .mpg")
BigBlueButton.execute(command)
end