To create a CVPixelBuffer attributes in Objective-C I would do something like so:
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
[NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
nil];
And then in the CVPixelBufferCreate
meathod I would pass (__bridge CFDictionaryRef) attributes
as the parameter.
In Swift I'm attempting to create my dictionary like this:
let attributes:[CFString : NSNumber] = [
kCVPixelBufferCGImageCompatibilityKey : NSNumber(bool: true),
kCVPixelBufferCGBitmapContextCompatibilityKey : NSNumber(bool: true)
]
but I'm discovering that CFString is not Hashable and well, I have been unable to get this to work.
Can someone provide an example of how this works in Swift?