TVIVideoViewRenderer Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | TVIVideoRenderer |
| Declared in | TVIVideoViewRenderer.h |
– initWithDelegate:
Creates a video renderer with a delegate.
@discussuion The default video rendering type is determined based upon your device model. For 64-bit devices the Metal APIs will be used otherwise OpenGL ES video rendering APIs will be used.
- (nonnull instancetype)initWithDelegate:(nullable id<TVIVideoViewRendererDelegate>)delegateParameters
delegate |
An object implementing the TVIVideoViewRendererDelegate protocol (often a UIViewController). |
|---|
Return Value
A renderer which is appropriate for your device and OS combination.
Declared In
TVIVideoViewRenderer.h
+ rendererWithDelegate:
Creates a video renderer with a delegate.
@discussuion The default video rendering type is determined based upon your device model. For 64-bit devices the Metal APIs will be used otherwise OpenGL ES video rendering APIs will be used.
+ (nonnull TVIVideoViewRenderer *)rendererWithDelegate:(nullable id<TVIVideoViewRendererDelegate>)delegateParameters
delegate |
An object implementing the TVIVideoViewRendererDelegate protocol (often a UIViewController). |
|---|
Return Value
A renderer which is appropriate for your device and OS combination.
Declared In
TVIVideoViewRenderer.h
+ rendererWithRenderingType:delegate:
Creates a video renderer with a rendering type and a delegate.
+ (nonnull TVIVideoViewRenderer *)rendererWithRenderingType:(TVIVideoRenderingType)renderingType delegate:(nullable id<TVIVideoViewRendererDelegate>)delegateParameters
renderingType |
The rendering type. |
|---|---|
delegate |
An object implementing the TVIVideoViewRendererDelegate protocol (often a UIViewController). |
Return Value
A renderer which uses a specific TVIVideoRenderingType.
Returns nil if rendering type is not supported on the current device.
Discussion
The OpenGL ES renderer supports zero copy rendering of NV12 sources. However, it currently fails to create
textures when the input is an NV12 CVPixelBuffer without kCVPixelBufferOpenGLTextureCacheCompatibilityKey set to true.
This is only an issue for custom capturers which produce NV12 buffers without this flag set.
Declared In
TVIVideoViewRenderer.h
delegate
A delegate which receives callbacks when important renderer events occur.
@property (nonatomic, weak, readonly, nullable) id<TVIVideoViewRendererDelegate> delegateDiscussion
Note: The delegate is always called on the main thread in order to synchronize with UIKit.
Declared In
TVIVideoViewRenderer.h
videoFrameDimensions
The dimensions of incoming video frames (without rotations applied). Use this to layout the renderer’s view.
@property (nonatomic, assign, readonly) CMVideoDimensions videoFrameDimensionsDeclared In
TVIVideoViewRenderer.h
videoFrameOrientation
The orientation of incoming video frames. Use this to layout the renderer’s view.
@property (nonatomic, assign, readonly) TVIVideoOrientation videoFrameOrientationDeclared In
TVIVideoViewRenderer.h
hasVideoData
Indicates that at least one frame of video data has been received.
@property (atomic, assign, readonly) BOOL hasVideoDataDeclared In
TVIVideoViewRenderer.h
view
The renderer’s view. Add this to your view hierarchy to display rendered video content.
@property (nonatomic, strong, readonly, nonnull) UIView *viewDiscussion
The supported content modes are: UIViewContentModeScaleToFill, UIViewContentModeScaleAspectFit, and UIViewContentModeScaleAspectFill. UIViewContentModeScaleAspectFit is the default content mode.
Declared In
TVIVideoViewRenderer.h