Search in sources :

Example 1 with RecordErrorEvent

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

the class FileRecorder method stop.

public void stop() {
    try {
        log.info("Closing stream");
        fo.close();
        svf = null;
    } catch (IOException e) {
        log.error(StackTraceUtil.getStackTrace(e));
        RecordErrorEvent event = new RecordErrorEvent(session);
        event.setReason("Cannot record to recording output.");
        listeners.notifyListeners(event);
    }
    RecordStoppedEvent event = new RecordStoppedEvent(session);
    event.setFile(flvFilename);
    listeners.notifyListeners(event);
}
Also used : RecordErrorEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordErrorEvent) IOException(java.io.IOException) RecordStoppedEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordStoppedEvent)

Example 2 with RecordErrorEvent

use of org.bigbluebutton.deskshare.server.recorder.event.RecordErrorEvent 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)

Example 3 with RecordErrorEvent

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

the class FileRecorder method recordFrameToFile.

private void recordFrameToFile(IoBuffer frame) {
    try {
        fo.write(svf.encodeFlvData(frame.array()));
        RecordUpdateEvent event = new RecordUpdateEvent(session);
        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);
    } catch (FlvEncodeException e) {
        log.error(StackTraceUtil.getStackTrace(e));
        RecordErrorEvent event = new RecordErrorEvent(session);
        event.setReason("Cannot record to recording output.");
        listeners.notifyListeners(event);
    }
}
Also used : FlvEncodeException(org.bigbluebutton.deskshare.server.session.FlvEncodeException) RecordUpdateEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordUpdateEvent) RecordErrorEvent(org.bigbluebutton.deskshare.server.recorder.event.RecordErrorEvent) IOException(java.io.IOException)

Aggregations

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