Technical Q&A QA1957
Getting attachments from a CMSampleBufferRef object
Q:
I’m calling CMSampleBufferGetSampleAttachmentsArray(_:_:) in an attempt to get the kCMSampleBufferAttachmentKey_DroppedFrameReason from a CMSampleBufferRef, but the returned attachments array is always nil. What’s going on?
A: For getting attachments, the general rule is:
- for kCMSampleBufferAttachmentKey_*, use CMGetAttachment(_:_:_:)
- for kCMSampleAttachmentKey_*, use CMSampleBufferGetSampleAttachmentsArray(_:_:)
Therefore, to get the kCMSampleBufferAttachmentKey_DroppedFrameReason from a CMSampleBufferRef use CMGetAttachment(_:_:_:).
Document Revision History
| Date | Notes |
|---|---|
| 2017-07-03 | New document that discusses how to get attachments from a CMSampleBufferRef object. |
Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-07-03