Is there anyway to have the OS callback the delegate
- (void) captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)psampleBuffer fromConnection:(AVCaptureConnection *)pconnection
on a background thread instead of the main thread? The issue is the time that it is taking to copy off the data is affecting the UI. This seems to have to be done on the main thread since the captureOutput seems to be gone if trying to copy it in a background thread, etc… Am I missing something here?
CMFormatDescriptionRef format;
format = CMSampleBufferGetFormatDescription(sampleBuffer);
bufSize = CMSampleBufferGetNumSamples(sampleBuffer);
sampleSize = CMSampleBufferGetSampleSize(sampleBuffer,0);
sampleLength = CMSampleBufferGetTotalSampleSize(sampleBuffer);
blockbuff = CMSampleBufferGetDataBuffer(sampleBuffer);
CMBlockBufferCopyDataBytes(blockbuff, 0, tocopy*_depth, buffInUse+(offset*2));
For a good answer, this seems to get the location to fix the callback thread
Just need to change the queue.