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);
}
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);
}
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);
}
}
Aggregations