Class: AVPlayerItemVideoOutput

Inherits:
AVPlayerItemOutput show all

Overview

The AVPlayerItemVideoOutput lets you coordinate the output of content associated with a Core Video pixel buffer.

Instance Attribute Summary (collapse)

Attributes inherited from AVPlayerItemOutput

#suppressesPlayerRendering

Instance Method Summary (collapse)

Methods inherited from AVPlayerItemOutput

#itemTimeForHostTime:, #itemTimeForMachAbsoluteTime:

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (Object) delegate (readonly)

The delegate for the video output object. (read-only)

Returns:

- (dispatch_queue_t) delegateQueue (readonly)

The dispatch queue on which to call delegate methods. (read-only)

Returns:

  • (dispatch_queue_t)

Instance Method Details

- (CVPixelBufferRef) copyPixelBufferForItemTime(itemTime, itemTimeForDisplay:outItemTimeForDisplay)

Acquires and returns an image that is appropriate to display at the specified time. 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.

Parameters:

  • itemTime (CMTime)

    The time at which you want to retrieve the image from the item.

  • outItemTimeForDisplay (CMTime)

    The time by which you intend to use the returned pixel buffer. You may specify nil for this parameter if you do not have a specific deadline.

Returns:

  • (CVPixelBufferRef)

    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.

- (Boolean) hasNewPixelBufferForItemTime(itemTime)

Returns a Boolean value indicating whether video output is available for the specified item time. 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.

Parameters:

  • itemTime (CMTime)

    The item time to query. The time value is relative to the AVPlayerItem object with which the receiver is associated.

Returns:

  • (Boolean)

    YES if there is available video output that has not been previously acquired or NO if there is not.

- (Object) initWithPixelBufferAttributes(pixelBufferAttributes)

Initializes and returns a video output object using the specified pixel buffer attributes.

Parameters:

  • pixelBufferAttributes (Hash)

    The pixel buffer attributes required for video output. For a list of pixel buffer attributes you can include in this dictionary, see the CVPixelBuffer.h header file in the Core Video framework.

Returns:

  • (Object)

    An initialized video output object.

- (Object) requestNotificationOfMediaDataChangeWithAdvanceInterval(interval)

Informs the receiver that the video out put client is entering a quiescent state. 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.

Parameters:

  • interval (NSTimeInterval)

    The amount of time to wait before notifying the delegate of the media change.

Returns:

- (Object) setDelegate(delegate, queue:delegateQueue)

Sets the delegate and dispatch queue for the receiver.

Parameters:

  • delegate (Object)

    The delegate object for the receiver. You may specify nil for this parameter.

  • delegateQueue (dispatch_queue_t)

    The dispatch queue on which to call delegate methods. If you specify nil for this parameter, the video output object calls the delegate on the dispatch queue for your app’s main thread.

Returns: