TVIVideoCapturer Protocol Reference

Conforms to NSObject
Declared in TVIVideoCapturer.h

Overview

TVIVideoCapturer defines a video capture source which provides frames directly to the video pipeline. You should expect that all of the methods defined in TVIVideoCapturer will be called on an internal worker thread in response to adding / removing a TVILocalVideoTrack. Capture implementations should provide a list of supported formats, and specify if their content is screen based or not. Ultimately, TVIVideoConstraints are used to determine which one of the supported formats is chosen. You should not call these methods directly!

  screencast required method

Indicates if the video pipeline should treat the content as a screen capture or normal video.

@property (nonatomic, assign, readonly, getter=isScreencast) BOOL screencast

Declared In

TVIVideoCapturer.h

  supportedFormats required method

Returns a list of all supported video formats this capturer supports.

@property (nonatomic, copy, readonly, nonnull) NSArray<TVIVideoFormat*> *supportedFormats

Discussion

This method will be invoked prior to startCapture. If you return no formats we will assume 640x480x30 and TVIPixelFormatYUV420BiPlanarFullRange as a default.

Declared In

TVIVideoCapturer.h

– startCapture:consumer: required method

Start capturing, and begin delivering frames to the capture consumer as soon as possible.

- (void)startCapture:(nonnull TVIVideoFormat *)format consumer:(nonnull id<TVIVideoCaptureConsumer>)consumer

Parameters

format

The format which has been selected via TVIVideoConstraints. Please note that WebRTC doesn’t fully understand video range vs full range, so if you specify a video range format it will come back as full range. You can continue to capture and deliver in video range if you wish.

consumer

The consumer. You should weakly reference this consumer until stopCapture is called.

Discussion

When this method is called your capturer should prepare any resources it needs, and start capturing video. Your capturer MUST call captureDidStart on the consumer once it has either succeeded or failed to start. If your capturer starts synchronously you may inform the consumer before this callback returns. As frames are captured you should deliver them to the consumer by calling consumeCapturedFrame: with a TVIVideoFrame. You should not call this method yourself, it is invoked in response to adding a video track to TVILocalMedia.

Declared In

TVIVideoCapturer.h

– stopCapture required method

Stop capturing, and do not deliver any more frames to TVIVideoCaptureConsumer.

- (void)stopCapture

Discussion

This method will be invoked on an internal worker thread. Your capturer should block until capture has stopped. You should not call this method yourself, it is invoked in response to removing a video track from TVILocalMedia.

Declared In

TVIVideoCapturer.h