I have a PIP camera that is streaming from the front and back based on AVCaptureMultiCamSession. It works fine, but when i go to swap the camera it crashes. This is code that works with a single camera, so not sure what is wrong. Also the object appears valid in the debugger.
This is the snippit where the camera is swapped
private func updateSessionConfiguration() {
guard isCaptureSessionConfigured else { return }
captureSession.beginConfiguration()
defer { captureSession.commitConfiguration() }
// Remove all current inputs
for input in captureSession.inputs {
if let deviceInput = input as? AVCaptureDeviceInput {
captureSession.removeInput(deviceInput)
app_log("removing input for \(input)")
}
}
// Add the primary device input
if let deviceInput = deviceInputFor(device: captureDevice) {
app_log("device input \(deviceInput)")
if !captureSession.inputs.contains(deviceInput), captureSession.canAddInput(deviceInput) {
captureSession.addInput(deviceInput)
}
}
if let secondaryDeviceInput = deviceInputFor(device: secondaryCaptureDevice) {
app_log("Secondary device input \(secondaryDeviceInput)")
if !captureSession.inputs.contains(secondaryDeviceInput), captureSession.canAddInput(secondaryDeviceInput) {
captureSession.addInput(secondaryDeviceInput)
}
}
updateVideoOutputConnection()
}
It crashes at: captureSession.addInput(deviceInput)
with: Thread 10: EXC_BAD_ACCESS (code=1, address=0xcaeb36b964f0)
which is strange because canAdd is checked prior to this call. Totally stumped here. Please help. Not sure if this is an AVCaptureMuliCamSession issue or something.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Hi, I recently upgraded my device OS to 26.0 and XCode is on Version 26.0.1 (17A400)
My XCode log is getting spammed with these types of errors all of a sudden. And filtering is so limited (filter a single item at a time) I can't remove them. It says to file a bug, can you folks PLEASE fix this it is making debugging really hard with all its noise.
Unable to update Font Descriptor's weight to Weight(value: 0.3):
UICTFontDescriptor <0x110e40180> = {
NSFontNameAttribute = "SF Pro Display";
NSFontSizeAttribute = 16;
} - SwiftUICore/Logging.swift:84 - please file a bug report.
and
UICTFontDescriptor <0x1181062e0> = {
NSFontNameAttribute = "Inter Display";
NSFontSizeAttribute = 28;
} - SwiftUICore/Logging.swift:84 - please file a bug report.