Static AVMediaTypeMetadataObject

Source
pub unsafe static AVMediaTypeMetadataObject: Option<&'static AVMediaType>
Available on crate feature AVMediaFormat only.
Expand description

mediaType of AVCaptureInputPorts that provide AVMetadataObjects.

Prior to iOS 9.0, camera AVCaptureDeviceInputs provide metadata (detected faces and barcodes) to an AVCaptureMetadataOutput through an AVCaptureInputPort whose mediaType is AVMediaTypeMetadata. The AVCaptureMetadataOutput presents metadata to the client as an array of AVMetadataObjects, which are defined by Apple and not externally subclassable. Starting in iOS 9.0, clients may record arbitrary metadata to a movie file using the AVCaptureMovieFileOutput. The movie file output consumes metadata in a different format than the AVCaptureMetadataOutput, namely it accepts CMSampleBuffers of type ‘meta’. Starting in iOS 9.0, two types of AVCaptureInput can produce suitable metadata for the movie file output.

  • The camera AVCaptureDeviceInput now presents an additional AVCaptureInputPort for recording detected faces to a movie file. When linked on or after iOS 9, ports that deliver AVCaptureMetadataObjects have a mediaType of AVMediaTypeMetadataObject rather than AVMediaTypeMetadata. Input ports that deliver CMSampleBuffer metadata have a mediaType of AVMediaTypeMetadata.
  • New to iOS 9 is the AVCaptureMetadataInput, which allows clients to record arbitrary metadata to a movie file. Clients package metadata as an AVTimedMetadataGroup, the AVCaptureMetadataInput presents a port of mediaType AVMediaTypeMetadata, and when connected to a movie file output, transforms the timed metadata group's AVMetadataItems into CMSampleBuffers which can be written to the movie file.

When linked on or after iOS 9, AVCaptureInputPorts with a mediaType of AVMediaTypeMetadata are handled specially by the AVCaptureSession. When inputs and outputs are added to the session, the session does not form connections implicitly between eligible AVCaptureOutputs and input ports of type AVMediaTypeMetadata. If clients want to record a particular kind of metadata to a movie, they must manually form connections between a AVMediaTypeMetadata port and the movie file output using AVCaptureSession’s -addConnection API.

See also Apple’s documentation