Mac Developer Library

Developer

AVFoundation Framework Reference AVCaptureOutput Class Reference

Options
Deployment Target:

On This Page
Language:

AVCaptureOutput

Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in OS X v10.7 and later.

AVCaptureOutput is an abstract base-class describing an output destination of an AVCaptureSession object.

AVCaptureOutput provides an abstract interface for connecting capture output destinations, such as files and video previews, to an capture session (an instance of AVCaptureSession). A capture output can have multiple connections represented by AVCaptureConnection objects, one for each stream of media that it receives from a capture input (an instance of AVCaptureInput). A capture output does not have any connections when it is first created. When you add an output to a capture session, connections are created that map media data from that session’s inputs to its outputs.

You can add concrete AVCaptureOutput instances to an capture session using addOutput:.

  • The capture output object’s connections. (read-only)

    Declaration

    Swift

    var connections: [AnyObject]! { get }

    Objective-C

    @property(nonatomic, readonly) NSArray *connections

    Discussion

    The value of this property is an array of AVCaptureConnection objects, each describing the mapping between the receiver and the capture input ports (see AVCaptureInputPort) of one or more capture inputs (see AVCaptureInput).

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in OS X v10.7 and later.

  • Returns the first connection in the connections array with an input port of a specified media type.

    Declaration

    Swift

    func connectionWithMediaType(_ mediaType: String!) -> AVCaptureConnection!

    Objective-C

    - (AVCaptureConnection *)connectionWithMediaType:(NSString *)mediaType

    Parameters

    mediaType

    An AVMediaType constant from AVMediaFormat.h, for example, AVMediaTypeVideo.

    Return Value

    The first capture connection in the connections array that has an AVCaptureInputPort with media type mediaType, or nil if no connection with the specified media type is found.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in OS X v10.7 and later.