AVCaptureMetadataOutput Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/AVFoundation.framework |
| Availability | Available in iOS 6.0 and later. |
| Declared in | AVCaptureOutput.h |
Overview
An AVCaptureMetadataOutput object intercepts metadata objects emitted by its associated capture connection and forwards them to a delegate object for processing. You can use instances of this class to process specific types of metadata included with the input data. You use this class like you do other output objects, typically by adding it as an output to an AVCaptureSession object.
Tasks
Accessing the Delegate and Callback Queue
-
– setMetadataObjectsDelegate:queue: -
metadataObjectsDelegateproperty -
metadataObjectsCallbackQueueproperty
Accessing the Supported Metadata Types
-
availableMetadataObjectTypesproperty -
metadataObjectTypesproperty
Properties
availableMetadataObjectTypes
An array of strings identifying the types of metadata objects that can be captured. (read-only)
Discussion
Each string in the array corresponds to a possible value in the type property of the AVMetadataObject objects reported by the receiver. The available types are dependent on the capabilities of the AVCaptureInputPort to which the receiver’s connection is attached.
Availability
- Available in iOS 6.0 and later.
Declared In
AVCaptureOutput.hmetadataObjectsCallbackQueue
The dispatch queue on which to execute the delegate’s methods. (read-only)
Discussion
To set the dispatch queue, you must use the setMetadataObjectsDelegate:queue: method.
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVCaptureOutput.hmetadataObjectsDelegate
The delegate of the receiver. (read-only)
Discussion
The delegate object must conform to the AVCaptureMetadataOutputObjectsDelegate protocol. The object in this property is used to process all metadata objects captured from the receiver’s connection.
To set the delegate object, you must use the setMetadataObjectsDelegate:queue: method.
Availability
- Available in iOS 6.0 and later.
See Also
Declared In
AVCaptureOutput.hmetadataObjectTypes
An array of strings identifying the types of metadata objects that you want to process.
Discussion
Each string in the array corresponds to a possible value in the type property of the AVMetadataObject objects reported by the receiver. You can use this property to filter the metadata objects reported by the receiver. Only metadata objects whose type matches one of the strings in this property are actually forwarded to the delegate for processing. Assigning an empty array to this property removes any filters and allows all objects to be processed.
When assigning a new array to this property, the type strings in the array must match the type strings reported by the availableMetadataObjectTypes property. If you specify a type string that is not in the availableMetadataObjectTypes array, the receiver raises an exception.
Availability
- Available in iOS 6.0 and later.
Declared In
AVCaptureOutput.hInstance Methods
setMetadataObjectsDelegate:queue:
Sets the delegate and dispatch queue to use handle callbacks.
Parameters
- objectsDelegate
The delegate object to notify when new metadata objects become available. This object must conform to the
AVCaptureMetadataOutputObjectsDelegateprotocol.- objectsCallbackQueue
The dispatch queue on which to execute the delegate’s methods. This queue must be a serial queue to ensure that metadata objects are delivered in the order in which they were received. If the objectsDelegate parameter is
nil, you may specifynilfor this parameter too; otherwise, you must specify a valid dispatch queue.
Discussion
When new metadata objects are captured from the receiver’s connection, they are vended to the delegate object. All delegate methods are executed on the dispatch queue specified in the objectsCallbackQueue parameter. To ensure that metadata objects are processed in a timely manner and not dropped, you should specify a dispatch queue dedicated to processing the objects or that is otherwise not busy.
Availability
- Available in iOS 6.0 and later.
Declared In
AVCaptureOutput.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)