One of the recent sample codes from Apple uses same serial queue for receiving samples from AVCaptureVideoDataOutput and AVCaptureAudioDataOutput delegate. I need to know if this is acceptable practice from performance standpoint. Should one have different or single queue for both the sample buffer delegates? Particularly in the setting of multiple camera inputs/outputs, this becomes significant.
private let dataOutputQueue = DispatchQueue(label: "data output queue")
...
...
videoDataOutput.setSampleBufferDelegate(self, queue: dataOutputQueue)
audioDataOutput.setSampleBufferDelegate(self, queue: dataOutputQueue)
I guess when it comes to performance:
There's a similar question where the performance wasn't good because of serial queues and the answer was to use concurrent queues, see here: Performance issues when using AVCaptureVideoDataOutput and AVCaptureAudioDataOutput
But once again, I suggest you try it out and see what works for you :)
Update
Here's a link that perfectly explains the differences and how to work with serial & concurrent queues: https://www.avanderlee.com/swift/concurrent-serial-dispatchqueue/