xcode - How to get the width and height of the iphone camera -


Is there a way to get the width and height of the iPhone camera sample? I'm targeting iOS4 and I do not know what the width or height is as long as I did not come in the didOutputSampleBuffer rep.

Here is the code that actually receives width and height in the delegate:

  - (zero) CaptureOptput: Capture output (Capture output) * was output sample buffer : (CMSampleBufferRef) connection to sampleBuffer: (AVCaptureConnection *) connection {CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer (sampleBuffer); CVPixelBufferLockBaseAddress (ImageBuffer, 0); Uint8_t * baseAddress = (uint8_t *) CVPixelBufferGetBaseAddress (imageBuffer); Size_t byte paro = cvpx bufferget bitsprar (image buffer); Size_t width = CVPixelBufferGetWidth (imageBuffer); Size_t height = cvpxbuffergatehit (image buffer); ...   

My solution was to delay the creation of my object which was known about Should not be the width and height until I come in the delegate callback, then I just use

  (if my object! = Zero) {// Create with width and height}  

The only negativity is that it checks a zero callback ...


Comments