> For a complete documentation index, fetch https://docs.voximplant.ai/llms.txt

# CameraVideoSource (object)

[video](/api-reference/androidsdk3/android/sdk/calls/video/overview)

Class that represents a video source that captures frames from the device's camera.

Requires [VICalls.initialize](/api-reference/androidsdk3/android/sdk/calls/vicalls#initialize) and the CAMERA permission. Use [VICalls.getMissingPermissions](/api-reference/androidsdk3/android/sdk/calls/vicalls#getmissingpermissions) to check required permissions before starting video.

Use [selectCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#selectcameradevice) and [setPreferredResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#setpreferredresolution) to configure the camera before or during a call. Subscribe to capture lifecycle events via [VideoSource.addListener](/api-reference/androidsdk3/android/sdk/calls/video/videosource#addlistener).

Inherits from [VideoSource](/api-reference/androidsdk3/android/sdk/calls/video/videosource).

**Methods**

* [selectCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#selectcameradevice)
* [setPreferredResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#setpreferredresolution)

**Properties**

* [cameraDevices](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#cameradevices)
* [cameraOrientation](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#cameraorientation)
* [currentCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#currentcameradevice)
* [preferredResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#preferredresolution)

## Methods

### selectCameraDevice

`fun selectCameraDevice(cameraDevice: `[`CameraDevice`](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice)`): Unit`

Switches capture to the specified camera device.

Updates [CameraVideoSource.currentCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#currentcameradevice). If capture is not running, the device gets selected and activated when capture starts.

**Parameters**

| Parameter      | Type                                                                              | Requirement | Description                                                                                                                                        |
| -------------- | --------------------------------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| `cameraDevice` | [`CameraDevice`](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice) |             | Camera device from [CameraVideoSource.cameraDevices](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#cameradevices) to select |

**Returns:** Unit

### setPreferredResolution

`fun setPreferredResolution(resolution: `[`CameraResolution`](/api-reference/androidsdk3/android/sdk/calls/video/cameraresolution)`): Unit`

Sets the preferred capture resolution for all camera devices.

Updates [preferredResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#preferredresolution). The closest supported resolution from each device's [CameraDevice.supportedResolutions](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice#supportedresolutions) is selected. If capture is already running, the new resolution is applied to [currentCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#currentcameradevice).

**Parameters**

| Parameter    | Type                                                                                      | Requirement | Description                                    |
| ------------ | ----------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------- |
| `resolution` | [`CameraResolution`](/api-reference/androidsdk3/android/sdk/calls/video/cameraresolution) |             | Preferred camera resolution for camera capture |

**Returns:** Unit

## Properties

### cameraDevices

`var cameraDevices: List<`[`CameraDevice`](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice)`>`

List of available camera devices on the Android device.

Pass an element from this list to [selectCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#selectcameradevice) to switch cameras.

### cameraOrientation

`var cameraOrientation: `[`CameraOrientation`](/api-reference/androidsdk3/android/sdk/calls/video/cameraorientation)

Orientation mode used when capturing video frames.

[CameraOrientation.Screen](/api-reference/androidsdk3/android/sdk/calls/video/cameraorientation#screen) follows the screen orientation. [CameraOrientation.Device](/api-reference/androidsdk3/android/sdk/calls/video/cameraorientation#device) follows the device orientation.

The default value is [CameraOrientation.Screen](/api-reference/androidsdk3/android/sdk/calls/video/cameraorientation#screen).

### currentCameraDevice

`var currentCameraDevice: `[`CameraDevice`](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice)`?`

Camera device used for capture.

Active device while capture is running, or the device used when capture starts. Change it via [selectCameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#selectcameradevice).

Device-specific options such as [CameraDevice.flash](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice#flash) can be configured on this [CameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice).

### preferredResolution

`var preferredResolution: `[`CameraResolution`](/api-reference/androidsdk3/android/sdk/calls/video/cameraresolution)

Preferred camera resolution.

The closest supported resolution from [CameraResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameraresolution) is selected for each [CameraDevice](/api-reference/androidsdk3/android/sdk/calls/video/cameradevice) in [CameraVideoSource.cameraDevices](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#cameradevices). You can change this value via [CameraVideoSource.setPreferredResolution](/api-reference/androidsdk3/android/sdk/calls/video/cameravideosource#setpreferredresolution).

The default value is [CameraResolution.Medium](/api-reference/androidsdk3/android/sdk/calls/video/cameraresolution#companion_medium) (640x480).