当我使用AVFoundation framework?获取图像时,如何在图像中保存自定义元数据?
我知道我可以访问属性天气我有我的图像UIImage或CIImage但这些属性似乎彼此不同(即使它是相同的图像).
到目前为止,我访问这样的字典:(代码取自Caffeinated Cocoa博客)
NSLog(@"about to request a capture from: %@", [self stillImageOutput]);
[[self stillImageOutput] captureStillImageAsynchronouslyFromConnection:videoConnection completionHandler:^(CMSampleBufferRef imageSampleBuffer, NSError *error)
{
NSData *jpeg = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer] ;
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge_retained CFDataRef)jpeg, NULL);
//get all the metadata in the image
NSDictionary *metadata = (__bridge NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL);
//make the metadata dictionary mutable so we can add properties to it
NSMutableDictionary *metadataAsMutable = [metadata mutableCopy];
NSMutableDictionary *EXIFDictionary = [[metadataAsMutable objectForKey:(NSString *)kCGImagePropertyExifDictionary]mutableCopy];
NSMutableDictionary *GPSDictionary = …Run Code Online (Sandbox Code Playgroud) 我已经成功实现了ReplayKit。
SampleHandler.swift
class SampleHandler: RPBroadcastSampleHandler {
override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) {
}
override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) {
switch sampleBufferType {
case RPSampleBufferType.video:
break
case RPSampleBufferType.audioApp:
break
case RPSampleBufferType.audioMic:
break
@unknown default:
return
}
}
}
Run Code Online (Sandbox Code Playgroud)
问题 :
我正在 swift 中使用适用于移动设备的 WebRTC SDK。我的 WebRTCClient 文件。
final class WebRTCClient: NSObject {
// The `RTCPeerConnectionFactory` is in charge of creating new RTCPeerConnection instances.
// A new RTCPeerConnection should be created every new …Run Code Online (Sandbox Code Playgroud) 

我的应用程序我将给出部署目标6.1所以在7.0显示和6.1显示屏幕不同,所以如何调整6.1和7.0的大小