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

# VICustomVideoSource

Class that represents a custom video source.

@objc final class VICustomVideoSource

## Initializers

### init(forBroadcast:frameSize:)

@objc init(forBroadcast: Bool, frameSize: CGSize = .zero)

Creates a custom video source instance.

**Parameters**

**forBroadcast** Bool

Whether the video source is used for broadcast

**frameSize** CGSize

Video frame size

## Properties

### adaptedResolution

@objc var adaptedResolution: CGSize \{ get }

Video frame size.

### type

let type: [VISourceType](/api-reference/iossdk/calls/visourcetype)

Local video source type.

## Methods

### adaptResolutionFor(size:)

@objc func adaptResolutionFor(size: CGSize)

Sets a video frame size.

**Parameters**

**size** CGSize

Video frame size

The SDK crops and scales the video frames that it consumes by [capture(pixelBuffer:rotation:)](/api-reference/iossdk/calls/vicustomvideosource#symbol-3ac210ca1ac1518d) to this size.

### capture(pixelBuffer:rotation:)

@objc func capture(pixelBuffer: CVPixelBuffer, rotation: [VIVideoRotation](/api-reference/iossdk/calls/vivideorotation))

Consumes a video frame in `CVPixelBuffer` format.

**Parameters**

**pixelBuffer** CVPixelBuffer

Video frame pixel buffer. Buffer should have kCVPixelBufferMetalCompatibilityKey

**rotation** [VIVideoRotation](/api-reference/iossdk/calls/vivideorotation)

Video frame rotation

## Relationships

**Inherits From:** NSObject

**Conforms To:** ObjectiveC.NSObjectProtocol, Swift.CVarArg, Swift.CustomDebugStringConvertible, Swift.CustomStringConvertible, Swift.Equatable, Swift.Hashable, [VILocalVideoSource](/api-reference/iossdk/calls/vilocalvideosource)