event = new Aggregate(buffer);
event.setTimestamp(cachedEvent.getTimestamp());
message = RTMPMessage.build(event);
break;
case Constants.TYPE_AUDIO_DATA:
event = new AudioData(buffer);
event.setTimestamp(cachedEvent.getTimestamp());
message = RTMPMessage.build(event);
break;
case Constants.TYPE_VIDEO_DATA:
event = new VideoData(buffer);
event.setTimestamp(cachedEvent.getTimestamp());
message = RTMPMessage.build(event);
break;
default:
event = new Notify(buffer);
event.setTimestamp(cachedEvent.getTimestamp());
message = RTMPMessage.build(event);
break;
}
// push it down to the recorder
recordingConsumer.pushMessage(null, message);
} else if (bufferLimit == 0 && dataType == Constants.TYPE_AUDIO_DATA) {
log.debug("Stream data size was 0, sending empty audio message");
// allow for 0 byte audio packets
event = new AudioData(IoBuffer.allocate(0));
event.setTimestamp(cachedEvent.getTimestamp());
message = RTMPMessage.build(event);
// push it down to the recorder
recordingConsumer.pushMessage(null, message);
} else {