SimulatorVideoCapturer

class SimulatorVideoCapturer(constraints: WebRtcMedia.VideoTrackConstraints, videoCapturerDelegate: RTCVideoCapturerDelegateProtocol) : Capturer(source)

Sample video capturer that generates synthetic video frames with animated gradient patterns.

This capturer is particularly useful in iOS simulators where camera access is not available, as it emits video with moving gradients and color patterns to verify actual video transfer functionality during development and testing.

**Performance Optimization: ** This implementation uses frame caching to achieve optimal performance. A set of pre-calculated frames (15) are generated once during initialization and then cycled through during video capture. This eliminates the need for real-time pixel calculations, significantly improving frame generation speed.

Report a problem

Parameters

constraints

Video track constraints specifying frame dimensions and rate

videoCapturerDelegate

Delegate for handling captured video frames

Constructors

Link copied to clipboard
constructor(constraints: WebRtcMedia.VideoTrackConstraints, videoCapturerDelegate: RTCVideoCapturerDelegateProtocol)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override var isCapturing: Boolean

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun startCapture()
Link copied to clipboard
open override fun stopCapture()