AVPlayerItemVideoOutput Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework |
| Availability | Available in iOS 6.0 and later. |
| Declared in | AVPlayerItemOutput.h |
Overview
The AVPlayerItemVideoOutput lets you coordinate the output of content associated with a Core Video pixel buffer.
Tasks
Initializing the Player Item Video Output
Accessing the Delegate
-
delegateproperty -
delegateQueueproperty -
– setDelegate:queue:
Notifying the Delegate of Changes
Getting Pixel Buffer Data
Properties
delegate
The delegate for the video output object. (read-only)
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVPlayerItemOutput.hdelegateQueue
The dispatch queue on which to call delegate methods. (read-only)
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVPlayerItemOutput.hInstance Methods
copyPixelBufferForItemTime:itemTimeForDisplay:
Acquires and returns an image that is appropriate to display at the specified time.
Parameters
- itemTime
The time at which you want to retrieve the image from the item.
- outItemTimeForDisplay
The time by which you intend to use the returned pixel buffer. You may specify
nilfor this parameter if you do not have a specific deadline.
Return Value
A pixel buffer containing the image data to display or nil if nothing should be displayed at the specified time. The caller is responsible for calling CVBufferRelease on the returned data when it is no longer needed.
Discussion
Typically, you call this method in response to a CVDisplayLink callback or a CADisplayLink delegate method call when the hasNewPixelBufferForItemTime: method also returns YES.
After calling this method, the video output object marks the pixel buffer data as having been acquired. This causes the hasNewPixelBufferForItemTime: method to return NO unless newer data becomes available.
Availability
- Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.hhasNewPixelBufferForItemTime:
Returns a Boolean value indicating whether video output is available for the specified item time.
Parameters
- itemTime
The item time to query. The time value is relative to the
AVPlayerItemobject with which the receiver is associated.
Return Value
YES if there is available video output that has not been previously acquired or NO if there is not.
Discussion
This method returns YES if the video data at the specified time has not yet been acquired or is different from the video that was acquired previously. If you require multiple objects to acquire video output from the same AVPlayerItem object, you should create separate AVPlayerItemVideoOutput objects for each.
Availability
- Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.hinitWithPixelBufferAttributes:
Initializes and returns a video output object using the specified pixel buffer attributes.
Parameters
- pixelBufferAttributes
The pixel buffer attributes required for video output. For a list of pixel buffer attributes you can include in this dictionary, see the
CVPixelBuffer.hheader file in the Core Video framework.
Return Value
An initialized video output object.
Availability
- Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.hrequestNotificationOfMediaDataChangeWithAdvanceInterval:
Informs the receiver that the video out put client is entering a quiescent state.
Parameters
- interval
The amount of time to wait before notifying the delegate of the media change.
Discussion
Call this method before you suspend your use of a CVDisplayLinkRef type or a CADisplayLink object. After the interval expires, the video output object notifies its delegate that it should resume the display link. If the interval value you specify is large, the delegate is notified as soon as possible rather than waiting.
Do not call this method repeatedly to force the delegate to be notified for each sample.
Availability
- Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.hsetDelegate:queue:
Sets the delegate and dispatch queue for the receiver.
Parameters
- delegate
The delegate object for the receiver. You may specify
nilfor this parameter.- delegateQueue
The dispatch queue on which to call delegate methods. If you specify
nilfor this parameter, the video output object calls the delegate on the dispatch queue for your app’s main thread.
Availability
- Available in iOS 6.0 and later.
Declared In
AVPlayerItemOutput.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)