iOS カメラ アプリで AVCaptureDevice の automaticallyEnablesLowLightBoostWhenAvailable を有効にしようとしていますが、AVCaptureDevice の isLowLightBoostSupported を true に戻すことはまったくできませんでした。
質問: 低照度ブースト API を有効にするために、構成のためのロック以外に何かする必要があることはありますか? 完全に更新された最新のシステムで isLowLightBoostSupported が (すべてのデバイスに対して) 常に false を返す既知の理由はありますか?
iOS 7.1 を搭載した 5S でテストしています。
この質問を簡単にするために、変更を Apple の AVCam テスト アプリに移植しました。AVCam の差分は次のとおりです。
diff --git a/AVCam/AVCam/AVCamViewController.m b/AVCam/AVCam/AVCamViewController.m
index 84a2c77..4e15fc4 100644
--- a/AVCam/AVCam/AVCamViewController.m
+++ b/AVCam/AVCam/AVCamViewController.m
@@ -175,6 +175,18 @@ static void * SessionRunningAndDeviceAuthorizedContext = &SessionRunningAndDevic
[session addOutput:stillImageOutput];
[self setStillImageOutput:stillImageOutput];
}
+
+ if ([videoDevice respondsToSelector:@selector(isLowLightBoostSupported)]) {
+ if ([videoDevice lockForConfiguration:nil]) {
+ if (videoDevice.isLowLightBoostSupported) {
+ videoDevice.automaticallyEnablesLowLightBoostWhenAvailable = YES;
+ NSLog(@"was supported");
+ } else {
+ NSLog(@"was not supported");
+ }
+ [videoDevice unlockForConfiguration];
+ }
+ }
});
}
さらに明確にするために、そのコードを github でオンラインの AVCam のコンテキストに入れました。
ドキュメントとSOを調べて、答えを見つけようとしました。私の現在のコードを教育したいくつかのことを次に示します。
- iPhone 5の低照度ブーストモード
- AVCaptureDevice ローライト ブーストが機能しない
- https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVCaptureDevice_Class/Reference/Reference.html#//apple_ref/occ/instp/AVCaptureDevice/lowLightBoostSupported
また、AVCaptureSession インスタンスの sessionPreset を AVCaptureSessionPresetHigh、AVCaptureSessionPresetPhoto、および AVCaptureSessionPresetLow のすべてに設定しようとしましたが、isLowLightBoostSupported の状態に目に見える影響はありません。
これを読んでくれてありがとう - そしてあなたが与えることができるどんな助けにも! :)