Search in sources :

Example 1 with RecordStartedEvent

use of org.bigbluebutton.deskshare.server.recorder.event.RecordStartedEvent in project bigbluebutton by bigbluebutton.

the class FileRecorder method start.

public void start() {
    try {
        fo = new FileOutputStream(flvFilename);
        fo.write(svf.encodeHeader());
    } catch (FileNotFoundException e1) {
        log.error(StackTraceUtil.getStackTrace(e1));
        RecordErrorEvent event = new RecordErrorEvent(session);
        event.setReason("Failed to create recording output.");
        listeners.notifyListeners(event);
    } catch (IOException e) {
        log.error(StackTraceUtil.getStackTrace(e));
        RecordErrorEvent event = new RecordErrorEvent(session);
        event.setReason("Cannot record to recording output.");
        listeners.notifyListeners(event);
    }
    sendCapturedScreen = true;
    log.info("Starting stream");
    capturedScreenSender = new Runnable() {

        public void run() {
            while (sendCapturedScreen) {
                try {
                    IoBuffer frame = screenQueue.take();
                    recordFrameToFile(frame);
                } catch (InterruptedException e) {
                    log.error("InterruptedExeption while taking event.");
                    RecordErrorEvent event = new RecordErrorEvent(session);
                    event.setReason("Cannot record to recording output.");
                    listeners.notifyListeners(event);
                }
            }
        }
    };
    exec.execute(capturedScreenSender);
    RecordStartedEvent event = new RecordStartedEvent(session);
    event.setFile(flvFilename);
    listeners.notifyListeners(event);
}
Also used : RecordStartedEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordStartedEvent) FileOutputStream(java.io.FileOutputStream) FileNotFoundException(java.io.FileNotFoundException) RecordErrorEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordErrorEvent) IOException(java.io.IOException) IoBuffer(org.apache.mina.core.buffer.IoBuffer)

Aggregations

FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 IOException (java.io.IOException)1 IoBuffer (org.apache.mina.core.buffer.IoBuffer)1 RecordErrorEvent (org.bigbluebutton.deskshare.server.recorder.event.RecordErrorEvent)1 RecordStartedEvent (org.bigbluebutton.deskshare.server.recorder.event.RecordStartedEvent)1