mirror of
https://github.com/LIJI32/SameBoy.git
synced 2026-10-12 02:06:38 +00:00
Fix Camera support in certain iPhone models, fixes #736
This commit is contained in:
@@ -1998,7 +1998,12 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
|
||||
|
||||
_cameraSession = [AVCaptureSession new];
|
||||
_cameraSession.sessionPreset = AVCaptureSessionPreset352x288;
|
||||
if ([device supportsAVCaptureSessionPreset:AVCaptureSessionPreset352x288]) {
|
||||
_cameraSession.sessionPreset = AVCaptureSessionPreset352x288;
|
||||
}
|
||||
else if ([device supportsAVCaptureSessionPreset:AVCaptureSessionPresetMedium]) {
|
||||
_cameraSession.sessionPreset = AVCaptureSessionPresetMedium;
|
||||
}
|
||||
|
||||
[_cameraSession addInput: input];
|
||||
[_cameraSession addOutput: _cameraOutput];
|
||||
@@ -2010,6 +2015,7 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
|
||||
@catch (NSException *exception) {
|
||||
/* I have not tested camera support on many devices, so we catch exceptions just in case. */
|
||||
GB_camera_updated(&_gb);
|
||||
_cameraSession = nil;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user