I'm trying to access intrinsic matrix following this answer.
By running the commend below, I was able to get a 48-byte AnyObject, and I further convert it into a CFData.
let camData = CMGetAttachment(sampleBuffer, kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix, nil)
However, I checked the output of sampleBuffer in CMSampleBuffer.h
:
/*! @constant kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix
@abstract Indicates the 3x3 camera intrinsic matrix applied to the current sample buffer.
@discussion Camera intrinsic matrix is a CFData containing a matrix_float3x3, which is column-major.
....
*/
CM_EXPORT const CFStringRef kCMSampleBufferAttachmentKey_CameraIntrinsicMatrix // CFData (matrix_float3x3) __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_11_0);
How should I access the value in the matrix_float3x3
from the CFData
?