GCKViewVideoFrameInput Class

GCKViewVideoFrameInput Class Reference

Overview

Specialization of GCKVideoFrameInput for UIKit views.

This video frame input makes it easier to mirror a UIKit view with Remote Display. Unlike the OpenGL ES and Metal video frame inputs, this frame input performs most of the work on your behalf. It will create a display link attached to the screen of its input view and start snapshotting the view with a frame interval of 3. This will yield a 15 fps stream.

You may change the view at any time. The frame input maintains a weak reference to its target view to ensure it does not keep view objects alive past their normal lifetime. Setting the view to nil will invalidate any existing display link.

See also
GCKRemoteDisplaySession

Limitations

The performance of this frame input is severely limited by view snapshot APIs. It is very costly to capture the contents of a view hierarchy and the cost is directly related to the complexity of the view tree. You may get better performance by rasterizing views you intend to mirror.

Views that are not owned by the app process cannot be mirrored. This includes keyboards and other remove views such as those provided by app extensions. The view must be onscreen. See the documentation for the UISnapshotting category for more information.

Because this frame input interacts with UIKit, it can only be used from the main thread.

Inherits GCKVideoFrameInput.

Instance Method Summary

(instancetype) - initWithSession:
 Initialize a new video frame input bound to the specified session. More...
 
(instancetype) - NS_UNAVAILABLE
 

Properties

UIView * view
 The view to stream. More...
 
BOOL paused
 Proxy for the paused property of the driving CADisplayLink. More...
 
NSInteger frameInterval
 Proxy for the frameInterval property of the driving CADisplayLink. More...
 
id< GCKRemoteDisplaySessionsession
 Remote Display session the input is bound to. More...
 
uint32_t width
 Width of the session's video stream. More...
 
uint32_t height
 Height of the session's video stream. More...
 

Method Detail

- (instancetype) initWithSession: (id< GCKRemoteDisplaySession >)  session

Initialize a new video frame input bound to the specified session.

Property Documentation

- (UIView*) view
readwritenonatomicweak

The view to stream.

May be a UIWindow.

- (BOOL) paused
readwritenonatomicassign

Proxy for the paused property of the driving CADisplayLink.

Defaults to NO.

- (NSInteger) frameInterval
readwritenonatomicassign

Proxy for the frameInterval property of the driving CADisplayLink.

Defaults to 3.

- (id<GCKRemoteDisplaySession>) session
readnonatomicweakinherited

Remote Display session the input is bound to.

- (uint32_t) width
readnonatomicassigninherited

Width of the session's video stream.

- (uint32_t) height
readnonatomicassigninherited

Height of the session's video stream.

Google Cast iOS Sender API Reference v 2.10.1 4691