startMirroring

fun startMirroring(sceneView: SceneView, surface: Surface, left: Int = 0, bottom: Int = 0, width: Int = sceneView.width, height: Int = sceneView.height)

Mirror the rendering to a surface.

This can be used to video record the actual SceneView rendering.

To capture the contents of this view, designate a Surface onto which this SceneView should be mirrored. Use android.media.MediaRecorder.getSurface, android.media.MediaCodec.createInputSurface or android.media.MediaCodec.createPersistentInputSurface to obtain the input surface for recording. This will incur a rendering performance cost and should only be set when capturing this view. To stop the additional rendering, call stopMirroring.

Parameters

surface

the Surface onto which the rendered scene should be mirrored.

left

the left edge of the rectangle into which the view should be mirrored on surface.

bottom

the bottom edge of the rectangle into which the view should be mirrored on surface.

width

the width of the rectangle into which the SceneView should be mirrored on surface.

height

the height of the rectangle into which the SceneView should be mirrored on surface.