---
title: "CMSampleBufferGetDecodeTimeStamp(_:)"
framework: coremedia
role: symbol
role_heading: Function
path: "coremedia/cmsamplebuffergetdecodetimestamp(_:)"
---

# CMSampleBufferGetDecodeTimeStamp(_:)

Returns the decode timestamp that’s the earliest numerically of all the samples in a sample buffer.

## Declaration

```swift
func CMSampleBufferGetDecodeTimeStamp(_ sbuf: CMSampleBuffer) -> CMTime
```

## Parameters

- `sbuf`: The CMSampleBuffer being interrogated.

## Return Value

Return Value The numerically earliest sample decode timestamp in the CMSampleBuffer or kCMTimeInvalid if there is an error.

## Discussion

Discussion The returned decode timestamp is always the decode timestamp of the first sample in the buffer, because even out-of-presentation-order samples are expected to be in decode order in the buffer.

## See Also

### Inspecting Duration and Timing

- [CMSampleBufferGetDuration(_:)](coremedia/cmsamplebuffergetduration(_:).md)
- [CMSampleBufferGetPresentationTimeStamp(_:)](coremedia/cmsamplebuffergetpresentationtimestamp(_:).md)
- [CMSampleBufferGetOutputDuration(_:)](coremedia/cmsamplebuffergetoutputduration(_:).md)
- [CMSampleBufferGetOutputDecodeTimeStamp(_:)](coremedia/cmsamplebuffergetoutputdecodetimestamp(_:).md)
- [CMSampleBufferGetOutputPresentationTimeStamp(_:)](coremedia/cmsamplebuffergetoutputpresentationtimestamp(_:).md)
- [CMSampleBufferSetOutputPresentationTimeStamp(_:newValue:)](coremedia/cmsamplebuffersetoutputpresentationtimestamp(_:newvalue:).md)
- [CMSampleBufferGetSampleTimingInfo(_:at:timingInfoOut:)](coremedia/cmsamplebuffergetsampletiminginfo(_:at:timinginfoout:).md)
- [CMSampleBufferGetSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)](coremedia/cmsamplebuffergetsampletiminginfoarray(_:entrycount:arraytofill:entriesneededout:).md)
- [CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)](coremedia/cmsamplebuffergetoutputsampletiminginfoarray(_:entrycount:arraytofill:entriesneededout:).md)
