CMSampleBufferSetOutputPresentationTimeStamp(_:newValue:)
Sets an output presentation timestamp to use in place of a calculated value.
Declaration
func CMSampleBufferSetOutputPresentationTimeStamp(_ sbuf: CMSampleBuffer, newValue outputPresentationTimeStamp: CMTime) -> OSStatusParameters
- sbuf:
The sample buffer being interrogated
- outputPresentationTimeStamp:
New value for
OutputPresentationTimeStamp. PasskCMTimeInvalidto go back to the default calculation.
Return Value
A result code. See Sample Buffer Error Codes.
Discussion
The output presentation timestamp is the time at which the decoded, trimmed, stretched and possibly reversed samples should commence being presented. By default, this is calculated by calling CMSampleBufferGetOutputPresentationTimeStamp. Call CMSampleBufferSetOutputPresentationTimeStamp to explicitly set the value for CMSampleBufferGetOutputPresentationTimeStamp to return.
For general forward playback in a scaled edit, the OutputPresentationTimeStamp should be set to:
((PresentationTimeStamp + TrimDurationAtStart - EditStartMediaTime) / EditSpeedMultiplier) + EditStartTrackTime.
For general reversed playback OutputPresentationTimeStamp should be set to:
((PresentationTimeStamp + Duration - TrimDurationAtEnd - EditStartMediaTime) / EditSpeedMultiplier) + EditStartTrackTime.
See Also
Inspecting Duration and Timing
CMSampleBufferGetDuration(_:)CMSampleBufferGetDecodeTimeStamp(_:)CMSampleBufferGetPresentationTimeStamp(_:)CMSampleBufferGetOutputDuration(_:)CMSampleBufferGetOutputDecodeTimeStamp(_:)CMSampleBufferGetOutputPresentationTimeStamp(_:)CMSampleBufferGetSampleTimingInfo(_:at:timingInfoOut:)CMSampleBufferGetSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)