Contents

init(markerAt:duration:)

Creates a marker-only sample buffer with no payload and no format description.

Declaration

init(markerAt markerTime: CMTime, duration: CMTime = .invalid)

Parameters

  • markerTime:

    Timestamp at which the marker sample buffer should be considered. Pass Invalid if the marker buffer does not carry timing information.

  • duration:

    Duration of the marker sample buffer.

Discussion

Marker-only sample buffers are meant to carry attachments that communicate a state change between sample buffers. To set attachments on the sample buffer please to access the underlying sample buffer instance as follows:

markerOnlySampleBuffer.withUnsafeSampleBuffer { sbuf in
    sbuf.attachments[.endsPreviousSampleDuration] = .shouldPropagate(true)
}