An object that provides information about the current media sample at its current position.
- macOS 10.10+
AVSample instance is always positioned at a specific media sample in a sequence of samples as defined by a higher-level construct, such as an
AVAsset. 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.
AVSample 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”.
AVSample 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.