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 關注
- 707 瀏覽
添加回答
舉報
