pub unsafe static kCMSampleBufferAttachmentKey_ForceKeyFrame: &'static CFStringCMSampleBuffer only.Expand description
Indicates that the current or next video sample buffer should be forced to be encoded as a key frame.
A value of kCFBooleanTrue for kCMSampleBufferAttachmentKey_ForceKeyFrame indicates that the current or next video sample buffer processed in the stream should be forced to be encoded as a key frame. If this attachment is present and kCFBooleanTrue on a sample buffer with a video frame, that video frame will be forced to become a key frame. If the sample buffer for which this is present and kCFBooleanTrue does not have a valid video frame, the next sample buffer processed that contains a valid video frame will be encoded as a key frame.
Usual care should be taken when setting attachments on sample buffers whose orgins and destinations are ambiguous. For example, CMSetAttachment() is not thread-safe, and CMSampleBuffers may be used in multiple sample buffer streams in a given system. This can lead to crashes during concurrent access and/or unexpected behavior on alternate sample buffer streams. Therefore, unless the orgin and destination of a sample buffer is known, the general recommended practice is to synthesize an empty sample buffer with this attachment alone and insert it into the sample buffer stream ahead of the concrete sample buffer rather than setting this attachment on the concrete sample buffer itself.
See also Appleās documentation