One Logo Pool Ball
CoreMedia · IOS API REFERENCE

CMSampleBuffer.AttachmentKey

struct · iOS 13.0+ · SDK 27.1

struct AttachmentKey

The following keys may be attached to sample buffers using CMAttachmentBearerProtocol `.attachments`:

Members (25)

get · iOS 13.0+

displayEmptyMediaImmediately

TypeScript
get displayEmptyMediaImmediately(): CMSampleBuffer_AttachmentKey
Swift declaration
static let displayEmptyMediaImmediately: CMSampleBuffer.AttachmentKey

Tells that the empty marker should be dequeued immediately regardless of its timestamp. Marker sample buffers with this attachment in addition to `emptyMedia` are used to tell that the empty sample buffer should be dequeued immediately regardless of its timestamp. This attachment should only be used with sample buffers with the `emptyMedia` attachment.

get · iOS 13.0+

permanentEmptyMedia

TypeScript
get permanentEmptyMedia(): CMSampleBuffer_AttachmentKey
Swift declaration
static let permanentEmptyMedia: CMSampleBuffer.AttachmentKey

Marks the end of the sequence of samples. Marker sample buffers with this attachment in addition to `emptyMedia` are used to indicate that no further samples are expected.

get · iOS 13.0+

emptyMedia

TypeScript
get emptyMedia(): CMSampleBuffer_AttachmentKey
Swift declaration
static let emptyMedia: CMSampleBuffer.AttachmentKey

Marks an intentionally empty interval in the sequence of samples. The sample buffer's output presentation timestamp indicates when the empty interval begins. Marker sample buffers with this attachment are used to announce the arrival of empty edits.

get · iOS 13.0+

forceKeyFrame

TypeScript
get forceKeyFrame(): CMSampleBuffer_AttachmentKey
Swift declaration
static let forceKeyFrame: CMSampleBuffer.AttachmentKey

Indicates that the current or next video sample buffer should be forced to be encoded as a key frame. A value of `true` for `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 `true` 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 `true` 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, seting attachments is not thread-safe, and `CMSampleBuffer`s 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.

get · iOS 13.0+

resumeOutput

TypeScript
get resumeOutput(): CMSampleBuffer_AttachmentKey
Swift declaration
static let resumeOutput: CMSampleBuffer.AttachmentKey
get · iOS 13.0+

transitionID

TypeScript
get transitionID(): CMSampleBuffer_AttachmentKey
Swift declaration
static let transitionID: CMSampleBuffer.AttachmentKey

Marks a transition from one source of buffers (eg. song) to another. For example, during gapless playback of a list of songs, this attachment marks the first buffer from the next song. If this attachment is on a buffer containing no samples, the first following buffer that contains samples is the buffer that contains the first samples from the next song. This transition identifier should be unique within a playlist, so each transition in a playlist is uniquely identifiable. A counter that increments with each transition is a simple example.

get · iOS 13.0+

speedMultiplier

TypeScript
get speedMultiplier(): CMSampleBuffer_AttachmentKey
Swift declaration
static let speedMultiplier: CMSampleBuffer.AttachmentKey

The factor by which the sample buffer's presentation should be accelerated (eg, in a scaled edit). For normal playback the speed multiplier would be `1.0` (which is used if this attachment is not present); for double-speed playback the speed multiplier would be `2.0`, which would halve the output duration. Speed-multiplication factors take effect after trimming; see `outputDuration`. Note that this attachment principally provides information about the duration-stretching effect: by default, it should be implemented by rate conversion, but other attachments may specify richer stretching operations -- for example, scaling without pitch shift, or pitch shift without changing duration. Sequences of speed-multiplied sample buffers should have explicit OutputPresentationTimeStamp attachments to clarify when each should be output.

get · iOS 13.0+

trimDurationAtEnd

TypeScript
get trimDurationAtEnd(): CMSampleBuffer_AttachmentKey
Swift declaration
static let trimDurationAtEnd: CMSampleBuffer.AttachmentKey

The duration that should be removed at the end of the sample buffer, after decoding. If this attachment is not present, the trim duration is zero (nothing removed). This is a `CMTime` in dictionary format as made by `CMTimeCopyAsDictionary`; use `CMTimeMakeFromDictionary` to convert to `CMTime`.

get · iOS 13.0+

drainAfterDecoding

TypeScript
get drainAfterDecoding(): CMSampleBuffer_AttachmentKey
Swift declaration
static let drainAfterDecoding: CMSampleBuffer.AttachmentKey
get · iOS 13.0+

droppedFrameReason

TypeScript
get droppedFrameReason(): CMSampleBuffer_AttachmentKey
Swift declaration
static let droppedFrameReason: CMSampleBuffer.AttachmentKey

Indicates the reason the current video frame was dropped. Sample buffers with this attachment contain no image or data buffer. They mark a dropped video frame. This attachment identifies the reason for the droppage.

get · iOS 13.0+

sampleReferenceURL

TypeScript
get sampleReferenceURL(): CMSampleBuffer_AttachmentKey
Swift declaration
static let sampleReferenceURL: CMSampleBuffer.AttachmentKey

Indicates the URL where the sample data is. This key is only used for CMSampleBuffers representing sample references. Such CMSampleBuffers: - have dataBuffer == nil and imageBuffer == nil - have dataReady == true and no makeDataReadyHandler - have a non-nil formatDescription - have numSamples > 0 - have numSampleTimingEntries > 0 and numSampleSizeEntries > 0

get · iOS 13.0+

trimDurationAtStart

TypeScript
get trimDurationAtStart(): CMSampleBuffer_AttachmentKey
Swift declaration
static let trimDurationAtStart: CMSampleBuffer.AttachmentKey

The duration that should be removed at the beginning of the sample buffer, after decoding. If this attachment is not present, the trim duration is zero (nothing removed). This is a `CMTime` in dictionary format as made by `CMTimeCopyAsDictionary`; use `CMTimeMakeFromDictionary` to convert to `CMTime`. In cases where all the output after decoding the sample buffer is to be discarded (e.g., the samples are only being decoded to prime the decoder) the usual convention is to set `trimDurationAtStart` to the whole duration and not to set a `trimDurationAtEnd` attachment. Note that setting or removing `trimDurationAtStart` from a sample buffer will not adjust an explicitly-set OutputPresentationTimeStamp.

get · iOS 13.0+

cameraIntrinsicMatrix

TypeScript
get cameraIntrinsicMatrix(): CMSampleBuffer_AttachmentKey
Swift declaration
static let cameraIntrinsicMatrix: CMSampleBuffer.AttachmentKey

Indicates the 3x3 camera intrinsic matrix applied to the current sample buffer. Camera intrinsic matrix is a Data containing a matrix_float3x3, which is column-major. It has the following contents: ``` fx 0 ox 0 fy oy 0 0 1 ``` `fx` and `fy` are the focal length in pixels. For square pixels, they will have the same value. `ox` and `oy` are the coordinates of the principal point. The origin is the upper left of the frame.

get · iOS 13.0+

gradualDecoderRefresh

TypeScript
get gradualDecoderRefresh(): CMSampleBuffer_AttachmentKey
Swift declaration
static let gradualDecoderRefresh: CMSampleBuffer.AttachmentKey

Indicates the decoder refresh count. Sample buffers with this attachment may be used to identify the audio decoder refresh count.

get · iOS 13.0+

droppedFrameReasonInfo

TypeScript
get droppedFrameReasonInfo(): CMSampleBuffer_AttachmentKey
Swift declaration
static let droppedFrameReasonInfo: CMSampleBuffer.AttachmentKey

Indicates additional information regarding the dropped video frame. Sample buffers with this attachment contain no image or data buffer. They mark a dropped video frame. If present, this attachment provides additional information about the `droppedFrameReason`.

get · iOS 13.0+

sampleReferenceByteOffset

TypeScript
get sampleReferenceByteOffset(): CMSampleBuffer_AttachmentKey
Swift declaration
static let sampleReferenceByteOffset: CMSampleBuffer.AttachmentKey

Indicates the byte offset at which the sample data begins. This key is only used for CMSampleBuffers representing sample references. Such CMSampleBuffers: - have dataBuffer == nil and imageBuffer == nil - have dataReady == true and no makeDataReadyHandler - have a non-nil formatDescription - have numSamples > 0 - have numSampleTimingEntries > 0 and numSampleSizeEntries > 0

get · iOS 13.0+

endsPreviousSampleDuration

TypeScript
get endsPreviousSampleDuration(): CMSampleBuffer_AttachmentKey
Swift declaration
static let endsPreviousSampleDuration: CMSampleBuffer.AttachmentKey

Indicates that sample buffer's decode timestamp may be used to define the previous sample buffer's duration. Marker sample buffers with this attachment may be used in situations where sample buffers are transmitted before their duration is known. In such situations, normally the recipient may use each sample buffer's timestamp to calculate the duration of the previous sample buffer. The marker sample buffer with this attachment is sent to provide the timestamp for calculating the final sample buffer's duration.

get · iOS 13.0+

resetDecoderBeforeDecoding

TypeScript
get resetDecoderBeforeDecoding(): CMSampleBuffer_AttachmentKey
Swift declaration
static let resetDecoderBeforeDecoding: CMSampleBuffer.AttachmentKey
get · iOS 13.0+

postNotificationWhenConsumed

TypeScript
get postNotificationWhenConsumed(): CMSampleBuffer_AttachmentKey
Swift declaration
static let postNotificationWhenConsumed: CMSampleBuffer.AttachmentKey
get · iOS 13.0+

fillDiscontinuitiesWithSilence

TypeScript
get fillDiscontinuitiesWithSilence(): CMSampleBuffer_AttachmentKey
Swift declaration
static let fillDiscontinuitiesWithSilence: CMSampleBuffer.AttachmentKey

Fill the difference between discontiguous sample buffers with silence. If a sample buffer enters a buffer queue and the presentation time stamp between the previous buffer and the buffer with this attachment are discontiguous, handle the discontinuity by generating silence for the time difference.

get · iOS 13.0+

stillImageLensStabilizationInfo

TypeScript
get stillImageLensStabilizationInfo(): CMSampleBuffer_AttachmentKey
Swift declaration
static let stillImageLensStabilizationInfo: CMSampleBuffer.AttachmentKey

Indicates information about the lens stabilization applied to the current still image buffer. Sample buffers that have been captured with a lens stabilization module may have an attachment of `stillImageLensStabilizationInfo` which has information about the stabilization status during the capture. This key will not be present in `CMSampleBuffer`s coming from cameras without a lens stabilization module.

get · iOS 13.0+

reverse

TypeScript
get reverse(): CMSampleBuffer_AttachmentKey
Swift declaration
static let reverse: CMSampleBuffer.AttachmentKey

Indicates that the decoded contents of the sample buffer should be reversed. If this attachment is not present, the sample buffer should be played forwards as usual. Reversal occurs after trimming and speed multipliers.

init · iOS 13.0+

init

TypeScript
init(rawValue: _CoreFoundation_CFString): CMSampleBuffer_AttachmentKey
Swift declaration
init(rawValue: CFString)

Creates a new instance with the specified raw value. If there is no value of the type that corresponds with the specified raw value, this initializer returns `nil`. For example: enum PaperSize: String { case A4, A5, Letter, Legal } print(PaperSize(rawValue: "Legal")) // Prints "Optional(PaperSize.Legal)" print(PaperSize(rawValue: "Tabloid")) // Prints "nil" - Parameter rawValue: The raw value to use for the new instance.

get · iOS 13.0+

rawValue

TypeScript
getRawValue($self: CMSampleBuffer_AttachmentKey): _CoreFoundation_CFString
Swift declaration
var rawValue: CFString

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

set · iOS 13.0+

rawValue

TypeScript
setRawValue($self: CMSampleBuffer_AttachmentKey, value: _CoreFoundation_CFString): void
Swift declaration
var rawValue: CFString

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

CMSampleBuffer.AttachmentKey

The iOS SDK compiler rejected this binding: type 'CMSampleBuffer.AttachmentKey' does not conform to protocol 'OneSDKNamedConstants'

All CoreMedia types →