TWCVideoRenderer Protocol Reference

Conforms to NSObject
Declared in TWCVideoRenderer.h

Overview

TWCVideoRenderers render frames from video tracks. @note: All the renderers attached to a video track will be called back on the same background thread.

– renderFrame: required method

Render an individual frame.

- (void)renderFrame:(nonnull TWCI420Frame *)frame

Parameters

frame

The frame to be rendered.

Discussion

Render an individual frame.

Note: You must copy or strongly reference (retain) the TWCI420Frame object before this call returns.

Declared In

TWCVideoRenderer.h

– updateVideoSize:orientation: required method

Informs your renderer that the size and/or orientation of the video stream is about to change.

- (void)updateVideoSize:(CMVideoDimensions)videoSize orientation:(TWCVideoOrientation)orientation

Parameters

videoSize

The new dimensions for the video stream.

orientation

The new orientation of the video stream. Always TWCVideoOrientationUp unless you opt into orientation support.

Discussion

Informs your renderer that the size and/or orientation of the video stream is about to change.

Note: Expect the next delivered frame to have the new orientation.

Declared In

TWCVideoRenderer.h

– supportsVideoFrameOrientation

Indicates support for video frame orientation metadata.

- (BOOL)supportsVideoFrameOrientation

Return Value

Your renderer should return YES if it prefers un-rotated metadata tagged frames. If you would instead prefer pre-rotated frames you should either return NO or not implement this method.

Discussion

Indicates support for video frame orientation metadata.

Note: Supporting orientation allows frames to be delivered to the renderer without an additional copy.

Declared In

TWCVideoRenderer.h