Hey folks. Trying to get started with iPhone video capture stuff, and having a terrible time getting it going.
At the moment, working with an exact copy of the sample code from this Apple Developer Q&A: qa1702; not going to re-paste it here, since it's a relatively big blob of code.
In any case, I copied and pasted that code into an otherwise-empty project, threw in a call to setupCaptureSession into a custom UIView, and figured I should be good to go:
- (void)awakeFromNib {
NSLog(@"init");
[self setupCaptureSession];
}
Unfortunately, when I run the code, my delegate never seems to be called:
- (void)captureOutput:(AVCaptureOutput *)captureOutput
didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
fromConnection:(AVCaptureConnection *)connection
{
NSLog(@"New Image!");
}
I'd expect to be seeing a flood of "New Image!" getting dumped to the log, but I'm getting absolutely nothing. I do know that all the initialization code is being run (I threw a few NSLog statements here and there within setupCaptureSession, and they all print).
So, I'd either A) like to figure out what I'm doing wrong or B) see some very simple capture code embedded into a UIView that actually works (the less code, the better). Ideally, the sample code would use the setupCaptureSession code as described in the Apple developer site above.
Note that this code is being tested on an iPhone 3GS running the newest version of iOS 4.
Thanks in advance!