3 回答

TA贡献1824条经验 获得超5个赞
我尝试了史蒂夫的答案并且它有效,但我认为它对于大型图像来说很慢,因为它会复制整个图像。
您可以使用CMSetAttachments直接在CMSampleBuffer上设置属性。在打电话之前这样做jpegStillImageNSDataRepresentation
CFDictionaryRef metaDict = CMCopyDictionaryOfAttachments(NULL, imageSampleBuffer, kCMAttachmentMode_ShouldPropagate);
CFMutableDictionaryRef mutable = CFDictionaryCreateMutableCopy(NULL, 0, metaDict);
NSMutableDictionary * mutableGPS = [self getGPSDictionaryForLocation:self.myLocation];
CFDictionarySetValue(mutable, kCGImagePropertyGPSDictionary, mutableGPS);
// set the dictionary back to the buffer
CMSetAttachments(imageSampleBuffer, mutable, kCMAttachmentMode_ShouldPropagate);
方法getGPSDictionaryForLocation:可以在这里找到:
- 3 回答
- 0 关注
- 659 浏览
添加回答
举报