¡@

Home 

2014/10/15 ¤U¤È 10:10:12

iphone Programming Glossary: imagesamplebuffer

Capturing Images from AVCaptureSession

http://stackoverflow.com/questions/8264749/capturing-images-from-avcapturesession

captureStillImageAsynchronouslyFromConnection videoConnection completionHandler ^ CMSampleBufferRef imageSampleBuffer NSError error CFDictionaryRef exifAttachments CMGetAttachment imageSampleBuffer kCGImagePropertyExifDictionary NULL if.. completionHandler ^ CMSampleBufferRef imageSampleBuffer NSError error CFDictionaryRef exifAttachments CMGetAttachment imageSampleBuffer kCGImagePropertyExifDictionary NULL if exifAttachments Do something with the attachments. NSLog @ attachements @ exifAttachments.. else NSLog @ no attachments NSData imageData AVCaptureStillImageOutput jpegStillImageNSDataRepresentation imageSampleBuffer UIImage image UIImage alloc initWithData imageData self.vImage.image image For more reference you can see iOS4 Take photos..

How to write exif metadata to an image (not the camera roll, just a UIImage or JPEG)

http://stackoverflow.com/questions/9006759/how-to-write-exif-metadata-to-an-image-not-the-camera-roll-just-a-uiimage-or-j

captureStillImageAsynchronouslyFromConnection videoConnection completionHandler ^ CMSampleBufferRef imageSampleBuffer NSError error code here block code CFDictionaryRef metaDict CMCopyDictionaryOfAttachments NULL imageSampleBuffer kCMAttachmentMode_ShouldPropagate.. imageSampleBuffer NSError error code here block code CFDictionaryRef metaDict CMCopyDictionaryOfAttachments NULL imageSampleBuffer kCMAttachmentMode_ShouldPropagate CFMutableDictionaryRef mutable CFDictionaryCreateMutableCopy NULL 0 metaDict Create formatted.. __bridge void EXIFDictionary NSData jpeg AVCaptureStillImageOutput jpegStillImageNSDataRepresentation imageSampleBuffer After this code you will have your image in the jpeg nsdata and the correspoding dictionary for that image in the mutable..