From 76fa76b4355d39714ecad48e55704f14cfa148eb Mon Sep 17 00:00:00 2001 From: Jan Herling Date: Mon, 6 Jan 2025 11:48:33 -0800 Subject: [PATCH] Minor fix for ISO in AVFLiveVideo Summary: Ensuring that we set the exposure mode before setting the ISO. Reviewed By: enpe Differential Revision: D67609862 fbshipit-source-id: 16738ffd6550ad996140f0d4e5aa7da0dcc313b9 --- impl/ocean/media/avfoundation/AVFLiveVideo.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/impl/ocean/media/avfoundation/AVFLiveVideo.mm b/impl/ocean/media/avfoundation/AVFLiveVideo.mm index 6052eca1..cd7e6e8a 100644 --- a/impl/ocean/media/avfoundation/AVFLiveVideo.mm +++ b/impl/ocean/media/avfoundation/AVFLiveVideo.mm @@ -349,12 +349,14 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM if (iso <= 0.0f) { [captureDevice_ setExposureMode:AVCaptureExposureModeContinuousAutoExposure]; + result = true; } else { - [captureDevice_ setExposureModeCustomWithDuration:[captureDevice_ exposureDuration] ISO:iso completionHandler:nil]; [captureDevice_ setExposureMode:AVCaptureExposureModeLocked]; + [captureDevice_ setExposureModeCustomWithDuration:AVCaptureExposureDurationCurrent ISO:iso completionHandler:nil]; + result = true; }