Class

AVCaptureConnection

A connection between a specific pair of capture input and capture output objects in a capture session.

Overview

Capture inputs (instances of AVCaptureInput) have one or more input ports (instances of AVCaptureInputPort). Capture outputs (instances of AVCaptureOutput) can accept data from one or more sources (for example, an AVCaptureMovieFileOutput object accepts both video and audio data).

You can add an AVCaptureConnection instance to a session using the add(_:) method only if the canAdd(_:) method returns true. When using the addInput(_:) or addOutput(_:) method, connections are formed automatically between all compatible inputs and outputs. You only need to add connections manually when adding an input or output with no connections. You can also use connections to enable or disable the flow of data from a given input or to a given output.

Symbols

Creating a Connection

init!(inputPorts: [Any]!, output: AVCaptureOutput!)

Initializes a capture connection to describe a connection between the specified input ports and the specified output.

init!(inputPort: AVCaptureInputPort!, videoPreviewLayer: AVCaptureVideoPreviewLayer!)

Initializes a capture connection to describe a connection between the specified input port and the specified video preview layer.

Configuration

var isEnabled: Bool

Indicates whether the connection is enabled.

var isActive: Bool

Indicates whether the connection is active.

var inputPorts: [Any]!

The connection’s input ports.

var output: AVCaptureOutput!

The connection’s output port.

var videoPreviewLayer: AVCaptureVideoPreviewLayer!

The video preview layer associated with the connection.

Managing Video Configuration

var isVideoOrientationSupported: Bool

A Boolean value that indicates whether the connection supports changing the orientation of the video.

var videoFieldMode: AVVideoFieldMode

An indicator of how interlaced video flowing through the connection should be treated

var isVideoFieldModeSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoFieldMode property.

var videoMinFrameDuration: CMTime

The minimum time interval between which the receiver should output consecutive video frames.

var isVideoMinFrameDurationSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoMinFrameDuration property.

var videoMaxFrameDuration: CMTime

The maximum time interval between which the receiver should output consecutive video frames.

var isVideoMaxFrameDurationSupported: Bool

A Boolean value that indicates whether the connection supports setting the videoMaxFrameDuration property.

var videoScaleAndCropFactor: CGFloat

The current video scale and crop factor in use by the receiver.

var videoMaxScaleAndCropFactor: CGFloat

The maximum video scale and crop factor by the connection.

Managing the Video Mirroring Settings

var automaticallyAdjustsVideoMirroring: Bool

A Boolean value that indicates whether the value of isVideoMirrored can change based on configuration of the session.

var isVideoMirroringSupported: Bool

A Boolean value that indicates whether the connection supports video mirroring.

var isVideoMirrored: Bool

A Boolean value that indicates whether the video flowing through the connection should be mirrored about its vertical axis..

Managing the Video Stabilization Settings

var isVideoStabilizationSupported: Bool

A Boolean value that indicates whether this connection supports video stabilization.

var activeVideoStabilizationMode: AVCaptureVideoStabilizationMode

The stabilization mode currently active for the connection.

var preferredVideoStabilizationMode: AVCaptureVideoStabilizationMode

The stabilization mode most appropriate for use with the connection.

var isVideoStabilizationEnabled: Bool

A Boolean value that indicates whether video stabilization is active for the connection.

Deprecated
var enablesVideoStabilizationWhenAvailable: Bool

A Boolean value that indicates whether the system should enable video stabilization when it is available.

Deprecated

Constants

AVCaptureVideoOrientation

Constants indicating video orientation.

AVVideoFieldMode

Constants indicating video field mode, for use with the videoFieldMode property.

Relationships

Inherits From

Conforms To