title: Saving CMSampleBufferRef for later processing
body: <p>I am trying to use AVFoundation framework to capture a 'series' of still images from AVCaptureStillImageOutput QUICKLY, like the burst mode in some cameras. I want to use the completion handler,</p>
  
  <pre><code>    [stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection 
                                                completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) { 
  </code></pre>
  
  <p>and pass the imageSampleBuffer to an NSOperation object for later processing. However i cant find a way to retain the buffer in the NSOperation class.</p>
  
  <pre><code>    [stillImageOutput captureStillImageAsynchronouslyFromConnection:videoConnection 
                                                completionHandler: ^(CMSampleBufferRef imageSampleBuffer, NSError *error) { 
  
      //Add to queue
      SaveImageDataOperation *saveOperation = [[SaveImageDataOperation alloc] initWithImageBuffer:imageSampleBuffer];
      [_saveDataQueue addOperation:saveOperation];
      [saveOperation release];
  
      //Continue
      [self captureCompleted];
  }];
  </code></pre>
  
  <p>Does any one know what I maybe doing wrong here? Is there a better approach to do this?</p>