// RosyWriter records videos and we prefer not to have any dropped frames in the video recording.
// By setting alwaysDiscardsLateVideoFrames to NO we ensure that minor fluctuations in system load or in our processing time for a given frame won't cause framedrops.
// We do however need to ensure that on average we can process frames in realtime.
// If we were doing preview only we would probably want to set alwaysDiscardsLateVideoFrames to YES.
// For single core systems like iPhone 4 and iPod Touch 4th Generation we use a lower resolution and framerate to maintain real-time performance.
if ( [NSProcessInfo processInfo].processorCount == 1 )
{
if ( [_captureSession canSetSessionPreset:AVCaptureSessionPreset640x480] ) {
sessionPreset = AVCaptureSessionPreset640x480;
}
frameRate = 15;
}
else
{
#if ! USE_OPENGL_RENDERER
// When using the CPU renderers or the CoreImage renderer we lower the resolution to 720p so that all devices can maintain real-time performance (this is primarily for A5 based devices like iPhone 4s and iPod Touch 5th Generation).
if ( [_captureSession canSetSessionPreset:AVCaptureSessionPreset1280x720] ) {