3 回答

TA貢獻(xiàn)1824條經(jīng)驗(yàn) 獲得超5個(gè)贊
我嘗試了史蒂夫的答案并且它有效,但我認(rèn)為它對(duì)于大型圖像來說很慢,因?yàn)樗鼤?huì)復(fù)制整個(gè)圖像。
您可以使用CMSetAttachments直接在CMSampleBuffer上設(shè)置屬性。在打電話之前這樣做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 關(guān)注
- 685 瀏覽
添加回答
舉報(bào)