---
title: AVSampleCursor
framework: avfoundation
role: symbol
role_heading: Class
path: avfoundation/avsamplecursor
---

# AVSampleCursor

An object that provides information about the media sample at the cursor’s current position.

## Declaration

```swift
class AVSampleCursor
```

## Overview

Overview You position a sample cursor at a specific media sample in a sequence of samples contained in a higher-level object, like an AVAssetTrack. You can move it to a new position in that sequence either backwards or forwards, either in decode order or in presentation order. You can also request moving it according to a count of samples or a delta in time. Use a sample cursor to get information about the media sample such as its duration, timestamps, dependency information, and so on. You can also use them to synchronously to perform I/O in order to load media data of one or more media samples into memory.

## Topics

### Navigating samples

- [step(byDecodeTime:wasPinned:)](avfoundation/avsamplecursor/step(bydecodetime:waspinned:).md)
- [step(byPresentationTime:wasPinned:)](avfoundation/avsamplecursor/step(bypresentationtime:waspinned:).md)
- [stepInDecodeOrder(byCount:)](avfoundation/avsamplecursor/stepindecodeorder(bycount:).md)
- [stepInPresentationOrder(byCount:)](avfoundation/avsamplecursor/stepinpresentationorder(bycount:).md)

### Getting timestamps

- [decodeTimeStamp](avfoundation/avsamplecursor/decodetimestamp.md)
- [presentationTimeStamp](avfoundation/avsamplecursor/presentationtimestamp.md)

### Getting sample information

- [currentChunkInfo](avfoundation/avsamplecursor/currentchunkinfo.md)
- [AVSampleCursorChunkInfo](avfoundation/avsamplecursorchunkinfo.md)
- [currentChunkStorageRange](avfoundation/avsamplecursor/currentchunkstoragerange.md)
- [AVSampleCursorStorageRange](avfoundation/avsamplecursorstoragerange.md)
- [currentChunkStorageURL](avfoundation/avsamplecursor/currentchunkstorageurl.md)
- [currentSampleDependencyInfo](avfoundation/avsamplecursor/currentsampledependencyinfo.md)
- [AVSampleCursorDependencyInfo](avfoundation/avsamplecursordependencyinfo.md)
- [currentSampleDuration](avfoundation/avsamplecursor/currentsampleduration.md)
- [currentSampleIndexInChunk](avfoundation/avsamplecursor/currentsampleindexinchunk.md)
- [currentSampleStorageRange](avfoundation/avsamplecursor/currentsamplestoragerange.md)
- [currentSampleSyncInfo](avfoundation/avsamplecursor/currentsamplesyncinfo.md)
- [AVSampleCursorSyncInfo](avfoundation/avsamplecursorsyncinfo.md)
- [copyCurrentSampleFormatDescription()](avfoundation/avsamplecursor/copycurrentsampleformatdescription().md)
- [currentSampleAudioDependencyInfo](avfoundation/avsamplecursor/currentsampleaudiodependencyinfo.md)
- [currentSampleDependencyAttachments](avfoundation/avsamplecursor/currentsampledependencyattachments.md)

### Accessing samples

- [maySamplesWithEarlierDecodeTimeStampsHavePresentationTimeStamps(laterThan:)](avfoundation/avsamplecursor/maysampleswithearlierdecodetimestampshavepresentationtimestamps(laterthan:).md)
- [maySamplesWithLaterDecodeTimeStampsHavePresentationTimeStamps(earlierThan:)](avfoundation/avsamplecursor/maysampleswithlaterdecodetimestampshavepresentationtimestamps(earlierthan:).md)
- [samplesRequiredForDecoderRefresh](avfoundation/avsamplecursor/samplesrequiredfordecoderrefresh.md)

### Comparing sample cursors

- [comparePositionInDecodeOrder(withPositionOf:)](avfoundation/avsamplecursor/comparepositionindecodeorder(withpositionof:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Sample cursors

- [AVSampleCursorSyncInfo](avfoundation/avsamplecursorsyncinfo.md)
- [AVSampleCursorDependencyInfo](avfoundation/avsamplecursordependencyinfo.md)
- [AVSampleCursorAudioDependencyInfo](avfoundation/avsamplecursoraudiodependencyinfo.md)
- [AVSampleCursorStorageRange](avfoundation/avsamplecursorstoragerange.md)
- [AVSampleCursorChunkInfo](avfoundation/avsamplecursorchunkinfo.md)
