AVPlayerItemOutput Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/AVFoundation.framework
Availability
Available in iOS 6.0 and later.
Declared in
AVPlayerItemOutput.h
Related sample code

Overview

The AVPlayerItemOutput class is an abstract class that defines the common interface for moving samples from an asset to an AVPlayer object. You do not create instances of this class directly but instead use one of the concrete subclasses that manage specific types of assets.

This class provides basic methods for converting time values to the timebase of the item. It also provides an option to suppress rendering of the output associated with the specific instance of this class.

Tasks

Converting Time Information

Configuring the Playback Options

Properties

suppressesPlayerRendering

A Boolean indicating whether the player object renders the receiver’s output.

@property (nonatomic, readwrite) BOOL suppressesPlayerRendering
Discussion

When the value of this property is NO (the default), the player object handles the rendering of the receiver’s associated output. You can change the value of this property to YES if you want to suppress the rendering of the media data associated with this object.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.h

Instance Methods

itemTimeForHostTime:

Converts a host time (specified in seconds) to the item’s timebase.

- (CMTime)itemTimeForHostTime:(CFTimeInterval)hostTimeInSeconds
Parameters
hostTimeInSeconds

A host time value, specified in seconds. For example, you might specify the time value returned by the CACurrentMediaTime function or the timestamp from a CADisplayLink object for this parameter.

Return Value

The equivalent time in the item’s timebase.

Discussion

The timestamp associated with a CADisplayLink object represents the time of the most recent screen refresh, which is usually a time in the past. If you want to find the time associated with the next screen refresh, you need to increment the timestamp by the value in the display link’s duration property.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.h

itemTimeForMachAbsoluteTime:

Converts a Mach host time to the item’s timebase.

- (CMTime)itemTimeForMachAbsoluteTime:(int64_t)machAbsoluteTime
Parameters
machAbsoluteTime

The Mach host time to convert. You typically retrieve this value using the mach_absolute_time function.

Return Value

The equivalent time in the item’s timebase.

Availability
  • Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.h