iOS Developer Library

Developer

AVFoundation Framework Reference AVCaptureInputPort Class Reference

Options
Deployment Target:

On This Page
Language:

AVCaptureInputPort

Inheritance


Conforms To


Import Statement


Swift

import AVFoundation

Objective-C

@import AVFoundation;

Availability


Available in iOS 4.0 and later.

An AVCaptureInputPort represents a stream of data from a capture input.

Instances of AVCaptureInput have one or more input ports, one for each data stream they can produce. For example, an AVCaptureDeviceInput object presenting one video data stream has one port.

  • enabled enabled Property

    Indicates whether the port is enabled.

    Declaration

    Swift

    var enabled: Bool

    Objective-C

    @property(nonatomic, getter=isEnabled) BOOL enabled

    Discussion

    The value of this property defaults to YEStrue. If you want to capture only a subset of the media streams provided by an AVCaptureInput object, use this property to selectively disable streams.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • A description of the port format. (read-only)

    Declaration

    Swift

    var formatDescription: CMFormatDescription! { get }

    Objective-C

    @property(nonatomic, readonly) CMFormatDescriptionRef formatDescription

    Discussion

    The returned object describes the format of the media currently provided by the port. To be notified of format changes, subscribe to the AVCaptureInputPortFormatDescriptionDidChangeNotification notification.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • input input Property

    The input object that owns the port. (read-only)

    Declaration

    Swift

    var input: AVCaptureInput! { get }

    Objective-C

    @property(nonatomic, readonly) AVCaptureInput *input

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

  • mediaType mediaType Property

    The port’s media type. (read-only)

    Declaration

    Swift

    var mediaType: String! { get }

    Objective-C

    @property(nonatomic, readonly) NSString *mediaType

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 4.0 and later.

    See Also

    Media Types

  • clock clock Property

    An object representing the capture device’s own clock. (read-only)

    Declaration

    Swift

    var clock: CMClock! { get }

    Objective-C

    @property(nonatomic, readonly) CMClockRef clock

    Discussion

    The returned CMClock object is read-only and may not reflect the actual clock in the capture device.

    Import Statement

    Objective-C

    @import AVFoundation;

    Swift

    import AVFoundation

    Availability

    Available in iOS 7.0 and later.