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 (640x480x30).

+ (null_unspecified instancetype)constraints

Return Value

Video constraints.

Discussion

The default video constraints (640x480x30).

Declared In

TWCVideoConstraints.h

+ constraintsWithMinSize:

Constraints with a user provided minimum size and default max frame rate (30fps).

+ (null_unspecified instancetype)constraintsWithMinSize:(CMVideoDimensions)minSize

Parameters

minSize

The minimum video size that is acceptable for capture.

Return Value

Video constraints.

Discussion

Constraints with a user provided minimum size and default max frame rate (30fps).

This method is useful when you want to require a minimum video resolution (such as for HD calling).

Declared In

TWCVideoConstraints.h

+ constraintsWithMaxSize:

Constraints with a user provided maximum size and the default max frame rate (30fps).

+ (null_unspecified instancetype)constraintsWithMaxSize:(CMVideoDimensions)maxSize

Parameters

maxSize

The maximum video size that is acceptable for capture.

Return Value

Video constraints.

Discussion

Constraints with a user provided maximum size and the default max frame rate (30fps).

This method is useful when you want to require a maximum video resolution (such as for sub-SD calling).

Declared In

TWCVideoConstraints.h

+ constraintsWithMaxSize:minSize:maxFrameRate:minFrameRate:

Constraints with user provided size and frame rate ranges. @discussion: This advanced method allows you to select from within a range of acceptable values.

+ (null_unspecified instancetype)constraintsWithMaxSize:(CMVideoDimensions)maxSize minSize:(CMVideoDimensions)minSize maxFrameRate:(NSUInteger)maxFrameRate minFrameRate:(NSUInteger)minFrameRate

Parameters

maxSize

The maximum video size you will accept.

minSize

The minimum video size you will accept.

maxFrameRate

The maximum video frame rate you will accept.

minFrameRate

The minimum video frame rate you will accept.

Return Value

Video constraints.

Discussion

Constraints with user provided size and frame rate ranges. @discussion: This advanced method allows you to select from within a range of acceptable values.

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