ViewfinderSurfaceProvider


interface ViewfinderSurfaceProvider


A interface implemented by the application to provide a Surface for viewfinder.

This interface is implemented by the application to provide a Surface. This will be called by application when it needs a Surface for viewfinder. It also signals when the Surface is no longer in use.

Summary

Public functions

Unit

Called when a new Surface has been requested by the frame producer.

Public functions

onSurfaceRequested

Added in 1.4.0-alpha05
fun onSurfaceRequested(request: ViewfinderSurfaceRequest): Unit

Called when a new Surface has been requested by the frame producer.

This is called every time a new surface is required to keep the viewfinder running. The producer may repeatedly request surfaces, but only a single request will be active at a time.

Parameters
request: ViewfinderSurfaceRequest

the request for a surface which contains the requirements of the surface and methods for completing the request.