<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.7.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreMedia",
  "identifier" : "/documentation/CoreMedia/CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Media"
    ],
    "preciseIdentifier" : "c:@F@CMSampleBufferGetOutputSampleTimingInfoArray"
  },
  "title" : "CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)"
}
-->

# CMSampleBufferGetOutputSampleTimingInfoArray(_:entryCount:arrayToFill:entriesNeededOut:)

Retrieves an array of output timing information structures that represents each sample in a sample buffer.

```
func CMSampleBufferGetOutputSampleTimingInfoArray(_ sbuf: CMSampleBuffer, entryCount timingArrayEntries: CMItemCount, arrayToFill timingArrayOut: UnsafeMutablePointer<CMSampleTimingInfo>?, entriesNeededOut timingArrayEntriesNeededOut: UnsafeMutablePointer<CMItemCount>?) -> OSStatus
```

## Parameters

`sbuf`

The `CMSampleBuffer` being interrogated.

`timingArrayEntries`

Number of entries in timing array.

`timingArrayOut`

On output, points to an array of `CMSampleTimingInfo` structs to receive the timing info.

`timingArrayEntriesNeededOut`

Number of entries needed for the result.

## Return Value

A result code. See [Sample Buffer Error Codes](/documentation/CoreMedia/sample-buffer-errors).

## Discussion

If only one [`CMSampleTimingInfo`](/documentation/CoreMedia/CMSampleTimingInfo) struct is returned, it applies to all samples in the buffer.See documentation of [`CMSampleTimingInfo`](/documentation/CoreMedia/CMSampleTimingInfo) for details of how a single `CMSampleTimingInfo` struct can apply to multiple samples. The `timingArrayOut` must be allocated by the caller, and the number of entries allocated must be passed in `timingArrayEntries`. If `timingArrayOut` is `NULL`, `timingArrayEntriesNeededOut` will return the required number of entries. Similarly, if `*timingArrayEntriesNeededOut` is too small, [`CMSampleBuffer`](/documentation/CoreMedia/CMSampleBuffer) will be returned, and `timingArrayEntriesNeededOut` will return the required number of entries. In either case, the caller can then make an appropriately-sized `timingArrayOut` and call again. For example, the caller might pass the address of a `CMSampleTimingInfo` struct on the stack (as timingArrayOut), and 1 as `timingArrayEntries`. If all samples are describable with a single `CMSampleTimingInfo` struct (or there’s only one sample in the `CMSampleBuffer`), this call will succeed. If not, it will fail, and will return the number of entries required in `timingArrayEntriesNeededOut`. Only in this case will the caller actually need to allocate an array. If there’s no timingInfo in this `CMSampleBuffer`, [`CMSampleBuffer`](/documentation/CoreMedia/CMSampleBuffer) will be returned, and `*timingArrayEntriesNeededOut` will be set to 0.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)