Skip to content

Commit

Permalink
Improved custom exposure in AVFLiveVideo
Browse files Browse the repository at this point in the history
Summary:
1. Moved the lock statement above the value statement
2. Increase precision

Reviewed By: enpe

Differential Revision: D67608722

fbshipit-source-id: 2b28c3307798e69e97616b60dbbee04db4bbf2be
  • Loading branch information
janherling authored and facebook-github-bot committed Jan 6, 2025
1 parent 796315c commit 409f513
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions impl/ocean/media/avfoundation/AVFLiveVideo.mm
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,11 @@ - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CM
}
else
{
const CMTime exposureDuration = CMTimeMake(int64_t(duration * 1000.0 + 0.5), 1000);
const CMTime exposureDuration = CMTimeMakeWithSeconds(duration, 1000 * 1000 * 10);

[captureDevice_ setExposureModeCustomWithDuration:exposureDuration ISO:[captureDevice_ ISO] completionHandler:nil];
[captureDevice_ setExposureMode:AVCaptureExposureModeLocked];
[captureDevice_ setExposureModeCustomWithDuration:exposureDuration ISO:AVCaptureISOCurrent completionHandler:nil];

result = true;
}

Expand Down

0 comments on commit 409f513

Please sign in to comment.