diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java index 014fc8d331033c26fc9966aba2582eeb87f55c9b..101359a40ce1aa58d1ad8ba06776957232eae2f8 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationApplication.java @@ -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; + } } diff --git a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java index 0bd1176362fae298a7f0bd9ce2bee85aac010e11..ff7ffdbfcaa0124977f26069635d4b57f0a34bf9 100755 --- a/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java +++ b/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/presentation/PresentationEventSender.java @@ -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") diff --git a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-apps.xml b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-apps.xml index d576345519f1afd98b9b8546aedb089ae9eb53ac..13991ad6e5a2555a0a4939dbeb22538364acfb78 100755 --- a/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-apps.xml +++ b/bigbluebutton-apps/src/main/webapp/WEB-INF/bbb-apps.xml @@ -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"> diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentSOService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentSOService.as index 7a56e2849e943596c8c35429a501f9570140b67f..5f00d924b7a15db360a516f4adee5f6ba84c86bd 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentSOService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentSOService.as @@ -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); } /** diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as index c296d7e8890abef00dd2fb96cfa87604d8b4cfd1..c708ebe04a2f72d0349b8189667665dff950b7eb 100755 --- a/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/business/PresentationService.as @@ -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(); } diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageReceiver.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageReceiver.as new file mode 100755 index 0000000000000000000000000000000000000000..b6ab203845ae3c4db9b05685fb702698f268622c --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageReceiver.as @@ -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); + } + } +} \ No newline at end of file diff --git a/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageSender.as b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageSender.as new file mode 100755 index 0000000000000000000000000000000000000000..98029aac7d3d9d658cb35ebfd3e27dac07581044 --- /dev/null +++ b/bigbluebutton-client/src/org/bigbluebutton/modules/present/services/MessageSender.as @@ -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() + { + + } + + + } +} \ No newline at end of file diff --git a/record-and-playback/core/lib/recordandplayback/generators/video.rb b/record-and-playback/core/lib/recordandplayback/generators/video.rb index a494ee0bbb85afd3ee0096c3cb39ac39cafd2b29..e7a000087386b2d11739df8f2132fccc2604fcde 100755 --- a/record-and-playback/core/lib/recordandplayback/generators/video.rb +++ b/record-and-playback/core/lib/recordandplayback/generators/video.rb @@ -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