TWCVideoConstraints Class Reference

Inherits from NSObject
Declared in TWCVideoConstraints.h

Overview

TWCVideoConstraints specifies requirements for local video capture.

Use this class in conjunction with TWCLocalVideoTrack to customize video capture for your use case. See TWCCameraCapturer.h for size and frame rate presets which pair well with that capturer. Note that TWCVideoConstraints is used to resolve the capture format, but the actual video sent to Participants may be downscaled temporally or spatially in response to network and device conditions.

+ constraints

The default video constraints.

+ (null_unspecified instancetype)constraints

Return Value

Video constraints.

Discussion

The default video constraints.

The default video constraints are determined based upon your device model. For 64-bit devices the default is 640x480x30. If you are using an older A5 device then 480x360x15 is returned, and for A5x, and A6 devices 480x360x20 is used instead.

Declared In

TWCVideoConstraints.h

+ constraintsWithBlock:

Constraints with user provided size, frame rate and aspect ratio.

+ (null_unspecified instancetype)constraintsWithBlock:(_Nonnull TWCVideoConstraintsBuilderBlock)builderBlock

Parameters

builderBlock

You can pass video constraints to the builder using this block. The builder will build a TWCVideoConstraints object using the settings you passed.

Return Value

Video Constraints

Discussion

Constraints with user provided size, frame rate and aspect ratio.

Declared In

TWCVideoConstraints.h

  maxSize

Specifies the maximum size for your video in native input coordinates (think landscape for TWCCameraCapturer).

@property (nonatomic, assign, readonly) CMVideoDimensions maxSize

Discussion

Specifies the maximum size for your video in native input coordinates (think landscape for TWCCameraCapturer).

Each dimension must be divisible by 8.

Declared In

TWCVideoConstraints.h

  minSize

Specifies the minimum size for your video in native input coordinates.

@property (nonatomic, assign, readonly) CMVideoDimensions minSize

Discussion

Specifies the minimum size for your video in native input coordinates.

Defaults to {0,0}, which indicates no minimum video size. Set this property if you wish to choose a size within the range of minSize and maxSize.

Declared In

TWCVideoConstraints.h

  maxFrameRate

Specifies the maximum frame rate of your video (frames per second).

@property (nonatomic, assign, readonly) NSUInteger maxFrameRate

Discussion

Specifies the maximum frame rate of your video (frames per second).

Frame rates are capped at TWCVideoConstraintsMaximumFPS.

Declared In

TWCVideoConstraints.h

  minFrameRate

Specifies the minimum frame rate of your video (frames per second).

@property (nonatomic, assign, readonly) NSUInteger minFrameRate

Discussion

Specifies the minimum frame rate of your video (frames per second).

Defaults to no minimum value.

Declared In

TWCVideoConstraints.h

  aspectRatio

Specifies the aspect ratio of your video.

@property (nonatomic, assign, readonly) TWCAspectRatio aspectRatio

Discussion

Specifies the aspect ratio of your video.

Declared In

TWCVideoConstraints.h