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