RenderThread

open class RenderThread

RenderThread waits for the SphericalVideoPlayer's SurfaceTexture to be available then sets up a GL rendering context, creates an external texture for the video decoder to output to, asks for vsync updates from the Choreographer, attaches a frame available listener the video decode SurfaceTexture, then begins video playback.

Drag events from the main thread will be forwarded to the RenderThread's message queue so that it may update the view state.

SphericalSceneRenderer draws the 360 video scene each frame using the latest latched video texture frame.

Constructors

Link copied to clipboard
constructor(renderView: RenderView)
Constructs a new 360 video renderer.

Properties

Link copied to clipboard
val FOVY: Float = 70.0f
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val MSG_VSYNC: Int = 5
Link copied to clipboard
val Z_FAR: Float = 1000.0f
Link copied to clipboard
val Z_NEAR: Float = 1.0f

Functions

Link copied to clipboard
open fun getVideoDecodeSurface(): Surface
Creates a new Surface that will be used to render the 360 video.
Link copied to clipboard
open fun isVrMode(): Boolean
Checks whether the renderer is currently configured to render the video in Google VR mode.
Link copied to clipboard
open fun notifySurfaceAvailable(surface: Any, width: Int, height: Int)
Notifies the video render thread that the surface is available.
Link copied to clipboard
open fun notifySurfaceChanged(surface: Surface, width: Int, height: Int)
Notifies the video render thread that the surface has changed.
Link copied to clipboard
Notifies the video render thread that the surface has been destroyed.
Link copied to clipboard
open fun setOnFrameAvailableListener(onFrameAvailableListener: OnFrameAvailableListener)
Link copied to clipboard
open fun setVrMode(vrMode: Boolean)
Sets whether the renderer should render the video in Google VR mode.
Link copied to clipboard
open fun start()
Starts the render thread to run asynchronously.