Thanks for being a part of WWDC25!

How did we do? We’d love to know your thoughts on this year’s conference. Take the survey here

AVCaptureVideoPreviewLayer layoutSublayers invoked on background thread

Opening this question after discussing the issue in the AVCapture lab, hopefully so we can track down this issue.

We've been noticing some crashes in App Store Connect caused by layoutSublayers being called on a background thread.

After debugging the issue a bit we found that all calls which modified the AVCaptureSession or preview layer were indeed done on the main thread. It would be useful to see what results in AVCaptureVideoPreviewLayer.updateFormatDescription being called.

I've attached the crashlog below.





What about :

AVCaptureVideoPreviewLayer.connection.videoOrientation = orientation

Is it safe to call it on the background thread?

AVCaptureVideoPreviewLayer layoutSublayers invoked on background thread
 
 
Q