thank you for that @ssmith_c ! i realised that I didn't have that structure protocol setup that way. I now can record frames properly with queueDepth = 8.
However, there is another issue I run into (which I don't know how to reproduce or trigger it)
My stream suddenly breaks/stops sometimes and I get the error: EXC_BAD_ACCESS (code=1, address=0x0)
I catch it in this function:
func stream(_ stream: SCStream, didStopWithError error: Error) {
print("Stream stopped with error: \(error.localizedDescription)")
if isRecording {
isRecording = false
if let session = compressionSession {
VTCompressionSessionCompleteFrames(session, untilPresentationTimeStamp: .positiveInfinity)
VTCompressionSessionInvalidate(session)
}
compressionSession = nil
self.stream = nil
self.bufferQueue.async {
print("[DEBUG] Buffer size before restart: \(self.circularBuffer.count)")
}
// Attempt to restart
self.start()
self.bufferQueue.async {
print("[DEBUG] Buffer size after restart: \(self.circularBuffer.count)")
}
}
}
one moment, the stream would be running properly and then the next, it stops.
What are generally the steps to debug in this scenario? I added exception breakpoints but I don't exactly know what to look for and where to look for.
I added zombie objects detection as well but I don't know what to check for..
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: