<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 14.0.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCaptureInput/Port/sourceDeviceType",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCaptureInputPort(py)sourceDeviceType"
  },
  "title" : "sourceDeviceType"
}
-->

# sourceDeviceType

The device type of the source camera that provides data to the port.

```
var sourceDeviceType: AVCaptureDevice.DeviceType? { get }
```

## Discussion

All ports contained in an input’s [`ports`](/documentation/AVFoundation/AVCaptureInput/ports) property have the same source device type, which each equal to the [`deviceType`](/documentation/AVFoundation/AVCaptureDevice/deviceType-swift.property) property of the input’s device.

When working with virtual devices such as the [`builtInDualCamera`](/documentation/AVFoundation/AVCaptureDevice/DeviceType-swift.struct/builtInDualCamera) in an [`AVCaptureMultiCamSession`](/documentation/AVFoundation/AVCaptureMultiCamSession), it’s possible to stream media from the virtual device’s constituent device streams by discovering and connecting hidden ports. In the case of the [`builtInDualCamera`](/documentation/AVFoundation/AVCaptureDevice/DeviceType-swift.struct/builtInDualCamera), its constituent devices are the wide-angle and telephoto cameras.

By calling [`ports(for:sourceDeviceType:sourceDevicePosition:)`](/documentation/AVFoundation/AVCaptureDeviceInput/ports(for:sourceDeviceType:sourceDevicePosition:)):, you may discover ports originating from one or more of the virtual device’s constituent devices and then make connections using those ports. Constituent device ports are never present in their owning virtual device input’s ports array.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)