Class

AVSampleCursor

An object that provides information about the current media sample at its current position.

Declaration

@interface AVSampleCursor : NSObject

Overview

An AVSampleCursor instance is always positioned at a specific media sample in a sequence of samples as defined by a higher-level construct, such as an AVAssetTrack. It can be moved to a new position in that sequence either backwards or forwards, either in decode order or in presentation order. Movement can be requested according to a count of samples or according to a delta in time.

An AVSampleCursor can provide information about the media sample at its current position, such as its duration, its presentation and decode timestamps, whether it can be decoded independently of other media samples, its offset and length in its storage container, and whether the track signals that the sample is intended to be loaded with other contiguous media samples in a “chunk”.

AVSampleCursor instances can be compared by position within the sample sequence. They can also be used synchronously to perform I/O in order to load media data of one or more media samples into memory.

Topics

Traversing Samples

- stepByDecodeTime:wasPinned:

Moves the cursor by a given delta time on the decode timeline.

- stepByPresentationTime:wasPinned:

Moves the cursor by a given delta time on the presentation timeline.

- stepInDecodeOrderByCount:

Moves the cursor a given number of samples in decode order.

- stepInPresentationOrderByCount:

Moves the cursor a given number of samples in presentation order.

Getting Samples

- samplesWithEarlierDecodeTimeStampsMayHaveLaterPresentationTimeStampsThanCursor:

Determines whether a sample earlier in decode order can have a presentation timestamp later than that of the specified sample cursor.

- samplesWithLaterDecodeTimeStampsMayHaveEarlierPresentationTimeStampsThanCursor:

Determines whether a sample later in decode order can have a presentation timestamp earlier than that of the specified sample cursor.

samplesRequiredForDecoderRefresh

The number of samples prior to the current sample, in decode order, the decoder requires in order to achieve a coherent output at the current decode time.

Getting Timestamps

decodeTimeStamp

The decode timestamp of the sample at the current position of the cursor.

presentationTimeStamp

The presentation timestamp of the sample at the current position of the cursor.

Comparing Sample Cursors

- comparePositionInDecodeOrderWithPositionOfCursor:

Compares the relative positions of two sample cursors and returns their relative positions.

Getting Current Sample Information

currentChunkInfo

A value that provides information about the chunk of samples to which the current sample belongs.

AVSampleCursorChunkInfo

A value that provides information about a chunk of media samples.

currentChunkStorageRange

The sample range in the current chunk storage URL that is intended to be loaded together with the current sample as a chunk.

AVSampleCursorStorageRange

A struct indicating the offset and length of storage occupied by a media sample or its chunk.

currentChunkStorageURL

The URL of the storage container of the current sample and other samples that are intended to be loaded in the same operation as a chunk.

currentSampleDependencyInfo

The dependency information that describes relationships between a media sample and other media samples in the same sample sequence.

AVSampleCursorDependencyInfo

A value for describing dependencies between a media sample and other media samples in the same sample sequence.

currentSampleDuration

The presentation duration of the sample at the receiver's current position.

currentSampleIndexInChunk

The index of the current sample within the chunk to which it belongs.

currentSampleStorageRange

The offset and length of the current sample in the current chunk storage URL.

currentSampleSyncInfo

The synchronization information for the current sample for consideration when resynchronizing a decoder.

AVSampleCursorSyncInfo

A value that describes attributes of a media sample for consideration when resynchronizing a decoder.

- copyCurrentSampleFormatDescription

Returns the format description of the sample at the receiver's current position.

Relationships

Inherits From

Conforms To

See Also

Sample Buffer Manipulation

AVSampleBufferRequest

An object that describes a sample buffer creation request.

AVSampleBufferGenerator

An object used to create sample buffer opaque objects.

AVQueuedSampleBufferRendering

Methods you can implement to enqueue sample buffers for presentation.